AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / ubuntu / 问题

问题[xdebug](ubuntu)

Martin Hope
sleeper
Asked: 2018-08-06 11:40:25 +0800 CST

升级后 Apache phpinfo 缺少 cURL 和 XDebug

  • 1

我刚刚升级到 Ubuntu 18.04.1 LTS 并通过将 phpinfo() 添加到索引文件来检查我的本地 apache2 安装。

更新/重启后,我去了我当地的 WordPress 管理区域并尝试更新插件并收到以下错误:

Fatal error: Uncaught Error: Call to undefined function curl_init()

这是我所做的:

  1. 我检查了 phpinfo() 并且没有显示 curl 或 xdebug 选项。
  2. 我去了 /etc/php/7.1/apache2/php.ini 并取消了以下行 extension=php_curl.dll 的注释。
  3. 然后我重新启动了apache。
  4. 此外,我的 phpinfo() 显示加载的配置文件 /etc/php/7.1/apache2/php.ini ,这是我一直在编辑的。

但是,WordPress 仍然报告以下内容:PHP 致命错误:调用未定义的函数 curl_init()。

我在想我一定是在编辑错误的 ini 文件。

有任何想法吗?我死在这水里了。?

php curl xdebug
  • 1 个回答
  • 1570 Views
Martin Hope
IgorAlves
Asked: 2018-06-13 10:26:17 +0800 CST

ubuntu16.04.1 xdebug 上的 PHP 版本 7.1.18-1 不工作。如何启用它?

  • 0

我通过以下命令在 ubuntu 16.04 中安装了 php 7.1:

sudo apt-get install -y software-properties-common
sudo add-apt-repository -y ppa:ondrej/php
sudo apt-get update
sudo apt-get install -y php7.1-fpm   

在这一步之后,我只是按照以下说明进行操作Xdebug Tailored Installation Instructions:

Summary
Xdebug installed: no
Server API: FPM/FastCGI
Windows: no
Zend Server: no
PHP Version: 7.1.18-1
Zend API nr: 320160303
PHP API nr: 20160303
Debug Build: no
Thread Safe Build: no
Configuration File Path: /etc/php/7.1/fpm
Configuration File: /etc/php/7.1/fpm/php.ini
Extensions directory: /usr/lib/php/20160303
Instructions
Download xdebug-2.6.0.tgz
Unpack the downloaded file with tar -xvzf xdebug-2.6.0.tgz
Run: cd xdebug-2.6.0
Run: phpize (See the FAQ if you don't have phpize.

As part of its output it should show:

Configuring for:
...
Zend Module Api No:      20160303
Zend Extension Api No:   320160303
If it does not, you are using the wrong phpize. Please follow this FAQ entry and skip the next step.

Run: ./configure
Run: make
Run: cp modules/xdebug.so /usr/lib/php/20160303
Edit /etc/php/7.1/fpm/php.ini and add the line
zend_extension = /usr/lib/php/20160303/xdebug.so
Restart the webserver

重新启动网络服务器(NGINX)后,我在 phpinfo() 显示中看不到 xdebug 扩展:

在此处输入图像描述

这是我的 php.ini:/etc/php/7.1/fpm/php.ini

[xdebug]
zend_extension = /usr/lib/php/20160303/xdebug.so

甚至本文中建议的xdebug 2.5.5也不起作用,甚至Xdebug 2.7.0alpha1也不起作用

php -v
PHP 7.1.18-1+ubuntu16.04.1+deb.sury.org+1 (cli) (built: Jun 11 2018 14:22:30) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.1.0, Copyright (c) 1998-2018 Zend Technologies
    with Zend OPcache v7.1.18-1+ubuntu16.04.1+deb.sury.org+1, Copyright (c) 1999-2018, by Zend Technologies

有人知道如何解决这个问题吗?

16.04 php7 xdebug
  • 1 个回答
  • 1410 Views

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    如何运行 .sh 脚本?

    • 16 个回答
  • Marko Smith

    如何安装 .tar.gz(或 .tar.bz2)文件?

    • 14 个回答
  • Marko Smith

    如何列出所有已安装的软件包

    • 24 个回答
  • Marko Smith

    无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗?

    • 25 个回答
  • Martin Hope
    Flimm 如何在没有 sudo 的情况下使用 docker? 2014-06-07 00:17:43 +0800 CST
  • Martin Hope
    Ivan 如何列出所有已安装的软件包 2010-12-17 18:08:49 +0800 CST
  • Martin Hope
    La Ode Adam Saputra 无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗? 2010-11-30 18:12:48 +0800 CST
  • Martin Hope
    David Barry 如何从命令行确定目录(文件夹)的总大小? 2010-08-06 10:20:23 +0800 CST
  • Martin Hope
    jfoucher “以下软件包已被保留:”为什么以及如何解决? 2010-08-01 13:59:22 +0800 CST
  • Martin Hope
    David Ashford 如何删除 PPA? 2010-07-30 01:09:42 +0800 CST

热门标签

10.10 10.04 gnome networking server command-line package-management software-recommendation sound xorg

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve