sh# wget http://curl.haxx.se/download/curl-7.18.2.tar.gz
sh# tar -zxvf curl-7*.gz
sh# cd curl*
sh# ./configure --prefix=/usr/local/curl
sh# make
sh# make install
sh# cd /usr/local/src/php-5.2.1 (这是源码安装php时的源码目录)
sh# cd ./ext/curl
sh# phpize
sh# ./configure --with-curl=/usr/local/curl
sh# make
sh# cp modules/curl.so /usr/local/lib/php/extensions (复制modules/curl.so到php的扩展目录下)
(修改php.ini文件,加入: extension=curl.so)
sh# apachectl -k restart (重启apache,应该php就有curl扩展了)
 
php.ini修改方法,根据你的实际curl.so文件位置来写,比较我编译后的位置:
/usr/local/php/lib/php/extensions/no-debug-zts-20060613/
那么php.ini就加上
extension="/usr/local/php/lib/php/extensions/no-debug-zts-20060613/curl.so"