Windows 7 "waiting for connection" WAMP 上的 Netbeans Xdebug

Netbeans Xdebug on Windows 7 "waiting for connection" WAMP

我阅读了很多针对此常见 Xdebug 错误的解决方案,但似乎并没有解决我的问题:

netbeans shows “Waiting For Connection (netbeans-xdebug)”

Netbeans not connecting with xdebug on Wamp : “showing waiting for connection”

in phpinfo() Xdebug 似乎配置正确:

下面是我的 php.ini:

zend_extension = "c:/wamp/bin/php/php5.5.12/zend_ext/php_xdebug-2.2.5

-5.5-vc11-x86_64.dll"
;
[xdebug]

xdebug.remote_enable=1
xdebug.remote_mode = req
xdebug.remote_handler=dbgp
xdebug.remote_host=127.0.0.1
xdebug.remote_port=9001

xdebug.profiler_enable = off
xdebug.profiler_enable_trigger = off
xdebug.profiler_output_name = cachegrind.out.%t.%p
xdebug.profiler_output_dir = "c:/wamp/tmp"
xdebug.show_local_vars=0
xdebug.idekey=netbeans-xdebug

Netbeans:

试过禁用防火墙似乎没有帮助。 运行 不知道我的 Xdebug.

是怎么回事

开始调试后,在命令提示符中检查 netbeans 是否正在侦听端口 9001:

C:\Users\***> netstat -ano | findstr 9001

  TCP    0.0.0.0:9001           0.0.0.0:0              LISTENING       20928
  TCP    [::]:9001              [::]:0                 LISTENING       20928

最后的PID(在我的例子中是20928)应该属于netbeans,这可以从Windows任务管理器中验证(添加pid后:查看> select列 > pid)

如果PID不对或者端口不起来,重启netbeans或者重启系统就可以了

如果 netbeans 有 9001 端口,这意味着您的浏览器没有侦听或连接到 netbeans。有时浏览器无法建立连接或无法正常启动。

为了手动尝试连接,您需要按下 netbeans 中的调试按钮,并在下一分钟左右(在超时之前)在您喜欢的浏览器中打开以下 url(尝试不同的浏览器(如果失败)

localhost/<yoursite>/page/?XDEBUG_SESSION_START=netbeans-xdebug

您也可以尝试在 netbeans 项目属性中切换到嵌入式浏览器。

您也可以尝试将端口从 9001 更改为其他端口,例如两端均为 9002,如果其他程序试图连接到端口 9001 或试图侦听此端口,这会有所帮助。

设置

zend_extension = "c:/wamp/bin/php/php5.5.12/zend_ext/php_xdebug-2.2.5 -5.5-vc11-x86_64.dll";

[xdebug] 部分内,不在外部。
从末尾删除 ;

错误:

zend_extension = "c:/wamp/bin/php/php5.5.12/zend_ext/php_xdebug-2.2.5-5.5-vc11-x86_64.dll";
[xdebug]
xdebug.remote_enable=1
.....

对:

[xdebug]
zend_extension = "c:/wamp/bin/php/php5.5.12/zend_ext/php_xdebug-2.2.5-5.5-vc11-x86_64.dll"
xdebug.remote_enable=1
.....

也试试

zend_extension_ts="c:/.../php_xdebug-2.2.5-5.5-vc11-x86_64.dll"

取代了

zend_extension="c:/.../php_xdebug-2.2.5-5.5-vc11-x86_64.dll"

最后,管理 Xdebug 开始工作 article,我需要做的另一件事是当 netbeans 显示 "waiting for connection" 消息时。我需要在浏览器中手动打开页面(netbeans 不打开弹出窗口本身),将 index.php?"XDEBUG_SESSION_START=netbeans-xdebug" 添加到 URL 并刷新页面,然后 netbeans Xdebug 状态更改为 运行 对离开:)

非常感谢你们的宝贵帮助!!!!