为drupal站点设置Xdebug

时间:2011-09-05 04:31:57

标签: php drupal netbeans drupal-modules xdebug

我一直试图让xdebug,netbeabs 7.0和drupal工作无济于事。 drupal站点在xyz.com:8081上远程托管。设置端口转发以将端口9000转发到该网络中的主机。 xdebug已安装并正确显示在phpinfo()中,但我的netbeans说"等待连接(netbeans-xdebug)"。以下是我在php.ini中的内容

zend_extension="/usr/lib/php5/20090626+lfs/xdebug.so"
xdebug.remote_connect_back=1
xdebug.remote_host=localhost
xdebug.remote_port=9000
xdebug.remote_handler=dbgp

我也读了一些我必须在/etc/php5/cli/conf.d/xdebug.ini中有相同内容的地方,我也试过了。我尝试将localhost更改为xyz.com并且没有&# 39;工作。 我还需要知道netbeans中的项目配置应该是什么。例如xyz:8081 / drupal?

谢谢大家,

1 个答案:

答案 0 :(得分:1)

Xdebug需要在指定的端口上连接回工作站。尝试这样的事情。关键是服务器将连接回您的工作站,因此如果您在防火墙后面,那么您需要将9000端口转发到运行netbeans的工作站。

xdebug.remote_enable=1
xdebug.remote_mode=req
xdebug.remote_port=9000
xdebug.idekey=NETBEANS_DBGP
xdebug.remote_handler=dbgp
xdebug.remote_host=IP_OF_YOUR_WORKSTATON

其中一些设置在此处有更详细的描述:http://www.flingbits.com/tutorial/view/xdebug-for-developing-debugging-and-profiling-php

此处还有netbeans特定的设置信息:http://wiki.netbeans.org/HowToConfigureXDebug

相关问题