调用未定义的函数curl_init()即使它在php7中启用 [英] Call to undefined function curl_init() even it is enabled in php7

查看:337
本文介绍了调用未定义的函数curl_init()即使它在php7中启用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚安装php7到我的Ubuntu。
首先,没有问题,我的网站工作。
但是突然,它开始返回调用未定义的函数curl_init()错误。
现在,我的页面包含curl代码不工作。

I've just installed php7 to my Ubuntu. At first, there was no problem, my web site was working. But suddenly, it started to return Call to undefined function curl_init() error. Now, my pages contain curl codes do not work.

在phpinfo()中,它看起来已启用Curl。
有类似的问题,但没有一个处理它在php7。
我认为它应该是与别人不同的东西。

In phpinfo(), it looks Curl is enabled. There were similar questions but none of them handled it in php7. I thought it should be something different than others.

编辑:
当我尝试

When I try

php -i | grep curl       

,它返回

/etc/php/7.0/cli/conf.d/20-curl.ini,
curl


推荐答案

我在升级到XX(16.04)后遇到类似的问题。
重新安装curl后:

I've had similar problem with curl after upgrade to XX (16.04). After reinstalling curl with:

sudo apt-get install php-curl

且服务器重新启动

sudo service apache2 restart

一切都恢复正常:)

这篇关于调用未定义的函数curl_init()即使它在php7中启用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆