当前位置:首页 > 操作系统 > MacOs

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

我正在尝试让Xdebug(我在pecl上安装了2.7)可以在php上工作,但是却收到以下错误.

<code>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
</code>

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

httpd.conf中的php config是

<code>LoadModule php7_module libexec/apache2/libphp7.so
</code>

phpize提供以下内容.

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

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

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

在这里存在:

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

我的问题

>如何让Apache使用php 7.3?
>这样可以解决我的Xdebug问题吗?

解决方法:

经过大量研究之后,我发现了以下工具.

https://xdebug.org/wizard.php

我按照说明进行了操作,并对路径进行了一些小的更改,Xdebug现在可以正常工作了.


【说明】本文章由站长整理发布,文章内容不代表本站观点,如文中有侵权行为,请与本站客服联系(QQ:254677821)!

相关教程推荐

其他课程推荐