I can't get WSL 2 Ubuntu + xdebug + VSC to work #734
-
Hi, for the first time using Warden I have some problems with xdebug setup. Environment: .env
.vscode/launch.json {
"version": "0.2.0",
"configurations": [
{
"name": "Listen for Xdebug",
"type": "php",
"request": "launch",
"port": 9000,
"pathMappings": {
"/var/www/html": "${workspaceRoot}"
}
}
]
} I have been using Warden on macOS and Ubuntu and I have never had any issues with xdebug configuration. This time I had to use Windows and I ran out of ideas. No matter what I do, I can't stop at any breakpoint. In VSC I connect to WSL with WSL extension. I have PHP Debug installed on WSL. When I press "Listen for Xdebug" button, I can see port 9000 being used both on WSL and host. I also tried it without WSL extension with no effect. Earlier I played with ports and firewall settings, no effect too. I wonder if it's something wrong with pathMappings, but it's only a thought. I would be grateful if you have any ideas |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
I just found out I had to add "hostname": "localhost" in .vscode/launch.json, so it should look like this:
Everything works fine now |
Beta Was this translation helpful? Give feedback.
I just found out I had to add "hostname": "localhost" in .vscode/launch.json, so it should look like this:
Everything works fine now