wp-local-docker-v2 icon indicating copy to clipboard operation
wp-local-docker-v2 copied to clipboard

Xdebug Not Working with Windows 10, WSL and VS Code

Open jg314 opened this issue 2 years ago • 35 comments

Describe the bug I just started using WP Local Docker, so thank you so much for developing such a great resource. Since I'm not super familiar with Linux and Docker, it's taking me some time to get up to speed. The good news is that I've got most things configured at this point. The only item I can't figure out is Xdebug.

When I try to run debugging using VS Code, breakpoints don't work and I get this message in debug.log on every page load:

Xdebug: [Step Debug] Could not connect to debugging client. Tried: 10.0.128.3:9003 (from HTTP_X_FORWARDED_FOR HTTP header), host.docker.internal:9003 (fallback through xdebug.client_host/xdebug.client_port) :-(

I've used Xdebug a lot in the past, so I'm pretty confident I know how to use it generally, but I can't seem to get it working with Windows 10, WSL and Docker. Can you give me any advice?

Thanks a ton.

Environment information

  • Device: Acer Laptop
  • OS: Windows 10 with WSL
  • Docker Desktop version: 4.5.1
  • Browser and version: Chrome v99.0.4844.51
  • WordPress version: 5.9.2

jg314 avatar Mar 20 '22 18:03 jg314