PHP does not support HTTPS solution for Curl

Source: Internet
Author: User
Tags imap gopher

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.