如何使Xdebug适用于php 7.3和apache(MACOS)

Dee*_*Dee 5 php apache xdebug

我正在尝试让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
Run Code Online (Sandbox Code Playgroud)

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

httpd.conf中的php config是

LoadModule php7_module libexec/apache2/libphp7.so
Run Code Online (Sandbox Code Playgroud)

phpize提供以下内容。

/usr/local/bin/phpize -v
        Configuring for:
        PHP Api Version:         20180731
        Zend Module Api No:      20180731
        Zend Extension Api No:   320180731
Run Code Online (Sandbox Code Playgroud)

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

zend_extension=/usr/lib/php/extensions/no-debug-non-zts-20160303/xdebug.so
Run Code Online (Sandbox Code Playgroud)

在这里存在:

/usr/lib/php/extensions/no-debug-non-zts-20160303 ? ls
opcache.a  opcache.so xdebug.so
Run Code Online (Sandbox Code Playgroud)

我的问题

  • 我如何让Apache使用php 7.3?

  • 这样可以解决我的Xdebug问题吗?

Ayo*_*che 1

xdebug站点目前只有;64-bit的版本 PECLPHP 7.3站点有XAMPP所需的版本。32-bit

一旦投入生产,这个问题就会得到纠正xdebug 2.7,但与此同时,PECL 站点正在解决这个问题。