Install PHP curl extension in centos5

Source: Internet
Author: User
Tags zts

Method 1: this can only be used when PHP is newly installed.

# Wget http://curl.haxx.se/download/curl-7.17.1.tar.gz

# Tar-zxf curl-7.17.1.tar.gz

#./Configure -- prefix =/usr/local/curl

# Make & make install

Install PHP

Just enable the switch -- With-curl =/usr/local/curl

You can.

This extended library is a great alternative to fsockopen and so on.

Method 2: add extensions for installed PHP.

Go to the source code directory for installing the original PHP and run the following command:

# Cd/home/admin/php-5.3.6

# Cd ext

# Cd curl

#/Usr/local/PHP/bin/phpize

#./Configure -- With-PHP-Config =/usr/local/PHP/bin/PHP-config -- With-curl = dir

If the error configure: Error: Please reinstall the libcurl distribution is reported

Run Yum-y install curl-devel

# Make
# Make install

Then

Installing shared extensions:/usr/local/PHP // lib/PHP/extensions/no-debug-non-zts-20090626/


/Usr/local/PHP // lib/PHP/extensions/no-debug-non-zts-20090626/will appear curl. So


Modify PHP. ini and add

Extension = curl. So

You can use the following method to verify whether the installation is successful:
#
/Usr/local/PHP/bin/PHP-m

If a curl entry is displayed, the operation is successful.

Restart PHP
PS auwx | grep PHP-FPM | awk-F "'{print $2}' | sudo xargs kill-9

/Usr/local/PHP/sbin/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.