close

我相信包php5-curl应该做的伎俩。使用您选择的包裹经理,并且处理deps应该被照顾。

sudo apt-get install php5-curl

您将需要重新启动服务器:

sudo service apache2 restart

或者,如果您使用的是php-fpm,则需要重新启动php5-fpm

sudo service php5-fpm restart

 

次佳解决方案

我的conf:Ubuntu 11.10,已经安装了mysql,php5和apache2,在终端我安装php5-curl之前:

编辑源列表,如:

sudo -H gedit /etc/apt/sources.list

您可以在http://repogen.simplylinux.ch/中检查您的配置

下一个命令:

apt-get install aptitude

下一个命令:

aptitude install php5-curl

你会得到这样的东西:

The following NEW packages will be installed:
php5-curl{b} 
0 packages upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 27.1 kB of archives. After unpacking 127 kB will be used.
The following packages have unmet dependencies:
php5-curl: Depends: php5-common (= 5.3.6-13ubuntu3.1) but 5.3.6-13ubuntu3.8 is installed.
The following actions will resolve these dependencies:

Keep the following packages at their current version:
1)     php5-curl [Not Installed]                          

Accept this solution? [Y/n/q/?] n

你的答案是n

下一行打印出来:

The following actions will resolve these dependencies:

Downgrade the following packages:                                             
1)     libapache2-mod-php5 [5.3.6-13ubuntu3.8 (now) -> 5.3.6-13ubuntu3.1 (oneiric)]
2)     php5 [5.3.6-13ubuntu3.8 (now) -> 5.3.6-13ubuntu3.1 (oneiric)]               
3)     php5-cli [5.3.6-13ubuntu3.8 (now) -> 5.3.6-13ubuntu3.1 (oneiric)]           
4)     php5-common [5.3.6-13ubuntu3.8 (now) -> 5.3.6-13ubuntu3.1 (oneiric)]        
5)     php5-gd [5.3.6-13ubuntu3.8 (now) -> 5.3.6-13ubuntu3.1 (oneiric)]            
6)     php5-mysql [5.3.6-13ubuntu3.8 (now) -> 5.3.6-13ubuntu3.1 (oneiric)]         

Accept this solution? [Y/n/q/?] y

你的答案是y。

在浏览器open phpinfo()中,检查属性:

extension_dir   /usr/lib/php5/20090626+lfs

在该文件夹中,您现在应该有curl.so

编辑php.ini

nano /etc/php5/apache2/php.ini

找”dynamic extensions”添加代码如下:

extension=curl.so

在重新启动apache2和check phpinfo()之后,必须启用curl

 

第三种解决方案

您需要安装php5-curl包。

sudo apt-get install php5-curl

 

第四种方案

完整的解决方案安装LAMP和cURL扩展:

sudo apt-get update
sudo apt-get install php5

sudo apt-get install libapache2-mod-php5

sudo apt-get install curl libcurl3 libcurl3-dev php5-curl

接着:

cd /etc/php5/apache2/

sudo nano php.ini

添加以下命令:extension=curl.so

最后一件事restart apache

arrow
arrow
    全站熱搜

    忽倫 發表在 痞客邦 留言(0) 人氣()