NetBeans 11.3正在等待连接到Xdebug

aurhwmvo  于 2022-11-10  发布在  其他
关注(0)|答案(1)|浏览(166)

我使用的是Windows 10、NetBeans 11.3、PHP7.4.9、Apache/2.4.46(Win 64)、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)”上,同时完全显示页面,而不会在断点处停止。

ujv3wf0j

ujv3wf0j1#

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.

相关问题