To be able to debug using xdebug, set PHP_XDEBUG
to true
in .env
. If you have previously already build the images without xdebug enabled make sure to rebuild both workspace and php-fpm by running docker-compose build php-fpm workspace
.
- Create a server in
File | Settings | Languages & Frameworks | PHP | Servers
. - Make sure the server name matches to value
XDEBUG_SERVER_NAME
in the docker .env file. - Hostname and port should be set to wherever the application is being served from, by default
localhost:80
- Map the local project directory to the absolute working path within the container, by default
/app
. - Set a breakpoint in your source code and start listening for a debug connection.
- Happy debugging.
- Make sure you have the PHP Debug extension installed.
- Create a debug profile containing the correct path mapping. Do so by adding
"/app": "${workspaceFolder}"
to yourpathMappings
. - Optionally, set
hostname
to0.0.0.0
to listen on IPv4 interfaces. Php Debug listens by default on IPv6 by default (if available) for some wierd reason. - Set a breakpoint in your source code and start listening for a debug connection.
- Happy debugging.