【发布时间】:2017-07-28 02:58:16
【问题描述】:
庆祝以通常的方式设置新的测试服务器盒 - 寻求帮助以使 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
我已经根据下面一些有用的 cmets 进行了编辑,但他们没有提供解决方案,尽管我可以看到 xdebug 指出日志中有连接。
有趣的是,当我选择“在第一行停止”时,“继续”图标显示为绿色,执行似乎停止,但我不知道在哪里。断点仍然被忽略,所以看起来 Netbeans 正在部分识别 xdebug。 这是同时使用 Chrome 和 Firefox。
请帮助让 xdebug 和 netbeans 交谈。
【问题讨论】:
-
1) 防火墙? 2) NetBeans 是否真的在 TCP 9000 端口上侦听(也许您忘记启用侦听器(例如,在 PhpStorm 中有专门的按钮))?使用 netstat 或类似工具检查它。 3) php.ini 的完整 xdebug 设置是什么?日志显示 "Checking remote connect back address" ...但我没有看到相应的配置行(这意味着 - 您只显示了其中的一部分)。 4) 它是什么 IP --
192.168.5.17-- 仔细检查它是否是正确的 IP(必须是运行 NetBeans 的计算机的 IP,从该 Ubuntu 看) -
@LazyOne - 是的,尝试了所有显而易见的方法。 IP 只是一个 192.168.5 范围的本地 IP。 IDE 在此处显示为正在侦听。
-
你的服务器和你的系统在同一个网络上吗?你在这里使用公共IP。所以请仔细检查那些。并形成交叉检查,您可以通过您的系统访问192.168.0.201:10000吗?
-
@chudasamachirag 您在哪里读取公共 IP - 这些是同一 LAN 上的地址?
-
据我所知 192.168.{0-9}.{0-9} 建议使用本地网络,我曾经这样做