Let's say you installed PHP and run it for a month, but now you want the use of curl in PHP.
But so bad, you didn ' t install the This extension if you installed PHP. That's to say,
Now you want to add PHP extension.
Here is a example to install Curl extension.
Apache2 is In/usr/local/apache2
PHP is in/usr/lib/php5/
1. Install the CURL
Download The Curl source code from:http://curl.haxx.se/download, here is curl-7.17.1.tar.gz.
Then uncompress and install it.
TAR-ZXF curl-7.17.1.tar.gz
./configure--prefix=/usr/local/curl
sudo make
sudo make test
sudo make install
Here we install the Curl To/usr/local/curl
2. Install the Php5-curl
*note:you should has the PHP source code, otherwise the steps can ' t ' go on. Assume that the PHP source code
is in ~/downloads/php-5.2.10-src, and you should has installed the phpize.
CD ~/downloads/php-5.2.10-src/ext/curl/
Phpize
./configure--with-php-config=php-config--with-curl=/usr/local/curl
sudo make
sudo make test
sudo make install
Then you'll find curl.so in ~/downloads/php-5.2.10-src/ext/curl/modules. Copy it to the PHP extension folder, here is/usr/lib/php5/20060613+lfs/
sudo cp ~/downloads/php-5.2.10-src/ext/curl/modules/curl.so/usr/lib/php5/20060613+lfs/curl.so
3. Modify the php.ini file
Add the code to php.ini
Extension=curl.so
4. Restart the Apache
Sudo/etc/init.d/apache2 restart
Then the curl extension is installed.