系统版本:mac osx 10.11.2、 Xcode 7.2
➜ php-7.0.0 uname -a
Darwin MacBook-Pro.local 15.2.0 Darwin Kernel Version 15.2.0: Fri Nov 13 19:56:56 PST 2015; root:xnu-3248.20.55~2/RELEASE_X86_64 x86_64
➜ php-7.0.0 uname -p
i386
➜ php-7.0.0 ./configure --prefix=/usr/local/php7 --with-config-file-path=/usr/local/php7/etc --enable-fpm --with-fpm-user=www --with-fpm-group=www --with-mysqli --with-pdo-mysql --with-iconv-dir --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir=/usr --enable-xml --disable-rpath --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --with-curl --enable-mbregex --enable-mbstring --with-mcrypt --enable-ftp --with-gd --enable-gd-native-ttf --with-openssl=/usr/local/opt/openssl --with-mhash --enable-pcntl --enable-sockets --with-xmlrpc --enable-zip --enable-soap --without-pear --with-gettext=/usr/local/opt/gettext --disable-fileinfo --enable-maintainer-zts
这个通过了。但在make的时候,提示以下错误:
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
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [sapi/cli/php] Error 1
make -v
GNU Make 3.81
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
This program built for i386-apple-darwin11.3.0
应该如何解决?试了一些办法还是不行
这里应该是动态链接库的问题,但是我没查到如何更新Mac的动态链接库。
执行
brew list openssl
可以看到当前openssl安装的位置,查不出什么问题来。所以我执行brew search openssl
查看到目前可用的openssl版本,brew remove openssl
删除了当前安装的--with-openssl=/usr/local/Cellar/openssl/1.0.2d_1/
,重装了brew install openssl098
问题解决了。