我已經執行了下面的
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 命令時,它只顯示在模組下方。
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
答案1
使用下列命令啟用 PHP 模組:
sudo php5enmod curl
並重新啟動你的阿帕契:
sudo service apache2 restart