Install the curl extension of php in Linux and support https requests.

Source: Internet
Author: User
Tags install openssl
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!

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.