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