ubuntu下apache+php,没有安装curl,打开页面出现错误:
Fatal error: Uncaught exception 'Exception' with message 'Facebook needs the CURL PHP extension.' in /www/code2010/fundbreak.com.au/beta/facebook.php:4
首先,测试服务器是否已经安装开启了curl,使用phpinfo命令,在输出中可以观察curl的属性,如果没有关于curl的内容,也就是没有安装。
curl的安装过程,使用apt-get安装很简单:
apt-get install libcurl4-openssl-dev
apt-get install libcurl3
apt-get install curl php5-curl
注意查看安装的提示信息,根据信息也许还需要调整安装package的命令。
最后,重启你的apache服务器:
/etc/init.d/apache2 restart
ps:如果curl还是没有启动,可以在php.ini后面加上extension=curl.so,再试试
ubuntu apache php curl