When using curl to access the HTTPS site in a PHP program, error:
Protocol HTTPS not supported or disabled in Libcurl
This error message indicates that PHP used at the time of compiling the Curl library does not support HTTPS, the authentication method is
Your Curl installation directory/bin/curl-v
Shown below:
Protocols:dict file FTP Gopher HTTP IMAP POP3 RTSP SMTP Telnet tftp
This means that curl is not supported for HTTPS
In order to support HTTPS, you need to download the source package, recompile curl
Tar zxvf curl-7.24.0.tar.gz
CD curl-7.24.0
./configure--prefix=/usr/local/services/curl-7.24.0--with-ssl=/usr/local/services/openssl-0.9.8a
#请注意, be sure to use the--with-ssl parameter here, as long as you have installed the OPENSSL-0.9.8A (recommended to install 0.9.8a tested 0.9.7i some bugs)
After the execution of the step is finished, be sure to observe carefully, whether there is this line
SSL support:enabled (OpenSSL)
If you are
SSL Support:no
That means that your curl still doesn't support HTTPS.
Make && make install
At make, you may encounter errors like this:
' A local symbol ' can is used when making a shared object; Recompile with-fpic
Libssl.a:could not read Symbols:bad value
Workaround, please refer to http://mylinux.5d6d.net/viewthread.php?tid=1013
After the installation is complete, run again
Curl installation directory/bin/curl-v
Result is
Protocols:dict File FTP Gopher HTTP HTTPS IMAP POP3 RTSP SMTP Telnet tftp
This indicates that HTTPS has been supported
The rest is to recompile PHP, of course, the corresponding support curl parameters for--with-curl= your Curl installation directory