This document contains basic information how you can use Xdebug and PhpStorm within this application.
And before you start with this section off documentation you really should read PhpStorm configuration documentation first - that way you will have all basic configuration ready.
These instructions relies heavily to screenshots, so you might need to use your own brains for some parts of these instructions - but I bet you can get this working in couple of minutes.
Note that if you're using Mac, read Mac users section first.
- Make sure that Xdebug port is
9009
- Validate debugger configuration
- Install needed browser extensions
You can check all those within screen as below:
Note that validation screen should look like image below:
Create Run/Debug Configuration like in image below:
After you have make sure that all basic things are configured properly you can start to listen incoming PHP debug connections. After this you need to do following:
- Add breakpoint to your code
- Enable Xdebug in your browser
- Reload browser page
After that you should see following:
And in this screen select the correct index.php
file.
Last step is to configure used paths on debugging server to match with your local paths. See the image below:
Mac users need to create a docker-compose.override.yml
file with following
content:
version: '3'
services:
php:
environment:
- DOCKER_WITH_MAC=1
And if you're reading this you might want to read Speed problems with docker-compose? document, which will tell you how to speed your Mac environment quite lot.
You just need to combine those both configurations to your local
docker-compose.override.yml
file
By default this application assumes that you're using app.localhost
as your
PHP server that you've configured to your IDE. If you need to change that, just
override that in your local docker-compose.override.yml
file.
See those External links / resources on this documentation to get more information.
If you're using Postman to test / debug your
application you need to add ?XDEBUG_SESSION_START=PHPSTORM
to each URL
that you use with Postman.
- Debugging PHP (web and cli) with Xdebug using Docker and PHPStorm
- Debug your PHP in Docker with Intellij/PHPStorm and Xdebug
- Debugging with Postman and PHPStorm (Xdebug)
Happy debugging \o/ - it has not ever be as easy as this...