在网上找了很多netbeans下通过xdebug调试php程序的教程,都不成功。
可能是最近软件有更新吧。经过几天摸索,终于成功了。
步骤如下
1.下载xampp,编辑php.ini,打开xdebug
[XDebug]
zend_extension = "D:\xampp\php\ext\php_xdebug.dll"
xdebug.remote_enable = 1
xdebug.remote_handler = "dbgp"
xdebug.remote_host = "localhost"
xdebug.remote_mode = "req"
xdebug.remote_port = 9000
xdebug.idekey = "netbeans-xdebug"
关闭缓冲区(特别重要,其它教程都没说)
output_buffering = Off
implicit_flush=On
2.安装浏览器xdebug插件
firefox下试了很多,感觉这个好用
easy Xdebug (with moveable icon)0.7.0
这个也行,但是有点小bug
The easiest Xdebug
看插件手册http://manual.pohape.ru/xdebug/
3.设置netbeans
选项---》php---》调试---》
调试器端口 9000
会话id netbeans-xdebug(要和浏览器中的Value of the debug cookie一致,和php.ini中的key要一致)