2017-03-07 115 views
10

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

服务器: Ubuntu服务器16.10/Nginx的/ PHP 7 Xdebug的设置与要求在http://php-built.com/installing-xdebug-for-php7/和表示上的phpinfo

I **:

这些都是当前设置试图

[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/Net豆类侦听端口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的,说明没有在日志中的连接编辑。

有趣的是,当我选择'停在第一线''继续'图标显示绿色,执行似乎停止,但我不知道在哪里。断点仍然被忽略,所以看来Netbeans部分地识别了xdebug。 这是使用Chrome和Firefox。

需要帮助以获得xdebug和netbeans的交谈。

+0

1)防火墙? 2)NetBeans是否实际监听TCP 9000端口(可能您忘记启用监听器(例如在PhpStorm中只有专用按钮))?用netstat或类似的工具检查它。 3)什么是从php.ini完整的xdebug设置?日志显示*“检查远程连接返回地址”* ...但我没有看到相应的配置行(这意味着 - 你只显示了一部分)。 4)它是什么IP - '192.168.5.17' - 仔细检查它是否是一个正确的IP(必须是运行NetBeans的计算机的IP,如从Ubuntu看到的那样) – LazyOne

+0

@LazyOne - yup试过所有明显的问题。 IP只是一个192.168.5范围内的本地IP。 IDE显示为在此处聆听。 – Datadimension

+0

在同一网络上做你的服务器和你的系统?你在这里使用公共IP。所以请仔细检查一下。 和窗体交叉检查,你可以通过你的系统访问192.168.0.201:10000? – chudasamachirag

回答

0

我以前从来没有但是从寻找类似的报道Eclipse的问题,看来这个设置要求Project properties > Source > Web Root设置为公共目录设置此NetBeans上由Nginx提供服务。 断点现在正常工作。

0

我使用的浏览器插件: 的,最容易的XDebug,这也是Chrome浏览器(https://addons.mozilla.org/En-us/firefox/addon/the-easiest-xdebug/

它如何开始Xdebug的

我顺利地拿到了它的工作的文件Netbeans,Atom.io,Ms Code。这很容易。

+0

这看起来很有前途,对不起,我没有机会测试这个,但会做 – Datadimension

+0

一旦你开始,那么很容易在任何平台或IDE上设置xdebug – Ananth

+0

不幸的是,这不起作用 – Datadimension

0

你可以将这些设置添加到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允许

+0

这似乎没有什么差别,日志输出与上面相同(除时间戳) – Datadimension