mac下php7.0.9的編譯安裝及問題處理總結
阿新 • • 發佈:2019-02-20
configure: error: jpeglib.h not found.
configure
configure: error: freetype-config not found.
configure: error:Cannot locate header file libintl.h
wget http://ftp.gnu.org/pub/gnu/gettext/gettext-0.19.2.tar.xz
tar -zxvf gettext-0.19.2.tar.xz
cd gettext
./configure
make
sudo make install
configure: error: mcrypt.h not found.Please reinstall libmcrypt.
make test
又報錯,說ext/mysqlnd裡缺少mysqlnd/evp.h檔案。像上面那樣處理,通過。
又報錯:
undefined symbols for architecture x86_64
xcode-select --install
Undefined symbols for architecture x86_64:
"_PKCS5_PBKDF2_HMAC", referenced from:
_zif_openssl_pbkdf2 in openssl.o
"_SSL_CTX_set_alpn_protos", referenced from:
_php_openssl_setup_crypto in xp_ssl.o
"_SSL_CTX_set_alpn_select_cb", referenced from:
_php_openssl_setup_crypto in xp_ssl.o
"_SSL_get0_alpn_selected", referenced from:
_php_openssl_sockop_set_option in xp_ssl.o
"_SSL_select_next_proto", referenced from:
_server_alpn_callback in xp_ssl.o
"_TLSv1_1_client_method", referenced from:
_php_openssl_setup_crypto in xp_ssl.o
"_TLSv1_1_server_method", referenced from:
_php_openssl_setup_crypto in xp_ssl.o
"_TLSv1_2_client_method", referenced from:
_php_openssl_setup_crypto in xp_ssl.o
"_TLSv1_2_server_method", referenced from:
_php_openssl_setup_crypto in xp_ssl.o
ld: symbol(s) not found for architecture x86_64
此bug的官方報告: 安裝了homebrew,說是用來做包依賴管理的。 從這個地址安裝: 使用
brew list openssl
brew install openssl
NeodeMacBook-Pro:openssl neosong$ brew list openssl
/usr/local/Cellar/openssl/1.0.2h_1/bin/c_rehash
/usr/local/Cellar/openssl/1.0.2h_1/bin/openssl
/usr/local/Cellar/openssl/1.0.2h_1/include/openssl/(75 files)
/usr/local/Cellar/openssl/1.0.2h_1/lib/libcrypto.1.0.0.dylib
/usr/local/Cellar/openssl/1.0.2h_1/lib/libssl.1.0.0.dylib
/usr/local/Cellar/openssl/1.0.2h_1/lib/engines/(12 files)
/usr/local/Cellar/openssl/1.0.2h_1/lib/pkgconfig/(3 files)
/usr/local/Cellar/openssl/1.0.2h_1/lib/(4 other files)
/usr/local/Cellar/openssl/1.0.2h_1/share/man/(1588 files)
按文章裡的建議,說在配置的時候,--with-openssl=/usr/local/Cellar/openssl/1.0.2h_1 這樣就可以解決前面的問題了。