php5-curl没有安装在Ubuntu 14.04上

时间:2016-08-10 12:37:47

标签: php apache ubuntu-14.04 google-compute-engine php-extension

我执行了下面的

sudo apt-get install php5-curl

结果是

root@digin-demo-app:/var/www/html# sudo apt-get install php5-curl
Reading package lists... Done
Building dependency tree
Reading state information... Done
php5-curl is already the newest version.
The following packages were automatically installed and are no longer required:
  libgcrypt11-dev libgnutls-dev libgnutlsxx27 libgpg-error-dev libp11-kit-dev
  librtmp-dev libtasn1-6-dev
Use 'apt-get autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 7 not upgraded.
root@digin-demo-app:/var/www/html#

但是当我尝试使用php -m命令时,它只会显示在modules下面。请在此帮助我

root@digin-demo-app:/var/www/html# php -m
[PHP Modules]
calendar
Core
ctype
date
ereg
exif
fileinfo
filter
ftp
gettext
hash
iconv
json
libxml
mhash
openssl
pcntl
pcre
PDO
Phar
posix
readline
Reflection
session
shmop
sockets
SPL
standard
sysvmsg
sysvsem
sysvshm
tokenizer
Zend OPcache
zlib

[Zend Modules]
Zend OPcache

3 个答案:

答案 0 :(得分:3)

我不知道您是否找到了解决问题的方法,但无论如何,它可能对其他人有所帮助。 我处于相同的情况,并希望为php5.6安装curl我使用与你相同的命令,但直到我在某些论坛上找到它才能工作

sudo apt-get install php5.6-curl php5.6-gd php5.6-mbstring php5.6-mcrypt php5.6-xml php5.6-xmlrpc

答案 1 :(得分:0)

尝试安装所需的依赖

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

重新启动apache后

sudo service apache2 restart
or
sudo service httpd restart

答案 2 :(得分:0)

确保已启用扩展程序。

cd /etc/php5/apache2/

sudo nano php.ini

添加此命令:extension=curl.so

然后再次重启apache