xdebug断点失败

xdebug breakpoint fail

庆祝以通常的方式设置新的测试服务器盒 - 通过寻求帮助让 xdebug 工作。

服务器: Ubuntu 服务器 16.10 / Nginx / PHP 7 Xdebug 设置符合 http://php-built.com/installing-xdebug-for-php7/ 的要求并在 phpinfo

上显示

我**:

这些是当前尝试过的设置

[xdebug]
zend_extension="/usr/lib/php/20151012/xdebug.so"
xdebug.remote_enable=true
xdebug.remote_host=192.168.0.201
xdebug.remote_port=10000 (port #9000 is usually occupied by FPM, so I recommend to use a differen$
xdebug.remote_autostart=1
xdebug.idekey=netbeans-xdebug

客户: Windows 10 / Netbeans 侦听端口 10000

日志:

Log opened at 2017-03-15 17:23:49
I: Connecting to configured address/port: 192.168.0.201:10000.
I: Connected to client. :-)
-> <init xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" fileuri="file:///var/www/usr-datadimension/datadimension/sitefiles/public/index.php" language="PHP" xdebug:language_version="7.0.15-0ubuntu0.16.10.4" protocol_version="1.0" appid="19891" idekey="netbeans-xdebug"><engine version="2.5.1"><![CDATA[Xdebug]]></engine><author><![CDATA[Derick Rethans]]></author><url><![CDATA[http://xdebug.org]]></url><copyright><![CDATA[Copyright (c) 2002-2017 by Derick Rethans]]></copyright></init>

<- feature_set -i 28 -n show_hidden -v 1
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="feature_set" transaction_id="28" feature="show_hidden" success="1"></response>

<- feature_set -i 29 -n max_depth -v 3
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="feature_set" transaction_id="29" feature="max_depth" success="1"></response>

<- feature_set -i 30 -n max_children -v 30
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="feature_set" transaction_id="30" feature="max_children" success="1"></response>

<- feature_set -i 31 -n max_data -v 2048
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="feature_set" transaction_id="31" feature="max_data" success="1"></response>

<- breakpoint_set -i 32 -t line -s enabled -f file://TESTSERVERSHARE/sitefiles/app/ControllerLibrary/Controllers/RootController_c.php -n 31
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="breakpoint_set" transaction_id="32" state="enabled" id="198910001"></response>

<- run -i 34
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="run" transaction_id="34" status="stopping" reason="ok"></response>

Log closed at 2017-03-15 17:23:50

我已经根据下面的一些有用的评论对其进行了编辑,但是他们没有提供解决方案,尽管我可以看到 xdebug 说明日志中存在连接。

有趣的是,当我 select 'stop at first line' 时 'Continue' 图标显示为绿色并且执行似乎停止了,但我不知道在哪里。断点仍然被忽略,所以看起来 Netbeans 正在部分识别 xdebug。 这是同时使用 Chrome 和 Firefox。

让 xdebug 和 netbeans 对话需要帮助。

我正在使用浏览器插件: 最简单的 xdebug,它也适用于 chrome 浏览器 (https://addons.mozilla.org/En-us/firefox/addon/the-easiest-xdebug/)

它有关于如何启动 xdebug 的文档

我成功地让它在 Netbeans 上运行,Atom.io,Ms Code。很简单。

你能把这些设置添加到 ini 中试试吗?

xdebug.remote_connect_back=1
xdebug.collect_includes=on
xdebug.extended_info=1
xdebug.show_local_vars=1
xdebug.show_mem_delta=1
xdebug.max_nesting_level=200

希望允许端口 10000

我以前从来没有在 Netbeans 上设置过这个,但是从 Eclipse 上类似的报告问题来看,这个设置似乎需要 Project properties > Source > Web Root 设置到 Nginx 服务的 public 目录. 断点现在可以正常工作了。