我全新安装了 Windows 10,并安装了 xampp 7.4.15 和 XDebug 3.0.2。
php 已配置为使用 xdebug。
我一直无法调试 PHP 的工作。在下面的详细信息中,我可以证明 xdebug 已配置并正在工作(使用 dbgpClient),并且 xdebug 正在连接到 netbeans(使用 xdebug 日志)。
我无法弄清楚它为何挂起。任何帮助,将不胜感激。我现在完全脱离了我的舒适区!
这是添加php.ini来设置xdebug
zend_extension = C:\xampp_7_4_15\php\ext\php_xdebug-3.0.2-7.4-vc15-x86_64.dll
xdebug.mode=debug
xdebug.start_with_request=true
xdebug.client_port=9003
xdebug.log="C:\xampp_7_4_15\apache\logs\xdebug.log"
我已经确认它可以使用 dbgpClient.exe
Connect from [::1]:50298
DBGp/1.0: Xdebug 3.0.2 — For PHP 7.4.14RC1
Debugging file:///C:/Users/david/Documents/LanarWeb/Lanar/public/index.php (ID: 8772/)
(cmd) step_into
1 | step_into > break/ok
1 | file:///C:/Users/david/Documents/LanarWeb/Lanar/public/index.php:12
(cmd) status
2 | status > break/ok
(cmd) step_into
3 | step_into > break/ok
3 | file:///C:/Users/david/Documents/LanarWeb/Lanar/public/index.php:14
When I try to run the website from netbeans in debug mode, the browser opens and hangs.
If I stop debugging using Shift-F5, a dialog box is displayed.
如果我检查 xdebug.log 文件,就会发现这些事务。请注意,最后一个是功能集。即使调试会话关闭后,日志文件中也不再有任何条目。
[2584] Log opened at 2554-07-21 23:34:32.995542
[2584] [Step Debug] INFO: Connecting to configured address/port: localhost:9003.
[2584] [Step Debug] INFO: Connected to debugging client: localhost:9003 (through xdebug.client_host/xdebug.client_port). :-)
[2584] [Step Debug] -> <init xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" fileuri="file:///C:/Users/david/Documents/LanarWeb/Lanar/public/index.php" language="PHP" xdebug:language_version="7.4.14RC1" protocol_version="1.0" appid="2584"><engine version="3.0.2"><![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>
[2584] [Step Debug] <- feature_set -i 0 -n show_hidden -v 1
[2584] [Step Debug] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="feature_set" transaction_id="0" feature="show_hidden" success="1"></response>
[2584] [Step Debug] <- feature_set -i 1 -n max_depth -v 3
[2584] [Step Debug] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="feature_set" transaction_id="1" feature="max_depth" success="1"></response>
[2584] [Step Debug] <- feature_set -i 2 -n max_children -v 30
[2584] [Step Debug] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="feature_set" transaction_id="2" feature="max_children" success="1"></response>
[2584] [Step Debug] <- feature_set -i 3 -n max_data -v 2048
[2584] [Step Debug] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="feature_set" transaction_id="3" feature="max_data" success="1"></response>
这就是日志中的全部内容。没有更多消息,也没有“日志已关闭”。看来 xdebug 已经停止了。
任何提示表示赞赏。