Skip to content

Instantly share code, notes, and snippets.

@vicentimartins
Last active November 26, 2020 20:30
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save vicentimartins/37c9ab3ab6f7af5b3f653d7ebae14910 to your computer and use it in GitHub Desktop.
Save vicentimartins/37c9ab3ab6f7af5b3f653d7ebae14910 to your computer and use it in GitHub Desktop.
Xdebug on VSCode using docker
version; '3.7'
services:
php:
volumes:
- ...
other_settings:
- ...
enviroment:
...
XDEBUG_CONFIG: remote_host=host.docker.internal remote_port=9000 remote_enable=1 remote_connect_back=1
other_service:
...
{
"version": "0.2.0",
"configurations": [
{
"name": "Listen for XDebug",
"type": "php",
"request": "launch",
"port": 9000,
"log": true,
"stopOnEntry": true,
"pathMappings": {
"/application": "${workspaceRoot}"
}
}
]
}
@vicentimartins
Copy link
Author

Some notes:

  • You need to use the same php-fpm port exposed at Dockerfile
  • At launch.json, stopOnEntry will stop request execution but you'll access and check your breakpoints
  • At launch.json, patchMappings should follow server_path to local_path order

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment