Visual studio code Xdebug 3在VSCode上运行缓慢

Visual studio code Xdebug 3在VSCode上运行缓慢,visual-studio-code,xdebug,Visual Studio Code,Xdebug,我开始使用Xdebug 3,它工作正常,但速度非常慢。Xdebug 2立即被删除,但对于Xdebug 3,标记断点需要几秒钟的时间 这个问题有什么配置解决方案吗 这是我在php.ini文件上的配置 [XDebug] zend_extension=C:\xampp\php\ext\php_xdebug-3.0.4-7.4-vc15-x86_64.dll xdebug.mode=debug xdebug.start_with_request=yes xdebug.client_port=9003 x

我开始使用Xdebug 3,它工作正常,但速度非常慢。Xdebug 2立即被删除,但对于Xdebug 3,标记断点需要几秒钟的时间

这个问题有什么配置解决方案吗

这是我在
php.ini
文件上的配置

[XDebug]
zend_extension=C:\xampp\php\ext\php_xdebug-3.0.4-7.4-vc15-x86_64.dll
xdebug.mode=debug
xdebug.start_with_request=yes
xdebug.client_port=9003
xdebug.client_host=“127.0.0.1”
xdebug.log=“C:\xampp\tmp\xdebug\xdebug.log”
xdebug.idekey=VSCODE
launch.json
文件

{
//使用IntelliSense了解可能的属性。
//悬停以查看现有属性的描述。
//有关更多信息,请访问:https://go.microsoft.com/fwlink/?linkid=830387
“版本”:“0.2.0”,
“配置”:[
{
“名称”:“侦听Xdebug”,
“类型”:“php”,
“请求”:“启动”,
“港口”:9003
},
{
“名称”:“启动当前打开的脚本”,
“类型”:“php”,
“请求”:“启动”,
“程序”:“${file}”,
“cwd”:“${fileDirname}”,
“港口”:9003
}
]
}
更新:

这是日志,它似乎需要尝试连接它

[3560] Log opened at 2021-05-24 09:58:26.404140
[3560] [Step Debug] INFO: Connecting to configured address/port: 127.0.0.1:9003.
[3560] [Step Debug] ERR: Time-out connecting to debugging client, waited: 200 ms. Tried: 127.0.0.1:9003 (through xdebug.client_host/xdebug.client_port) :-(
[8380] Log opened at 2021-05-24 09:58:33.594218
[8380] [Step Debug] INFO: Connecting to configured address/port: 127.0.0.1:9003.
[8380] [Step Debug] INFO: Connected to debugging client: 127.0.0.1:9003 (through xdebug.client_host/xdebug.client_port). :-)
更新2:

这是一份完整的日志

[13440] Log opened at 2021-05-24 11:23:49.098251
[13440] [Step Debug] INFO: Connecting to configured address/port: 127.0.0.1:9003.
[13440] [Step Debug] INFO: Connected to debugging client: 127.0.0.1:9003 (through xdebug.client_host/xdebug.client_port). :-)
[13440] [Step Debug] -> <init xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" fileuri="file:///C:/xampp/htdocs/prueba/index.php" language="PHP" xdebug:language_version="7.4.17RC1" protocol_version="1.0" appid="13440" idekey="VSCODE"><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>

[13440] [Step Debug] <- feature_get -i 1 -n resolved_breakpoints
[13440] [Step Debug] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="feature_get" transaction_id="1" feature_name="resolved_breakpoints" supported="1"><![CDATA[0]]></response>

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

[13440] [Step Debug] <- feature_get -i 3 -n notify_ok
[13440] [Step Debug] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="feature_get" transaction_id="3" feature_name="notify_ok" supported="1"><![CDATA[0]]></response>

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

[13440] [Step Debug] <- breakpoint_set -i 5 -t line -f file:///c:/xampp/htdocs/prueba/index.php -n 3
[13440] [Step Debug] -> <notify xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" name="breakpoint_resolved"><breakpoint type="line" resolved="resolved" filename="file:///C:/xampp/htdocs/prueba/index.php" lineno="3" state="enabled" hit_count="0" hit_value="0" id="134400003"></breakpoint></notify>

[13440] [Step Debug] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="breakpoint_set" transaction_id="5" id="134400003" resolved="resolved"></response>

[13440] [Step Debug] <- breakpoint_get -i 6 -d 134400003
[13440] [Step Debug] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="breakpoint_get" transaction_id="6"><breakpoint type="line" resolved="resolved" filename="file:///C:/xampp/htdocs/prueba/index.php" lineno="3" state="enabled" hit_count="0" hit_value="0" id="134400003"></breakpoint></response>

[13440] [Step Debug] <- run -i 7
[13440] [Step Debug] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="run" transaction_id="7" status="break" reason="ok"><xdebug:message filename="file:///C:/xampp/htdocs/prueba/index.php" lineno="3"></xdebug:message></response>

[13440] [Step Debug] <- stack_get -i 8
[13440] [Step Debug] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="stack_get" transaction_id="8"><stack where="{main}" level="0" type="file" filename="file:///C:/xampp/htdocs/prueba/index.php" lineno="3"></stack></response>

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

[13440] [Step Debug] <- context_get -i 10 -d 0 -c 0
[13440] [Step Debug] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="context_get" transaction_id="10" context="0"><property name="$saludo" fullname="$saludo" type="uninitialized"></property></response>

[13440] [Step Debug] <- step_into -i 11
[13440] [Step Debug] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="step_into" transaction_id="11" status="break" reason="ok"><xdebug:message filename="file:///C:/xampp/htdocs/prueba/index.php" lineno="4"></xdebug:message></response>

[13440] [Step Debug] <- stack_get -i 12
[13440] [Step Debug] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="stack_get" transaction_id="12"><stack where="{main}" level="0" type="file" filename="file:///C:/xampp/htdocs/prueba/index.php" lineno="4"></stack></response>

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

[13440] [Step Debug] <- context_get -i 14 -d 0 -c 0
[13440] [Step Debug] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="context_get" transaction_id="14" context="0"><property name="$saludo" fullname="$saludo" type="string" size="4" encoding="base64"><![CDATA[aG9sYQ==]]></property></response>

[13440] [Step Debug] <- stop -i 15
[13440] [Step Debug] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="stop" transaction_id="15" status="stopped" reason="ok"></response>

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

[13440] Log closed at 2021-05-24 11:28:15.536136
[13440]日志于2021-05-24 11:23:49.098251打开
[13440][步骤调试]信息:连接到配置的地址/端口:127.0.0.1:9003。
[13440][Step Debug]信息:已连接到调试客户端:127.0.0.1:9003(通过xdebug.client\u主机/xdebug.client\u端口)。:-)
[13440][步骤调试]->
[13440][步骤调试]
[13440][步骤调试]
[13440][步骤调试]
[13440][步骤调试]
[13440][步骤调试]
[13440][步骤调试]->
[13440][步骤调试]
[13440][步骤调试]
[13440][步骤调试]
[13440][步骤调试]
[13440][步骤调试]
[13440][步骤调试]
[13440][步骤调试]
[13440][步骤调试]
[13440][步骤调试]
[13440][步骤调试]
[13440][步骤调试]->
[13440]日志在2021-05-24 11:28:15.536136关闭

Xdebug的日志说明了什么?在`C:\xampp\tmp\Xdebug`@af\u 159623上没有
Xdebug.log
文件,它应该在那里生成日志。确保该文件夹存在,并检查文件权限/防病毒软件(以防万一)。也许可以尝试另一个临时文件夹(例如,您的用户临时——即在cmd.exe终端中选中
echo%temp%
)。使用您的设置(
xdebug.start_With_request=yes
),xdebug应该尝试调试每个请求,因此它应该写入日志。也许您有超过1个PHP或不同的配置?仔细检查
phpinfo()
输出的Xdebug部分,捕获方式与您尝试调试(CLI或网页)的方式相同。@LazyOne,我已用日志更新了问题,第一次无法连接,但第二次尝试有效。那么连接时的响应是什么?那之后日志里的东西。1) 可能它连接到了错误的东西(应用程序)?2) 也许VSCode当时还没有监听?我可能会建议将超时时间从默认的200ms增加到更大的值(例如1000甚至2000),然后看看它是如何工作的。