自php 8起无法使用NetBeans单步调试xdebug

x759pob2  于 2022-11-10  发布在  PHP
关注(0)|答案(1)|浏览(214)

从php 7升级到php 8后,我无法再单步执行/跳过/继续NetBeans IDE 11.0和xdebug 3.0.4。
xdebug(通过NetBeans)配置为“在第一行停止”-并且此操作有效。也就是说,(本地主机)Web页将挂起,并且NetBeans的“单步执行”/“单步跳过”/“继续”按钮将启用。但是,当我单击“单步执行”/“单步跳过”/“继续”中的任意一个按钮时,xdebug会话将关闭,NetBeans不再提示。此外,Web页将完成- * 但没有任何输出 *。
系统日志中没有任何相关信息。php8.0-fpm.log没有显示错误。xdebug.log文件如下。
还有别的日志我该看吗

[60811] Log opened at 2021-09-24 13:17:34.836984
[60811] [Step Debug] INFO: Checking remote connect back address.
[60811] [Step Debug] INFO: Checking header 'HTTP_X_FORWARDED_FOR'.
[60811] [Step Debug] INFO: Checking header 'REMOTE_ADDR'.
[60811] [Step Debug] INFO: Client host discovered through HTTP header, connecting to 127.0.0.1:7070.
[60811] [Step Debug] INFO: Connected to debugging client: 127.0.0.1:7070 (from REMOTE_ADDR HTTP header). :-)
[60811] [Step Debug] -> <init xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" fileuri="file:///home/flymike/critical_data/http/sarabayracing.home/index.php" language="PHP" xdebug:language_version="8.0.5" protocol_version="1.0" appid="60811" idekey="netbeans-xdebug"><engine version="3.0.4"><![CDATA[Xdebug]]></engine><author><![CDATA[Derick Rethans]]></author><url><![CDATA[https://xdebug.org]]></url><copyright><![CDATA[Copyright (c) 2002-2021 by Derick Rethans]]></copyright></init>

[60811] [Step Debug] <- feature_set -i 32 -n show_hidden -v 1
[60811] [Step Debug] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="feature_set" transaction_id="32" feature="show_hidden" success="1"></response>

[60811] [Step Debug] <- feature_set -i 33 -n max_depth -v 3
[60811] [Step Debug] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="feature_set" transaction_id="33" feature="max_depth" success="1"></response>

[60811] [Step Debug] <- feature_set -i 34 -n max_children -v 30
[60811] [Step Debug] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="feature_set" transaction_id="34" feature="max_children" success="1"></response>

[60811] [Step Debug] <- feature_set -i 35 -n max_data -v 2048
[60811] [Step Debug] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="feature_set" transaction_id="35" feature="max_data" success="1"></response>

[60811] [Step Debug] <- breakpoint_set -i 36 -t line -s enabled -f file:///home/flymike/critical_data/http/sarabayracing.home/wp-content/plugins/MJH/EventRegistration/Archive/1.12/classes/time_period.php -n 24
[60811] [Step Debug] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="breakpoint_set" transaction_id="36" state="enabled" id="608110001"></response>

[60811] [Step Debug] <- breakpoint_set -i 37 -t line -s enabled -f file:///home/flymike/critical_data/http/sarabayracing.home/wp-content/plugins/MJH/EventRegistration/classes/EventRegistration.php -n 113
[60811] [Step Debug] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="breakpoint_set" transaction_id="37" state="enabled" id="608110002"></response>

[60811] [Step Debug] <- breakpoint_set -i 38 -t line -s enabled -f file:///home/flymike/critical_data/http/sarabayracing.home/wp-content/plugins/MJH/EventRegistration/Archive/1.12/classes/time_period.php -n 89
[60811] [Step Debug] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="breakpoint_set" transaction_id="38" state="enabled" id="608110003"></response>

[60811] [Step Debug] <- stdout -i 39 -c 1
[60811] [Step Debug] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="stdout" transaction_id="39" success="1"></response>

[60811] [Step Debug] <- step_into -i 40
[60811] [Step Debug] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="step_into" transaction_id="40" status="break" reason="ok"><xdebug:message filename="file:///home/flymike/critical_data/http/sarabayracing.home/index.php" lineno="14"></xdebug:message></response>

[60811] [Step Debug] <- stack_get -i 41
[60811] [Step Debug] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="stack_get" transaction_id="41"><stack where="{main}" level="0" type="file" filename="file:///home/flymike/critical_data/http/sarabayracing.home/index.php" lineno="14"></stack></response>

[60811] [Step Debug] <- context_names -i 42
[60811] [Step Debug] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="context_names" transaction_id="42"><context name="Locals" id="0"></context><context name="Superglobals" id="1"></context><context name="User defined constants" id="2"></context></response>

[60811] [Step Debug] <- eval -i 43 -- KFxnZXRfb3B0aW9uKHNlbGY6OiRTRVRUSU5HU19OQU1FKQ==
[60811] [Step Debug] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="eval" transaction_id="43" status="break" reason="ok"><error code="206"><message><![CDATA[error evaluating code]]></message></error></response>

[60811] [Step Debug] <- context_get -i 44 -c 0
[60811] [Step Debug] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="context_get" transaction_id="44" context="0"></response>

[60811] [Step Debug] <- context_get -i 45 -c 1
[60811] [Step Debug] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="context_get" transaction_id="45" context="1"><property name="$_COOKIE" fullname="$_COOKIE" type="array" children="1" numchildren="6" page="0" pagesize="30"><property name="wp-settings-1" fullname="$_COOKIE[&quot;wp-settings-1&quot;]" type="string" size="76" encoding="base64"><![CDATA[bGlicmFyeUNvbnRlbnQ9YnJvd3NlJmhpZGV0Yj0xJmVkaXRvcj1odG1sJmVkaXRvcl9wbGFpbl90ZXh0X3Bhc3RlX3dhcm5pbmc9Mg==]]></property><proper
[60811] [Step Debug] <- context_get -i 46 -c 2
[60811] [Step Debug] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="context_get" transaction_id="46" context="2"></response>

[60811] [Step Debug] <- step_into -i 47
[60811] [Step Debug] -> <stream xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" type="stdout" encoding="base64"><![CDATA[Q29udGVudC10eXBlOiB0ZXh0L2h0bWw7IGNoYXJzZXQ9VVRGLTg=]]></stream>

[60811] [Step Debug] -> <stream xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" type="stdout" encoding="base64"><![CDATA[DQo=]]></stream>

[60811] [Step Debug] -> <stream xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" type="stdout" encoding="base64"><![CDATA[DQo=]]></stream>

[60811] [Step Debug] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="step_into" transaction_id="47" status="stopping" reason="ok"></response>

[60811] Log closed at 2021-09-24 13:17:40.814767
mum43rcc

mum43rcc1#

PHP 7.4和8.0之间有一些变化,这些变化改变了内部eval语句的错误检查行为,当IDE设置监视时,Xdebug会使用这些行为。
如果我用base64对您的(或者是IDE的)eval语句(eval -i 43 -- KFxnZXRfb3B0aW9uKHNlbGY6OiRTRVRUSU5HU19OQU1FKQ==)进行解码,它会说:

(\get_option(self::$SETTINGS_NAME)

开始时有一个额外的(,很可能是在你设置的手表中?
Xdebug 3.1应该有一个针对changes to eval的修复程序,您可以通过安装Xdebug 3.1.0beta2(从PECL(pecl install xdebug-3.1.0beta2)或源代码)来自己测试这个修复程序。

相关问题