【问题标题】:Time-out connecting Xdebug in VSCode在 VSCode 中连接 Xdebug 超时
【发布时间】:2021-03-18 21:02:20
【问题描述】:

我在尝试在 VSCode 中调试一些 Laravel 代码时遇到此错误:

Xdebug: [Step Debug] Time-out connecting to debugging client, waited: 200 ms. Tried: localhost:9000 (through xdebug.client_host/xdebug.client_port) :-(

我尝试了不同的端口,但没有改变!

php.ini 配置:

xdebug.mode = debug
xdebug.start_with_request = yes
xdebug.client_port = 9000

launch.json 配置:

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Listen for XDebug",
            "type": "php",
            "request": "launch",
            "port": 9000
        },
        {
            "name": "Launch currently open script",
            "type": "php",
            "request": "launch",
            "program": "${file}",
            "cwd": "${fileDirname}",
            "port": 9000
        },
        {
            "name": "Listen for XDebug on Homestead",
            "type": "php",
            "request": "launch",
            "pathMappings": {
                "/home/vagrant/Code/tighten-app-homestead": "/Users/jose/Code/tighten-app-homestead"
            },
            "port": 9000
        }
    ]
}

另外,我使用的是 Windows,而不是 Linux!

【问题讨论】:

  • 不是错误,只是提示。显然你的 IDE 没有监听...将“start_with_request”更改为“no”,或者开始监听调试请求...

标签: php laravel xdebug


【解决方案1】:

在使用创建者 Derick 的答案修复 WordPress 中的调试设置后,我也在寻找解决方案。

然后我测试了 Laravel 并遇到了您所面临的确切错误。然后,仔细查看设置,意识到我们需要使用port: 9003 而不是9000

签出:https://xdebug.org/docs/upgrade_guide#Step-Debugging

解决方案:

更改端口

"port": 9000

"port": 9003

另外,你可以在Xdebug shows method doesn't exist message阅读我的问题和答案

【讨论】:

    猜你喜欢
    • 2019-12-13
    • 1970-01-01
    • 2019-06-23
    • 1970-01-01
    • 2019-09-29
    • 2021-07-31
    • 2023-02-05
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多