@smiffy see the solution part of this discussion it may help you.
https://stackoverflow.com/questions/71203601/xdebugtime-out-connecting-to-debugging-client
First time using Sail for development and all went smoothly. However I am now looking to get XDebug working but this is causing me issues. My Sail output reports:
laravel.test_1 | [Tue May 31 09:31:20 2022] Xdebug: [Step Debug] Time-out connecting to debugging client, waited: 200 ms. Tried: host.docker.internal:9003 (through xdebug.client_host/xdebug.client_port) :-(
According to the docs for Sail, my setup should be quite minimal, The only entry I have added to .env is: SAIL_XDEBUG_MODE=develop,debug. The docs state that I should be fine not specifying SAIL_XDEBUG_CONFIG as my system is using the minimum requirements to use host.docker.internal:
$: docker -v
Docker version 20.10.14, build a224086
$: docker-compose -v
docker-compose version 1.27.4, build unknown
Even if SAIL_XDEBUG_CONFIG="client_host=host.docker.internal" is added, this still results in the same behaviour.
My IDE is VSCode. For completeness, this is my config for the debugger in launch.json:
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Listen for Sail Xdebug",
"type": "php",
"request": "launch",
"port": 9003,
"pathMappings": {
"/var/www/html": "${workspaceFolder}"
},
"hostname": "localhost",
"ignore": ["**/vendor/**/*.php"],
"xdebugSettings": {
"max_data": 65536,
"show_hidden": 1,
"max_children": 100,
"max_depth": 3
}
},
]
}
Any suggestions?
Took me a while to find this but it was a firewall issue. I had to open up port 9003 to allow traffic from the container to the host. Hopefully this helps someone as it threw me for a while...!
Please or to participate in this conversation.