Possible Duplicate:
Xdebug and Netbeans are not communicating with each other
如何在 netbeans
中实现 xdebug
。我搜索了很多,我在 apache 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
我正在使用 Ubuntu
操作系统。
Xdebug
主要用于调试复杂的php代码。( for loop/foreach
)
现在,当我点击调试项目 netbeans
时,页脚状态显示正在搜索 xdebug 连接,它没有结束意味着连接失败。
我想你得到了我想要的。
请帮帮我。
最近我在 ubuntu
中用 netbeans
配置了 xdebug
。
以下是使用 netbeans
安装和配置 xdebug
的步骤
1) 转到此页面并安装 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) 使用此命令以 super 用户权限打开 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
project
从菜单。
希望对你有所帮助。