I'm using Netbeans 6.7 and XDebug to debug a PHP site on my machine, launching the request from within Netbeans (Project->Debug). This works fine, and is very useful.
我的问题是:是否可以将调试器附加到传入的任何请求,而不仅仅是从Netbeans中启动的请求?
ie,而不是单击"调试",将Netbeans置于一种模式,在此模式下,调试器将启动并附加到下一个传入的请求.
我觉得这可能是个愚蠢的问题,但如果可能的话,那就太好了.
Edit:多点信息
我的系统(Ubuntu 9.04)设置如下:
目录/etc/php5/conf.d/xdebug.ini
zend_extension=/usr/lib/php5/20060613/xdebug.so
xdebug.remote_enable=on
xdebug.remote_handler=dbgp
xdebug.remote_mode=req
xdebug.remote_host=localhost
xdebug.remote_port=9000
xdebug.idekey=netbeans-xdebug
Netbeans PHP调试选项默认为:
Debugger Port: 9000
Session ID: netbeans-xdebug
Stop at the First Line: ticked
我的/etc/hosts
文件将www.mywebsite.com
重定向到localhost
如果我点击Netbeans中的debug按钮,那么Firefox将以地址http://www.mywebsite.com?XDEBUG_SESSION_START=netbeans-xdebug
启动,调试器将按预期工作.
但如果我只是浏览到http://www.mywebsite.com?XDEBUG_SESSION_START=netbeans-xdebug
,这不会启动Netbeans中的调试器.
我也试过设定xdebug.remote_host=www.mywebsite.com
,但这没什么区别.
此外,我还启用了xdebug.remote_log
,这显示了从netbeans内部开始时的信息,但没有显示外部请求的信息.所以我认为XDebug根本看不到外部请求.