运行 xdebug 向导但仍然有 php 版本混乱

Ran the xdebug wizard but still have php version confusion

当我运行php -v我得到

PHP 5.6.32-1+ubuntu16.04.1+deb.sury.org+1 (cli)

然后我转到 xdebug wizard,粘贴 php -i 的输出,按照步骤

当我 运行 phpize 我得到

Cannot find build files at '/usr/local/lib/php/build'. Please check your PHP installation

所以我做了 phpize5.6 并得到了

PHP Api Version: 20131106

Zend Module Api No: 20131226

Zend Extension Api No: 220131226

与向导匹配。现在当我 运行 ./configure 时,我得到

checking Check for supported PHP versions... configure: error: not supported. Need a PHP version >= 5.5.0 and < 7.2.0 (found 5.3.10)

但是,如果我 运行 它喜欢 ./configure --with-php-config=php-config5.6 我可以得到精灵的终结。它说

Run: cp modules/xdebug.so /usr/lib/php/20131226

Edit /etc/php/5.6/cli/php.ini and add the line zend_extension = /usr/lib/php/20131226/xdebug.so

但现在我得到

Failed loading /usr/lib/php/20131226/xdebug.so: /usr/lib/php/20131226/xdebug.so: undefined symbol: zend_pass_function

看来 php 安装有问题。好像用的是5.3,但是php -i显示的是5.6。您对为什么会这样以及我如何最好地解决它有什么想法吗?

好的,所以我首先在 /usr 中搜索 5.3.10

解决了这个问题

这让我看到我之前使用过 phpbrew,尽管我使用的是 php 的系统安装版本而不是 phpbrew 版本。

切换到 phpbrew 版本 5.6(而不是系统 5.6)解决了该错误。

将来我可以删除 phpbrew 并按照建议 .

返回常规 php