xdebug - 等待netbeans中的连接

时间:2012-05-21 12:03:57

标签: netbeans port xdebug

我正在使用Netbeans来调试PHP。我无法访问php.ini,因此我使用.htaccess

php_value   xdebug.remote_host   "localhost"    
php_value   xdebug.idekey               "netbeans-xdebug"
php_flag    xdebug.remote_autostart       Off
php_flag    xdebug.remote_enable          On
php_value   xdebug.remote_port            9000
php_value   xdebug.remote_handler         dbgp
php_flag    xdebug.profiler_enable        on
php_flag    xdebug.remote_connect_back    On
php_flag    xdebug.extended_info          On

sub.mydomain.com使用端口8080和8090运行。我以前在此服务器上使用了xdebug和Eclipse。

sub.mydomain.com服务器的phpinfo()列出了与上述设置一起安装的xdebug:

Zend Engine v2.3.0, Copyright (c) 1998-2011 Zend Technologies
with Xdebug v2.1.3, Copyright (c) 2002-2012, by Derick Rethans

在Netbeans中,我已配置“属性”和“运行配置”条目,端口和ID也匹配(9000,netbeans-xdebug)。

sub.mydomain.com上有很多开发人员,如果有人使用端口9000,这可能是个问题吗?

如果我在Netbeans中运行“debug”,那么“永远等待连接”。

我该怎么做?

编辑:修复为localhost

2 个答案:

答案 0 :(得分:1)

我已设法使用以下配置启动调试器:

php_value   xdebug.remote_host   "192.168.1.149"
php_value   error_reporting               22527
php_flag    xdebug.remote_autostart       Off
php_flag    xdebug.remote_enable          On
php_value   xdebug.remote_port            9009
php_value   xdebug.remote_handler         dbgp
php_value   xdebug.remote_log             "..."
php_flag    xdebug.profiler_enable        off
php_flag    xdebug.extended_info          On
php_flag    xdebug.coverage_enable        On
php_value   error_log                     "..."

答案 1 :(得分:0)

这是错误的:

php_value   xdebug.remote_host   "sub.mydomain.com"

xdebug.remote_host设置需要包含其上包含 IDE 的计算机的IP。这当然也意味着运行PHP / Xdebug的机器需要能够连接到该IP地址。这也记录在http://xdebug.org/docs/remote#communication

相关问题