自 php 8 起无法使用 NetBeans 执行 xdebug
Cannot step xdebug with NetBeans since php 8
自从 php 7 升级到 php 8 后,我无法再使用 NetBeans IDE 11.0 和 xdebug 3.0.4 步骤 Into/Step Over/Continue .
xdebug(通过 NetBeans)配置为“在第一行停止”- 这有效。也就是说,(本地主机)网页被暂停,NetBeans Step Into/Step Over/Continue 按钮被启用。
但是,当我单击任何步骤 Into/Step Over/Continue 时,xdebug 会话关闭,NetBeans 不再提示。此外,网页完成 - 但没有任何输出。
系统日志中没有任何相关内容。 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["wp-settings-1"]" 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
PHP 7.4 和 8.0 之间有一些变化,这些变化改变了内部 eval
语句的错误检查行为,Xdebug 在 IDE 设置监视时使用它。
如果我用 base64 解码你的(或者 IDE 的)eval
语句(eval -i 43 -- KFxnZXRfb3B0aW9uKHNlbGY6OiRTRVRUSU5HU19OQU1FKQ==
),它说:
(\get_option(self::$SETTINGS_NAME)
开头有一个额外的 (
,很可能在您设置的手表中?
Xdebug 3.1 应该有 changes to eval 的修复程序,您可以通过从 PECL (pecl install xdebug-3.1.0beta2
) 或源代码安装 Xdebug 3.1.0beta2 来自己测试。
自从 php 7 升级到 php 8 后,我无法再使用 NetBeans IDE 11.0 和 xdebug 3.0.4 步骤 Into/Step Over/Continue .
xdebug(通过 NetBeans)配置为“在第一行停止”- 这有效。也就是说,(本地主机)网页被暂停,NetBeans Step Into/Step Over/Continue 按钮被启用。 但是,当我单击任何步骤 Into/Step Over/Continue 时,xdebug 会话关闭,NetBeans 不再提示。此外,网页完成 - 但没有任何输出。
系统日志中没有任何相关内容。 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["wp-settings-1"]" 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
PHP 7.4 和 8.0 之间有一些变化,这些变化改变了内部 eval
语句的错误检查行为,Xdebug 在 IDE 设置监视时使用它。
如果我用 base64 解码你的(或者 IDE 的)eval
语句(eval -i 43 -- KFxnZXRfb3B0aW9uKHNlbGY6OiRTRVRUSU5HU19OQU1FKQ==
),它说:
(\get_option(self::$SETTINGS_NAME)
开头有一个额外的 (
,很可能在您设置的手表中?
Xdebug 3.1 应该有 changes to eval 的修复程序,您可以通过从 PECL (pecl install xdebug-3.1.0beta2
) 或源代码安装 Xdebug 3.1.0beta2 来自己测试。