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.
Configuration and usage ᐞ
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.
PhpStorm basic configuration ᐞ
- Make sure that Xdebug port is
9003
- 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:
First connection ᐞ
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.
Configuring debugging server ᐞ
Last step is to configure used paths on debugging server to match with your local paths. See the image below:
Debug CLI commands ᐞ
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 compose.override.yaml
file.
See those External links / resources on this documentation to get more information.
Debug Postman requests ᐞ
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.
External links / resources ᐞ
- 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)
Closure ᐞ
Happy debugging \o/ - it has not ever be as easy as this...