xdebug
extension is disabled by default as it causes about 20% performance hit.
There two variants: you can use xdebug for debuging requests from browser or you can debug requests from console (for example Drush commands).
For configuration first variant use Prerequisites and Setup.
For configuration second variant use Setup for console php.
-
Xdebug Helper extension for Chrome
You can also pick from the list of options for other browsers
-
Set environment variable on the
cli
servicecli: ... environment: - XDEBUG_ENABLED=1 ...
-
Update container configuration with
dsh up
-
Open your project in PHPStorm
-
Set a breakpoint wherever you like
-
Click on the Start Listening for PHP Debug Connections button in PHPStorm
-
Click on Debug in Xdebug Helper in Chrome
-
Click on Accept in the Incoming Connection From Xdebug dialogue in PHPStorm
Happy debugging!
-
Set environment variable on the
cli
servicecli: ... environment: - XDEBUG_ENABLED=1 - XDEBUG_CONFIG=idekey=PHPSTORM remote_host=192.168.10.1 - PHP_IDE_CONFIG=serverName=drupal7.drude ...
You need to replace drupal7.drude with your domain. You can find it in
web
section:web: ... environment: - VIRTUAL_HOST=drupal7.drude ... ...
-
Update container configuration with
dsh up
-
You can run your scripts from console and debug it in the same way as requests from browser.
For example you can run drush command:
```bash
dsh drush fra -y
```
and debug this drush command from feature module.