为什么xdebug无法与NetBeans建立连接?

问题描述:

我尝试将xdebug与NetBeans结合使用来调试PHP.我开始调试,然后NetBeans永远等待与xdebug的连接.我的Mac上安装了NetBeans 6.8(最新版本),并带有最新的MAMP软件包.

I try using xdebug with NetBeans to debug PHP. I start debug, and NetBeans waits for ever for a connection with xdebug. I have NetBeans 6.8 (latest version) with the latest MAMP package installed on my mac.

我的php.ini看起来像这样:

My php.ini looks like this:

[xdebug]
;zend_extension="/Applications/MAMP/bin/php5/lib/php/extensions/no-debug-non-zts-20060613/xdebug.so"
xdebug.remote_enable=on
xdebug.remote_handler=dbgp
xdebug.remote_mode=req
xdebug.remote_host=localhost
xdebug.remote_port=9000

如果您的php.ini确实看起来像您发布的内容,则必须取消对zend_extension的注释(即,删除'"),因此实际上已加载Xdebug.

If your php.ini really looks like what you posted, you have to un-comment the zend_extension line (i.e. remove the ';' at its begninning), so Xdebug is actually loaded.

然后,确保已加载Xdebug,并从PHP文件(请确定)中调用phpinfo().

Then, make sure Xdebug is loaded, calling phpinfo() from a PHP file (just to be sure).

那之后:我想应该有一些选项可以在netbeans中配置调试器?如果是这样,netbeans是否正在侦听端口9000? (您在php.ini中配置的那个)

After that : I suppose there should be some options to configure the debugger in netbeans ? If so, is netbeans listening on port 9000 ? (The one you configured in php.ini)