Xdebug ¶
Xdebug can be used to set breakpoints and interactively step through requests, tests, commands, or jobs.
Listen with debugger ¶
With an IDE supporting XDebug, get it listening on port 5089
. Processes within Docker containers will not be able to reach your debugger port if it is only listening on 127.0.0.1
, so make sure it is bound to 0.0.0.0
(all IPs) or any IP that will route to your workstation from inside the container (like a LAN or VPN IP).
Your debugger must also be configured to map the working tree on your workstation to the /srv/app
path inside the container.
Users of Visual Studio Code can just make use of the launch config defined under /.vscode/launch.json
that is ready for use with the project. Review its contents for the settings to use with any other IDE.
Install and enable PHP extension ¶
Xdebug must be installed and enabled once per container instance:
docker-compose exec app enable-xdebug