Install php curl extension in Linux and support https requests. recompile the environment: php5.5.5 + nginx
Task: install php curl extension and support https
The trap of blood and tears: I first installed curl and found that https is not supported, and then installed openssl. However, everything is too late. after a long time, I had to reinstall it.
Method:
First install openssl, directly
SHELL
yum -install opensslyum -install openssl-devel
Then reinstall curl. after the installation is complete, remember that the curl-V command does not support https.
SHELL
Wget http://curl.haxx.se/download/curl-7.24.0.tar.gztar-xzf curl-7.24.0.tar.gz cd curl-7.24.0./configure -- prefix = (installation path) -- with-ssl = (ssl installation path) makemake install
Then export the current php compilation parameters.
SHELL
/usr/local/php/bin/php -i | grep configure
Go to the php installation file directory and download another
SHELL
/Usr/local/php/bin/phpize. /configure -- with-curl = (installation path) -- with-openssl = (installation path) // add the two makemake install parameters you just exported
If no error is reported, restart nginx and php-fpm!