1.安装curl

cd /usr/local
wget http://curl.haxx.se/download/curl-7.44.0.tar.gz
tar zxf curl-7.44.0.tar.gz
cp curl-7.44.0  curl
cd curl
./configure
make
make install

2.安装PHP curl拓展

cd  /(php源码目录,不是php编译目录)/ext/curl
运行phpize: /(php编译目录)/bin/phpize
./configure --with-php-config=/(php编译目录)/bin/php-config  --with-curl=/(curl源码目录)
以我的为例为:./configure --with-php-config=/usr/local/php/bin/php-config --with-curl=/usr/local/curl
make && make install
修改php.ini,增加:extension=curl.so(如果没有安装过其他php扩展,则需要同时配置extension_dir="/(php编译后目录)/lib/php/extensions/no-debug-non-zts-20121212/",上一个步骤生成.so文件的时候,会输出extension_dir目录)