php 7 在 ubuntu 14.04 上的 xdebug

xdebug for php 7 on ubuntu 14.04

我正在尝试让 xdebug 在 PHP 7 上运行。我正在从版本 http://xdebug.org/files/xdebug-2.4.0rc4.tgz 构建 xdebug.so 文件。 phpize 输出看起来正确 (Zend Extension Api No: 320151012) 但是我从 PHP.

得到 Xdebug requires Zend Engine API version 220121212.

所以我遵循了这些说明:

Tailored Installation Instructions

Summary

Xdebug installed: no Server API: Apache 2.0 Handler Windows: no Zend Server: no PHP Version: 7.0.9-1 Zend API nr: 320151012 PHP API nr: 20151012 Debug Build: no Thread Safe Build: no Configuration File Path: /etc/php/7.0/apache2 Configuration File: /etc/php/7.0/apache2/php.ini Extensions directory: /usr/lib/php/20151012 Instructions

Download xdebug-2.4.1.tgz Unpack the downloaded file with tar -xvzf xdebug-2.4.1.tgz Run: cd xdebug-2.4.1 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: 20151012 Zend Extension Api No: 320151012 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/20151012 Edit /etc/php/7.0/apache2/php.ini and add the line zend_extension = /usr/lib/php/20151012/xdebug.so Restart the webserver

除了我安装了 php7.0-dev 而不是 php5 apt-get install -y php7.0-dev.

当我 运行 phpize 命令时,我得到以下输出:

Configuring for:

PHP Api Version: 20151012

Zend Module Api No: 20151012

Zend Extension Api No: 320151012

不出所料。但是当我 运行 PHP 我得到:

Xdebug requires Zend Engine API version 220121212.

The Zend Engine API version 320151012 which is installed, is newer.

Contact Derick Rethans at http://xdebug.org/docs/faq#api for a later version of Xdebug.

我显然哪里做错了!非常感谢任何有关调试问题的帮助! :)

所以我使用 apt-get 包解决了这个问题: apt-get install -y php-xdebug

这似乎安装了正确的 xdebug.so 文件,一切正常!