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

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

问题描述

我刚刚在我的 Ubuntu 上安装了 php7.起初,没有问题,我的网站正在运行.但是突然,它开始返回 Call to undefined function 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.

当我尝试

php -i | grep curl       

在终端,它返回

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

推荐答案

我在升级到 XX (16.04) 后遇到了类似的 curl 问题.重新安装 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天全站免登陆