NetBeans 11.3 等待连接到 Xdebug

发布于 2025-01-09 13:59:10 字数 968 浏览 5 评论 0原文

我使用的是 Windows 10、NetBeans 11.3、PHP7.4.9、Apache/2.4.46 (Win64)、XAMPP v3.2.4 和 MySQL。

我的 php.ini 文件具有以下设置:

output_buffering=off

[XDebug]

zend_extension = "c:\xampp\php\ext\php_xdebug-2.9.7-7.4-vc15-x86_64.dll"
xdebug.remote_autostart = 1
xdebug.profiler_append = 0
xdebug.profiler_enable = 0
xdebug.profiler_enable_trigger = 0
xdebug.profiler_output_dir = "c:\xampp\tmp"
xdebug.remote_enable = 1
xdebug.idekey="netbeans-xdebug"
xdebug.remote_handler = "dbgp"
xdebug.remote_host = "localhost:81"
xdebug.remote_log = "c:\xampp\tmp\xdebug.txt"
xdebug.remote_port = 9000
xdebug.trace_output_dir = "c:\xampp\tmp"
xdebug.remote_cookie_expire_time = 36000

NetBeans 配置:

Debugger port: 9000
Session ID: netbeans-xdebug
Stop at first line: Checked
All other options are unchecked

当我单击调试图标 (Ctrl + F5) 时,它会卡在“等待连接 (netbeans-xdebug)”上,同时完全显示页面无需在断点处停止。

I am using Windows 10, NetBeans 11.3, PHP7.4.9, Apache/2.4.46 (Win64), XAMPP v3.2.4 and MySQL.

My php.ini file has the following settings:

output_buffering=off

[XDebug]

zend_extension = "c:\xampp\php\ext\php_xdebug-2.9.7-7.4-vc15-x86_64.dll"
xdebug.remote_autostart = 1
xdebug.profiler_append = 0
xdebug.profiler_enable = 0
xdebug.profiler_enable_trigger = 0
xdebug.profiler_output_dir = "c:\xampp\tmp"
xdebug.remote_enable = 1
xdebug.idekey="netbeans-xdebug"
xdebug.remote_handler = "dbgp"
xdebug.remote_host = "localhost:81"
xdebug.remote_log = "c:\xampp\tmp\xdebug.txt"
xdebug.remote_port = 9000
xdebug.trace_output_dir = "c:\xampp\tmp"
xdebug.remote_cookie_expire_time = 36000

NetBeans configuration:

Debugger port: 9000
Session ID: netbeans-xdebug
Stop at first line: Checked
All other options are unchecked

When I click on debugging icon (Ctrl + F5) it gets stuck on "waiting for connection (netbeans-xdebug)" while shows the page completely without stopping at the break points.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

百合的盛世恋 2025-01-16 13:59:10

xdebug.remote_host = "localhost:81" 肯定不正确。 remote_host 应具有运行 IDE 的 IP 地址或主机名的值。这可能只是localhost

您还应该升级到 Xdebug 3.1,它具有更好的日志记录功能,可以通过它的 xdebug_info 排除连接错误() 函数,以及 xdebug.logxdebug.log_level 设置。

但请务必参阅升级指南,因为某些设置名称已更改。您可能只需要:

zend_extension = "c:\xampp\php\ext\php_xdebug-3.1.3-7.4-vc15-x86_64.dll"
xdebug.mode=develop,debug       # replacement for xdebug.remote_enable
xdebug.start_with_request=1     # replacement for xdebug.remote_autostart
xdebug.idekey="netbeans-xdebug"
xdebug.client_port = 9000       # replacement for xdebug.remote_port
                                # I would recommend to use the default 9003,
                                # but you need to update Netbeans config to
                                # say the same too.

xdebug.remote_host = "localhost:81" is certainly not correct. The remote_host should have the value of the IP address or hostname where your IDE runs. This is likely just localhost.

You should also upgrade to Xdebug 3.1, which has much better logging functionality for troubleshooting connection errors through it's xdebug_info() function, and xdebug.log and xdebug.log_level settings.

Please do refer to the upgrade guide though, as some setting names have changed. You would likely only need:

zend_extension = "c:\xampp\php\ext\php_xdebug-3.1.3-7.4-vc15-x86_64.dll"
xdebug.mode=develop,debug       # replacement for xdebug.remote_enable
xdebug.start_with_request=1     # replacement for xdebug.remote_autostart
xdebug.idekey="netbeans-xdebug"
xdebug.client_port = 9000       # replacement for xdebug.remote_port
                                # I would recommend to use the default 9003,
                                # but you need to update Netbeans config to
                                # say the same too.
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文