This document describing how you can use Xdebug and PhpStorm for the DEV environment.
Please follow PhpStorm documentation before actions described below.
1.Check /docker/dev/xdebug-main.ini or /docker/dev/xdebug-osx.ini (optional)
- Set option in case you need to debug every request to an api (by default):
xdebug.start_with_request = yes- Set option in case you need to debug only requests with IDE KEY: PHPSTORM from frontend in your browser:
xdebug.start_with_request = no2.Go to Settings -> Php -> Debug and set Xdebug port 10000
3.Check your Run/Debug Configurations as on image below:
4.Install browser extensions (optional, see step 1). For example, for Firefox, install extension "Xdebug helper" and set in extension settings IDE KEY: PHPSTORM
After actions above, you can start listening for incoming PHP debug connections:
- Add breakpoint to your code
- Enable Xdebug in your browser (optional, required only when xdebug.start_with_request = no)
- Click
Debugbutton in PhpStorm - Reload page in the browser
If everything configured properly, you will get something like next:
If you're using Postman to test/debug your application, when xdebug.start_with_request = no, you need to add ?XDEBUG_SESSION_START=PHPSTORM to each URL that you use with Postman.
If you have default configuration (xdebug.start_with_request = yes) - nothing to do and your Xdebug should work out of the box.
If you want to debug console commands, you need to uncomment/edit (nothing to do in case MacOS and XDEBUG_CONFIG=osx) option xdebug.client_host inside config docker/dev/xdebug-main.ini:
xdebug.client_host=172.17.0.1Just find out the proper host ip in your docker bridge configuration and set above option (in general it is 172.17.0.1).
Don't forget to rebuild docker containers according to general documentation.


