This is a tiny demo project for presenting how to debug your PHP code in VSCode with Docker and XDebug
-
Install PHP Debug extension from Felix Becker (search: felixfbecker.php-debug)
-
Copy docker-compose.override.yml.dev to docker-compose.override.yml
cp docker-compose.override.yml.dev docker-compose.override.yml
Change what you need. For example: change host port, change XDebug settings etc.
- Build and run your containers
docker-compose build
docker-compose up -d
-
Run "Listen for XDebug" task on debugger tab.
-
Load minimal application page in the browser or run minimal application in the cli with the following command:
docker-compose exec web php index.php
- Debug