2012-12-29 55 views
4

可能重複:
Xdebug and Netbeans are not communicating with each otherNetbeans的Xdebug的安裝+ PHP + Ubuntu操作系統

如何netbeans實施xdebug。我搜索很多,我一直在使用Ubuntu OS做了一些東西,在阿帕奇php.ini

zend_extension=/path/to/xdebug.so 
xdebug.remote_enable=1 
xdebug.remote_handler=dbgp 
xdebug.remote_mode=req 
xdebug.remote_host=127.0.0.1 
xdebug.remote_port=9000 

上午。

Xdebug主要使用調試複雜的代碼。(for loop/foreach

現在,當我在調試項目netbeans頁腳狀態顯示點擊搜索XDebug的連接,它不是結束結束不意味着連接失敗。

我想你會得到我想要的。

請幫幫我。

+0

當您從netbeans開始調試時,瀏覽器窗口是否打開了您正在處理的項目? – Eelke

回答

13

最近我已配置xdebugnetbeansubuntu

這裏是你下面的步驟來安裝和使用netbeans

1配置xdebug)到這個頁面並安裝Firefox插件:

https://addons.mozilla.org/en-US/firefox/addon/easy-xdebug/ 

2)使用下面的命令從命令安裝了XDebug提示(終端)

sudo apt-get install php5-xdebug 

3)從終端然後打開xdebug.ini:

gedit /etc/php5/conf.d/xdebug.ini 

4)在那裏複製唯一的一行。 (應該是這樣的:

zend_extension=/usr/lib/php5/20090626+lfs/xdebug.so). 

5)打開php.ini文件使用此命令

sudo gedit /etc/php5/apache2/php.ini 

6)粘貼超級用戶權限,你從xdebug.ini伴隨着以下四個複製的行行到您的php.ini文件:

這裏粘貼複製的行

     xdebug.remote_enable=On; 
         xdebug.remote_host="localhost;" 
         xdebug.remote_port=9000; 
         xdebug.remote_handler="dbgp"; 

7)完成了!只需要重新啓動你的Apache:

使用下面的命令爲:

sudo /etc/init.d/apache2 restart 

現在只需打開項目netbeans並按ctrl+F5或從菜單中單擊debug>debug項目 。

希望它能幫助你。

+3

在步驟4)我不得不sudo gedit /etc/php5/mods-available/xdebug.ini – theczechsensation