【发布时间】: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 问题吗?
【问题讨论】: