mac os 编译安装php configure时遇到错误
configure: error: Cannot find OpenSSL's <evp.h>
说是没有找到openssl的库,但是openssl已经通过brew install openssl安装好了,于是想着安装openssl-devel,但是mac上没有看到相关的,于是编译安装了openssl,指定里面的库文件目录(--with-openssl-dir=/usr/local/openssl),发现还是不行。最后看到一位网友的文章得到启示。https://segmentfault.com/a/1190000007112520
最后解决方案很简单,把路径指定到brew安装的openssl的目录即可:
--with-openssl-dir=/usr/local/Cellar/openssl/1.0.2l/
最后编译成功。
另外configure时通过了,但是make时报错:
fatal error 'openssl/evp.h' file not found
也是同样的解决方案。
转载请注明:MitNick » mac os 编译安装php时遇到configure: error: Cannot find OpenSSL’s
--with-openssl=DIR Include OpenSSL support (requires OpenSSL >= 0.9.6)
--with-openssl-dir=DIR FTP: openssl install prefix
--with-openssl-dir=DIR SNMP: openssl install prefix
Nick-Mac:php-5.6.31 nick$ php56 -i |grep configure
Configure Command => './configure' '--prefix=/usr/local/php5631' '--with-gd' '--enable-mysqlnd' '--with-openssl-dir=/usr/local/Cellar/openssl/1.0.2l/' '--with-mcrypt' '--enable-mbstring' '--enable-zip' '--enable-fpm' '--with-mysqli=mysqlnd' '--with-pdo-mysql=mysqlnd' '--with-curl' '--enable-xml' '--with-iconv-dir' '--with-freetype-dir' '--with-jpeg-dir' '--with-png-dir' '--with-zlib' '--with-libxml-dir' '--enable-gd-native-ttf' '--enable-gd-jis-conv' '--enable-sockets' '--with-xmlrpc'
具体怎样编译还需要自己尝试一下,两年前编译的,有点忘记了