2017-03-07 66 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