Solve the Problem of PHP compiling cURL reinstall the libcurl
Today, we need to use the PHP curl function. We found that the PHP on the server has not configured curl, and then query the official PHP documentation. We learned that the-with-curl parameter is required when compiling PHP, to compile the curl module. Now that PHP has been compiled and installed on the server, I don't want to re-compile it. So I will refer to some comments below to compile the curl module separately and then make install.
First, download the official PHP source code and locate the curl under the extension directory. The extension directory of the old version of PHP may be extensions, and the new version should be ext.
Cd/tmp
Wget http://cn.php.net/get/php-5.3.10.tar.bz2/from/cn2.php.net/mirror
Mv mirror php-5.3.10.tar.bz2
Tar vxf php-5.3.10.tar.bz2
Cd php-5.3.10/ext/curl
Phpize
./Configure
Make install
After the above steps are completed, add extension = curl. so to php. ini, but the following error message is displayed in./configure:
Configure: error: Please reinstall the libcurl distribution-
Easy. h shoshould be in/include/curl/
Basically, determine what package is missing and search for the dependent package that needs to be installed in advance.
# RetHat CentOS or Fedora use the following installation command
Yum install curl-devel
# Debian or Ubuntu use the following installation command
Apt-get install curl
Apt-get install libcurl4-gnutls-dev
However, I found a more convenient method during the search process. In the Debian environment, because my PHP is obtained through apt-get, the same curl can also be obtained through the apt-get command:
Apt-get install curl
Apt-get install php5-curl
Ha ha, it seems that this is much easier to do, so it is installed in this way, the previous method will not consider that, simple, it is best :-)
Finally don't forget to restart php cgi with invoke-rc.d PHP-CGI restart.