php - xDebug 在 Mac 上的安装问题
问题描述
我正在遵循https://xdebug.org/docs/install指南
当我sudo make test
在我的 MAC 2 中运行 PHP 版本时,根据项目需要安装了 PHP5 和 PHP7。
PHP : /usr/local/php5/bin/php
PHP_SAPI : cli
PHP_VERSION : 7.2.7
它给出了以下错误
=====================================================================
EXPECTED FAILED TEST SUMMARY
---------------------------------------------------------------------
Test for bug #1530: Code coverage incorrect for last code line in a loop [tests/bug01530.phpt] XFAIL REASON: PHP bug #76046: PHP generates "FE_FREE" opcode on the wrong line.
=====================================================================
You may have found a problem in PHP.
This report can be automatically sent to the PHP QA team at
http://qa.php.net/reports and http://news.php.net/php.qa.reports
This gives us a better understanding of PHP's behavior.
If you don't want to send the report immediately you can choose
option "s" to save it. You can then email it to qa-reports@lists.php.net later.
Do you want to send this report now? [Yns]:
我尝试了 2-3 次,但出现了同样的问题。
解决方案
测试失败的原因很明显:
XFAIL 原因:PHP 错误#76046:PHP 在错误的行上生成“FE_FREE”操作码。
您需要修补zend_compile.c
PHP 源代码(或等待固定版本)。不修补zend_compile.c
测试覆盖结果可能不准确 - 但是,常见的调试应该可以工作。make test
不会检查它,什么时候xdebug
不会部分依赖它(测试的标题甚至明确说明了它检查错误的原因)。这是diff,它增加了CG(zend_lineno) = ast->lineno;
. 这“解决了 100% 的问题”,而不仅仅是它的症状:
index f1dd49a..9c0893b 100644 (file)
--- a/Zend/zend_compile.c
+++ b/Zend/zend_compile.c
@@ -4807,6 +4807,7 @@ void zend_compile_foreach(zend_ast *ast) /* {{{ */
zend_end_loop(opnum_fetch, &reset_node);
+ CG(zend_lineno) = ast->lineno;
opline = zend_emit_op(NULL, ZEND_FE_FREE, &reset_node, NULL);
}
/* }}} */
此错误影响 PHP 7.0、7.1、7.2 - 至少没有报告 PHP 5.x。因为这不是一个xdebug
错误,所以即使测试失败,安装也不应该比现在更糟。安装xdebug
,不是sudo make test
但是make && sudo make install
(只make install
需要sudo
)。
推荐阅读
- java - 如何返回没有前 2 个字符的字符串?
- assembly - 汇编 x86 imul 误解
- swift - cgpoint 的颜色会更改所有行,并且应该只更改新行
- python - 为什么在没有 init 的情况下使用顶级目录的导入在 Python 中工作?
- python - gRPC:从装饰器或 ServiceInterceptor 将属性添加到上下文
- oracle - 事实表中的事实值或度量是什么意思?
- java - IE11 和 Safari 没有将授权标头传递给后端
- split - 如何分割线并在lua中获取模式?
- python - python中classmethod wrapper的函数定义
- html - 字体不显示的问题