Skip to content
This repository has been archived by the owner on Dec 1, 2018. It is now read-only.

Latest commit

 

History

History
81 lines (57 loc) · 2.31 KB

xdebug.md

File metadata and controls

81 lines (57 loc) · 2.31 KB

Debugging with DDE, Xdebug and PhpStorm

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.

Prerequisites

Setup

  1. Set environment variable on the cli service

    cli:
      ...
      environment:
        - XDEBUG_ENABLED=1
      ...
  2. Update container configuration with dsh up

  3. Open your project in PHPStorm

  4. Set a breakpoint wherever you like

  5. Click on the Start Listening for PHP Debug Connections button in PHPStorm

  6. Click on Debug in Xdebug Helper in Chrome

  7. Click on Accept in the Incoming Connection From Xdebug dialogue in PHPStorm

Happy debugging!

Setup for console php

  1. Set environment variable on the cli service

    cli:
      ...
      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
      ...
      ...
  2. Update container configuration with dsh up

  3. 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.

Resources