1

我正在使用 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 中运行“调试”,就会永远出现“等待连接”。

我需要做什么?

编辑:固定到本地主机

4

2 回答 2

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                     "..."
于 2012-05-25T13:14:12.770 回答
0

这是错误的:

php_value   xdebug.remote_host   "sub.mydomain.com"

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

于 2012-05-22T08:07:58.570 回答