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.

    评论

报告相同问题?

悬赏问题

  • ¥100 set_link_state
  • ¥15 虚幻5 UE美术毛发渲染
  • ¥15 CVRP 图论 物流运输优化
  • ¥15 Tableau online 嵌入ppt失败
  • ¥100 支付宝网页转账系统不识别账号
  • ¥15 基于单片机的靶位控制系统
  • ¥15 真我手机蓝牙传输进度消息被关闭了,怎么打开?(关键词-消息通知)
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度