Level 75
Nov 15, 2025
1
Level 1
Xdebug not running on Sail
Hi, I can't get xdebug working on Sail. I've followed the steps in the Laravel Sail docs and also tried this article https://iwasherefirst2.medium.com/how-to-set-up-xdebug-with-laravel-sail-a-complete-guide-98d6498b382a
My launch.json is
{
"version": "0.2.0",
"configurations": [
{
"name": "Listen for Xdebug (Sail)",
"type": "php",
"request": "launch",
"port": 9003,
"pathMappings": {
"/var/www/html": "${workspaceFolder}"
},
"log": true,
"hostname": "localhost"
},
{
"name": "Launch currently open script",
"type": "php",
"request": "launch",
"program": "${file}",
"cwd": "${fileDirname}",
"port": 0,
"runtimeArgs": [
"-dxdebug.start_with_request=yes"
],
"env": {
"XDEBUG_MODE": "debug,develop",
"XDEBUG_CONFIG": "client_port=${port}"
}
}
]
}
I'm running Laravel 12 and VSCode on Linux. I have other projects that run non-Sail docker setups with xdebug working, but for some reason I'm doing something wrong with Sail.
Am I missing anything? Thanks.
Please or to participate in this conversation.