等待连接(netbeans-xdebug)


Waiting for connection(netbeans-xdebug)

我正在尝试在 NetBeans 中调试我的 PHP 代码。 代码运行良好,但我无法调试它(不会在断点处停止),并且代码正常运行。

我已经尝试了所有可能的解决方法,以使我的xDebug正常工作,并且从过去几天开始一直卡住..任何可以帮助我解决这个问题的人。

.ini文件中的 xdebug 配置:

zend_extension = /usr/lib/php5/20090626/xdebug.so
xdebug.remote_enable=1
xdebug.remote_handler=dbgp
xdebug.remote_mode=req
xdebug.remote_host=mgiplocalhost
xdebug.remote_port=9000

在这里,mgiplocalhost是我的虚拟主机。我已经尝试了其他可能性以及本地主机和IP地址,但等待连接仍然存在。

在 netbeans->tools->options->debugging 中,当我将端口设置为 9000 并进行调试时,它会要求我更改端口,因为端口 9000 已在使用中。 我已经更改了端口,但问题仍然存在。

我需要帮助尽快解决,请帮助我。

有点晚了,但认为这应该有一个答案!为了使 Xdebug 正常工作,我在 php.ini 文件中找到的最小配置是加载扩展的行:

zend_extension=php_xdebug.dll(指向从 Xdebug 站点下载的 dll)

以下 Xdebug 设置也放在 php.ini 文件中的更下方:

[Xdebug]
xdebug.remote_autostart=On
xdebug.remote_enable=On
xdebug.idekey="netbeans-xdebug"

Xdebug 的默认端口是 9000,这也是 Netbeans 使用的端口(Tools -> Options... -> PHP -> Debugging)。如果正在使用 9000,您还可以在 Netbeans 中将其设置为 9001,并在 php.ini 文件中将行xdebug.remote_port=9001与其他 xdebug 设置一起添加

然后在重新启动服务器后尝试一下。