【问题标题】:How to getting Xdebug working for php 7.3 and apache (MACOS)如何让 Xdebug 为 php 7.3 和 apache (MACOS) 工作
【发布时间】:2019-08-21 13:07:28
【问题描述】:

我正在尝试让 Xdebug(我使用 pecl 安装 2.7)为 php 工作,但出现以下错误。

php -v
Xdebug requires Zend Engine API version 320160303.
The Zend Engine API version 320180731 which is installed, is newer.
Contact Derick Rethans at http://xdebug.org/docs/faq#api for a later version of Xdebug. 

PHP 7.3.3 (cli) (built: Mar  8 2019 16:40:07) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.3, Copyright (c) 1998-2018 Zend Technologies
    with Zend OPcache v7.3.3, Copyright (c) 1999-2018, by Zend Technologies

我已经使用 Homebrew 安装了最新版本的 PHP 7.3,但 Apache 使用的是 PHP 版本 7.1.23。我认为我遇到了问题,因为我使用了错误的 Zend API 版本。

httpd.conf中的php配置是

LoadModule php7_module libexec/apache2/libphp7.so

phpize 给出以下内容。

/usr/local/bin/phpize -v
        Configuring for:
        PHP Api Version:         20180731
        Zend Module Api No:      20180731
        Zend Extension Api No:   320180731

我在 php.ini 中添加了以下内容

zend_extension=/usr/lib/php/extensions/no-debug-non-zts-20160303/xdebug.so

这里有:

/usr/lib/php/extensions/no-debug-non-zts-20160303  ls
opcache.a  opcache.so xdebug.so

我的问题

  • 如何让 apache 使用 php 7.3?

  • 这会解决我的 Xdebug 问题吗?

【问题讨论】:

    标签: php apache xdebug


    【解决方案1】:

    经过大量研究,我找到了以下工具。

    https://xdebug.org/wizard.php

    我按照说明对路径进行了一些小改动,现在 Xdebug 正在运行。

    【讨论】:

      【解决方案2】:

      xdebug 站点目前只有64-bit 版本的PHP 7.3PECL 站点具有 XAMPP 所需的 32-bit 版本。

      这将在 xdebug 2.7 投入生产后得到纠正,但与此同时 PECL site 是解决办法。

      【讨论】:

        【解决方案3】:

        你可以使用,https://xdebug.org/wizard.php

        对于 Windows,

        • 打开终端输入php -i
        • 复制结果并将其粘贴到文本区域。
        • 它会说要下载一个 dll 文件,下载它。
        • 将下载的文件重命名为 php_xdebug.dll 并复制到 {php-intallation-path}/ext
        • 打开php.ini文件,

        -> 取消注释这些,(删除前导 ; 仅适用于 extension_dir em>),

        ; On windows:
        ; extension_dir = "ext"
        

        ->添加以下行,

        zend_extension = xdebug
        

        重新运行 xdebug 向导进行确认,

        Xdebug installed: 3.1.1
        

        【讨论】:

          猜你喜欢
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 2022-01-09
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 2015-01-06
          相关资源
          最近更新 更多