一,在RedHat上源码安装
1, go to PHP source dir , find the curl ext dir , like this: php-5.6.8/ext/curl
2,run command
# /usr/local/php/bin/phpize
# ./configure –with-php-config=/usr/local/php/bin/php-config –with-curl=DIR
# make
# make install
3,you will see the curl.so path , then copy it to the php extentsion_dir , this can be finded in phpinfo() function;
4,edit php.ini , also can be finded in phpinfo() funtion , add like this: extension=curl.so
5,restart the nginx or apache , you will find that curl is OK in the phpinfo() function
二,在Ubuntu上使用apt-get安装
sudo apt-get install php5-curl
Leave a Reply