2012-05-21 35 views
1

我正在使用Netbeans来调试PHP。我没有获得php.ini所以我用.htaccessxdebug - 在netbeans中等待连接

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我以前使用的Eclipse Xdebug的这台服务器上。

与上述设置安装在一起的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中运行“调试”,永远会出现“等待连接”。

我该怎么办?

编辑:固定为localhost

回答

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      "..." 
0

这是错误的:

php_value xdebug.remote_host "sub.mydomain.com" 

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

+0

感谢您的回答。我编辑了'remote_host'到我的IP 192.168.1.149的IDE,但它仍然不起作用。 – Patrick

+0

远程调试日志中显示了什么(请参阅http://xdebug.org/docs/all_settings#remote_log关于如何创建一个) – Derick

+0

感谢您的msg。该文件一直是空的。路径是正确的,并且chmod 777.我还能检查什么来找到原因? – Patrick