Linux php extension curl installation, [reference] http://blog.csdn.net/qingflyer/article/details/6546071
Method 1
Install cURL
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
Go to the source code directory for installing the original php,
Cd ext
Cd curl
Phpize
./Configure -- with-curl = DIR
Make & make install
The curl. so file is generated under PHPDIR/ext/curl/moudles.
Copy the curl. so file to the extensions configuration directory and modify php. ini.
Extension = curl. so
The first method tried N times and failed, so it gave up.
Use the second method for installation,
The phpize prompt cannot be found. In fact, the command is under/usr/local/php/bin/target:
#/Usr/local/php/bin/phpize
./Configure -- with-curl = DIR you must specify the php configuration path as follows:
#./Configure -- with-php-config =/usr/local/php/bin/php-config -- with-curl = DIR
Note: In the above information, the -- with-php-config is written as -- with-php-config.
Then compile and install:
# Make
# Make install
Here will prompt the path to generate the file curl. so:/usr/local/php/lib/php/extensions/no-debug-non-zts-20060613/
Go to this path and copy the curl to the extension_dir Directory (you can view phpinfo in this directory, but you can view php.int directly ),
Modify php. ini
Extension = curl. so
#/Usr/local/php/bin/php-m
If a curl entry is displayed, the operation is successful.
Restart apache
#/Usr/local/apache2/bin/apachectl stop
#/Usr/local/apache2/bin/apachectl start
Now, the CURL item is displayed in phpinfo.