一旦工作,那就要努力的干,聪明的干,快速的干——用省下来的时间干自己喜欢干的事情。!

mac os 编译安装php时遇到configure: error: Cannot find OpenSSL’s

linux lampnick 16060℃ 0评论

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

喜欢 (26)or分享 (0)
头像
发表我的评论
取消评论
表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
(3)个小伙伴在吐槽
  1. 头像
    是 --with-openssl 不是 --with-openssl-dir 带有dir的选项是指向 ftp 获取 smb 服务器时使用的
    NelsonKing2019-04-28 16:46 回复
    • 头像
      看了下./configure --help,的确和你说的一样
      lampnick2019-05-05 15:57 回复
    • 头像
      Nick-Mac:php-5.6.31 nick$ ./configure --help|grep openssl
      --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'
      具体怎样编译还需要自己尝试一下,两年前编译的,有点忘记了
      lampnick2019-05-05 16:10 回复