douzhuo2002 2018-03-10 22:14
浏览 205

如何在Ubuntu 14.04上启用php5 curl?

I have installed curl on Ubuntu 14.04 running PHP 5.6 with the following commands:

sudo apt-get install php5-curl
sudo service apache2 restart

It returns a successful message, but when I run:

php -m

the curl module is not listed, and phpinfo(); does not recognize it as installed or active. I also tried adding:

extension=curl.so

to my php.ini file, but that had no effect. How do I get PHP to recognize that curl is installed?

  • 写回答

2条回答 默认 最新

  • douxiang3978 2018-03-11 03:11
    关注

    I got it working based on the second answer listed here: https://askubuntu.com/questions/9293/how-do-i-install-curl-in-php5

    Basically:

    sudo apt-get install software-properties-common
    sudo add-apt-repository ppa:ondrej/php
    sudo apt-get update
    sudo apt-get upgrade
    sudo apt-get install php5.6-curl
    sudo service apache2 restart
    

    I'm not really sure what made the difference. The repository reference is the most significant difference from previous attempts, but it seems odd as prior installation attempts didn't appear to have any problem accessing or installing/updating php-curl. And I had made sure everything was updated several times. But whatever it was, the above resolved it.

    评论

报告相同问题?

悬赏问题

  • ¥15 关于#python#的问题:求帮写python代码
  • ¥20 MATLAB画图图形出现上下震荡的线条
  • ¥15 LiBeAs的带隙等于0.997eV,计算阴离子的N和P
  • ¥15 关于#windows#的问题:怎么用WIN 11系统的电脑 克隆WIN NT3.51-4.0系统的硬盘
  • ¥15 来真人,不要ai!matlab有关常微分方程的问题求解决,
  • ¥15 perl MISA分析p3_in脚本出错
  • ¥15 k8s部署jupyterlab,jupyterlab保存不了文件
  • ¥15 ubuntu虚拟机打包apk错误
  • ¥199 rust编程架构设计的方案 有偿
  • ¥15 回答4f系统的像差计算