调用未定义的函数curl_version

Max*_*x08 5 php wordpress

嗨我已经在运行php 5.6的ubuntu 14.04上安装了wordpress 4.6站点.

管理页面不可见,我可以在日志中看到以下错误: -

致命错误:在第274行的/var/www/html/files/modules/postie/postie.php中调用未定义的函数curl_version()

我该如何解决?

我已经验证我们的服务器上安装了curl和php5-curl: -

ubuntu@ip-172-39-6-147:/var/www/html$ sudo apt-get install curl
Reading package lists... Done
Building dependency tree       
Reading state information... Done
curl is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 137 not upgraded.
ubuntu@ip-172-39-6-147:/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.
0 upgraded, 0 newly installed, 0 to remove and 137 not upgraded.
Run Code Online (Sandbox Code Playgroud)

yoe*_*nes 6

在当前版本的Debian和Ubuntu上,您可以通过安装PHP的Curl扩展并重新启动Web服务器来解决这个问题.假设网络服务器是Apache 2:

sudo apt-get install php5-curl

sudo service apache2 restart

您可能需要安装更多:

sudo apt-get install curl libcurl3 libcurl3-dev;

  • 它应该是`sudo apt-get install php-curl`(将为您选择合适的版本,不限于PHP 5) (4认同)
  • 或者选择自己 - 取决于您在 Web 服务器上运行的 PHP 模块。例如 Apache:如果模块是 `sudo a2enmod phpX.X` 然后使用相同的 PHP curl:`sudo apt install phpX.X-curl` 其中 XX 是Apache 正在使用的 PHP 版本/模块。(他们需要匹配。) (2认同)

Max*_*x08 0

我最终能够解决这个问题。

我的 ubuntu 机器上安装了三个 php - php5、php5.6 和 php7。php5 中安装了curl,但被apache 忽略。apache 使用的是 php5.6。我转到 /etc/apache2/mods-enabled 并删除了除 php5 之外的所有 php 链接。