The following is an example of installing curl, which describes the specific installation steps.
1. Install Crul wget http://curl.haxx.se/download/curl-7.19.6.tar.gz tar-zxvf curl-7.19.6.tar.gz cd curl-7.19.6./configure- -prefix=/usr/local/curl
Make
Make install
2. Build extension into the PHP source directory in the Ext directory, where the source code for each extension module, select the module you need, such as the Curl module:
CD Curl
Execute phpize to generate the compiled file, phpize in the bin directory of the PHP installation directory
/usr/local/php5/bin/phpize
At run time, you may get an error: Cannot find autoconf. Please check your autoconf installation and the $PHP _autoconf environment variable are set correctly and then rerun this SC Ript. ", you need to install autoconf:
Yum Install autoconf (redhat or CentOS), Apt-get install autoconf (Ubuntu Linux)
Build the configuration file and compile the build module:
/usr/local/php5/bin/phpize
./configure--with-curl=/usr/local/curl--with-php-config=/usr/local/php5/bin/php-config
Make
Make install
In this way, the curl.so is copied to the PHP corresponding directory (e.g./usr/local/php5/lib/php/extensions/no-debug-non-zts-20090626/)
3. Modify the configuration in php.ini, set the extension directory:
Extension_dir = "/usr/local/php5/lib/php/extensions/no-debug-non-zts-20090626/"
and add Extension reference:
Extension = curl.so
4. Check and restart Apache
/usr/local/php/bin/php-v
When executing this command, PHP will check the configuration file is correct, if there is a configuration error, here will be error, can be based on the wrong information to troubleshoot
After you have installed PHP, add the extension module (do not re-edit PHP)