PhpStorm / Xdebug挂起并激活了断点

时间:2019-03-15 18:16:39

标签: php phpstorm xdebug

这是关于在Ubuntu上运行的带有Xdebug的PhpStorm中调试会话遇到的问题。此设置在该项目中已经运行了好几个月,但是昨天突然突然停止了工作。

现在发生的是,当我启动一个具有断点设置的调试会话时,将打开一个新的浏览器选项卡(通常如此),然后浏览器只是挂起(“ Waiting for ...”),就像遇到断点,但PhpStorm永远不会突出显示断点所在的代码行或激活代码步进控件。

在未设置断点的情况下,新标签页打开,页面加载没有问题。

我遵循了JetBrains故障排除指南中的常见调试问题,并获得了以下结果:

  • “启用xdebug日志记录。”
    做完了日志示例如下所示。

  • “确保已安装和配置xdebug。”
    校验。它已经在运行,并且我确认对原始配置没有任何更改。

  • “验证没有PHP启动警告。”
    已验证。 PHP干净启动。

  • “确保已将Xdebug或Zend Debugger配置为连接到主机,并且PhpStorm端口正在运行。”
    已验证。 Xdebug正在连接。 (请参阅下面的日志示例。)

  • “远程路径未映射到项目中的任何文件。”
    不。否则,它将无法像现在那样在没有活动断点的情况下运行。

  • “未达到断点。” (我认为这意味着应用程序在执行时不会暂停断点。)
    不适用。

  • “使用nginx时,断点不起作用。”
    不适用。

  • “ Xdebug无法连接到PhpStorm。” (冗余)
    Xdebug成功连接到主机。

我还尝试增加最大同时连接数限制,这在其他SO帖子中已经提到。没有变化。

这是Xdebug日志文件中的两个示例。第一个显示了不带断点的完整调试会话,其中成功加载了一页。

[7733] Log opened at 2019-03-14 22:07:35
[7733] I: Connecting to configured address/port: 127.0.0.1:9000.
[7733] I: Connected to client. :-)
[7733] -> <init xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" fileuri="file:///var/www/dev-writeoffs_jea_org/writeoffs/public/index.php" language="PHP" xdebug:language_version="7.2.15-1+ubuntu14.04.1+deb.sury.org+1" protocol_version="1.0" appid="7733" idekey="16444"><engine version="2.7.0"><![CDATA[Xdebug]]></engine><author><![CDATA[Derick Rethans]]></author><url><![CDATA[https://xdebug.org]]></url><copyright><![CDATA[Copyright (c) 2002-2019 by Derick Rethans]]></copyright></init>
[7733]
[7733] <- feature_set -i 1 -n show_hidden -v 1
[7733] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="feature_set" transaction_id="1" feature="show_hidden" success="1"></response>
[7733]
[7733] <- feature_set -i 2 -n max_depth -v 1
[7733] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="feature_set" transaction_id="2" feature="max_depth" success="1"></response>
[7733]
[7733] <- feature_set -i 3 -n max_children -v 100
[7733] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="feature_set" transaction_id="3" feature="max_children" success="1"></response>
[7733]
[7733] <- feature_set -i 4 -n extended_properties -v 1
[7733] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="feature_set" transaction_id="4" feature="extended_properties" success="1"></response>
[7733]
[7733] <- feature_set -i 5 -n notify_ok -v 1
[7733] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="feature_set" transaction_id="5" feature="notify_ok" success="1"></response>
[7733]
[7733] <- stdout -i 6 -c 1
[7733] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="stdout" transaction_id="6" success="1"></response>
[7733]
[7733] <- status -i 7
[7733] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="status" transaction_id="7" status="starting" reason="ok"></response>
[7733]
[7733] <- step_into -i 8
[7733] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="step_into" transaction_id="8" status="break" reason="ok"><xdebug:message filename="file:///var/www/dev-writeoffs_jea_org/writeoffs/public/index.php" lineno="10"></xdebug:message></response>
[7733]
[7733] <- stack_get -i 9
[7733] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="stack_get" transaction_id="9"><stack where="{main}" level="0" type="file" filename="file:///var/www/dev-writeoffs_jea_org/writeoffs/public/index.php" lineno="10"></stack></response>
[7733]
[7733] <- run -i 10
[7733] -> <stream xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" type="stdout" encoding="base64">...[output omitted]...</stream>
[7733]
[7733] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="run" transaction_id="10" status="stopping" reason="ok"></response>
[7733]
[7733] <- run -i 11
[7733] Log closed at 2019-03-14 22:07:37
[7733]

此示例显示了带有断点设置的调试会话。它挂起,然后我必须停止PHPStorm中的调试会话。我注意到它说它在HomeController第122行的断点处处于断点状态(这是断点的正确位置),但是stepper突出显示未出现在PHPStorm中,并且不会激活步进控件。那么xdebug是否可以正确地中断,但是PHPStorm没有检测到中断?

[7573] Log opened at 2019-03-14 22:17:12
[7573] I: Connecting to configured address/port: 127.0.0.1:9000.
[7573] I: Connected to client. :-)
[7573] -> <init xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" fileuri="file:///var/www/dev-writeoffs_jea_org/writeoffs/public/index.php" language="PHP" xdebug:language_version="7.2.15-1+ubuntu14.04.1+deb.sury.org+1" protocol_version="1.0" appid="7573" idekey="10264"><engine version="2.7.0"><![CDATA[Xdebug]]></engine><author><![CDATA[Derick Rethans]]></author><url><![CDATA[https://xdebug.org]]></url><copyright><![CDATA[Copyright (c) 2002-2019 by Derick Rethans]]></copyright></init>
[7573]
[7573] <- feature_set -i 1 -n show_hidden -v 1
[7573] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="feature_set" transaction_id="1" feature="show_hidden" success="1"></response>
[7573]
[7573] <- feature_set -i 2 -n max_depth -v 1
[7573] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="feature_set" transaction_id="2" feature="max_depth" success="1"></response>
[7573]
[7573] <- feature_set -i 3 -n max_children -v 100
[7573] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="feature_set" transaction_id="3" feature="max_children" success="1"></response>
[7573]
[7573] <- feature_set -i 4 -n extended_properties -v 1
[7573] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="feature_set" transaction_id="4" feature="extended_properties" success="1"></response>
[7573]
[7573] <- feature_set -i 5 -n notify_ok -v 1
[7573] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="feature_set" transaction_id="5" feature="notify_ok" success="1"></response>
[7573]
[7573] <- stdout -i 6 -c 1
[7573] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="stdout" transaction_id="6" success="1"></response>
[7573]
[7573] <- status -i 7
[7573] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="status" transaction_id="7" status="starting" reason="ok"></response>
[7573]
[7573] <- step_into -i 8
[7573] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="step_into" transaction_id="8" status="break" reason="ok"><xdebug:message filename="file:///var/www/dev-writeoffs_jea_org/writeoffs/public/index.php" lineno="10"></xdebug:message></response>
[7573]
[7573] <- breakpoint_set -i 9 -t line -f file:///var/www/dev-writeoffs_jea_org/writeoffs/app/Http/Controllers/HomeController.php -n 122
[7573] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="breakpoint_set" transaction_id="9" id="75730001"></response>
[7573]
[7573] <- stack_get -i 10
[7573] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="stack_get" transaction_id="10"><stack where="{main}" level="0" type="file" filename="file:///var/www/dev-writeoffs_jea_org/writeoffs/public/index.php" lineno="10"></stack></response>
[7573]
[7573] <- run -i 11
[7573] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="run" transaction_id="11" status="break" reason="ok"><xdebug:message filename="file:///var/www/dev-writeoffs_jea_org/writeoffs/app/Http/Controllers/HomeController.php" lineno="122"></xdebug:message></response>
[7573]

... at this point it's hung.


... then I stop it from within PhpStorm, then this...


[7573] <- stop -i 12
[7573] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="stop" transaction_id="12" status="stopped" reason="ok"></response>
[7573]
[7573] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="stop" transaction_id="12" status="stopping" reason="ok"></response>
[7573]
[7573] Log closed at 2019-03-14 22:18:17
[7573]

如果有人可以给我一些有关这里可能发生的事情以及我可以如何解决的线索,我将非常感激!

0 个答案:

没有答案