简体   繁体   English

在 VSCode 中连接 Xdebug 超时

[英]Time-out connecting Xdebug in VSCode

I'm getting this error while I'm trying to debug some Laravel code in VSCode:我在尝试在 VSCode 中调试一些 Laravel 代码时遇到此错误:

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

I have tried different ports but no change !我尝试了不同的端口,但没有改变!

php.ini configuration: php.ini 配置:

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

launch.json configuration: 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
        }
    ]
}

Also, I'm on Windows, not Linux!另外,我使用的是 Windows,而不是 Linux!

I was also searching for solutions after I fixed the debugging setting in WordPress using the answers by creator Derick.在使用创建者 Derick 的答案修复 WordPress 中的调试设置后,我也在寻找解决方案。

Then I tested for Laravel and was facing the exact error you were facing.然后我测试了 Laravel 并面临着你所面临的确切错误。 Then, looking closely at the setting, realized that we need to use port: 9003 instead of 9000然后,仔细查看设置,意识到我们需要使用port: 9003而不是9000

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

Solution:解决方案:

Change the port更改端口

"port": 9000

To

"port": 9003

Also, you can read my questions and answers at Xdebug shows method doesn't exist message此外,您可以在Xdebug 显示方法不存在消息中阅读我的问题和答案

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM