How to compile PHP with new OpenSSL library

≡放荡痞女 提交于 2019-12-20 03:17:41

问题


I am trying to compile PHP with OpenSSL. That works with the default OpenSSL library 0.9.6 by simply configuring with --with-openssl=/usr.

However, I have installed a new OpenSSL library 1.0.0 which I would like to compile PHP with. This library lives in /usr/local/ssl/bin.

That unfortunately does not work:

configure: error: Cannot find OpenSSL's <evp.h>

How can I compile PHP with the new OpenSSL library?


回答1:


fixed it by recompiling curl as the compiled version of curl was also using the old openssl lib

sudo ./configure -disable-shared -with-ssl=/usr/local/ssl

After compiling curl, also compiled php again --with-openssl=/usr and phpinfo tells me it is using the new openssl lib.




回答2:


For those using MacPorts adding ssl is super simple:

$ sudo port install php71-openssl

That's it. Ports will recompile php (version 7.1 in this case) with openssl for you.




回答3:


I had the same problem, but before compiling (./configure -disable-shared -with-ssl=/usr/local/ssl) I removed (yum openssl-devel) and it worked



来源:https://stackoverflow.com/questions/31212447/how-to-compile-php-with-new-openssl-library

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!