

Fortunately we can extend the generated docker-compose file by adding extra files in the.

Path to composer.json - absolute path on your local machine.You don’t need to map the web root or vendor dir since you’re mapping the entire project.Map the root of your project on your local machine to the absolute path on the docker container, e.g.

Host: - must match the domain name of your drupal site.Uncheck Force break at first line when no path mapping specified - we’ll discuss this later when we start debugging Kernel tests.This setting allows us to listen on multiple ports. Note that xdebug 3 uses 9003 by default whereas xdebug 2 uses 9000. This should be set for you automatically.

Lifecycle: Connect to existing container (‘docker compose -exec’).Add the environment variable COMPOSE_PROJECT_NAME=ddev-drupal (where drupal is the ddev project name in.Choose the full docker compose file generated by ddev found at.From the add dropdown choose From Docker, Vagrant, VM, WSL, Remote….Before we start let’s run ddev xdebug on to ensure the PHP extension is enabled. You can refer to the video above for an explanation of why some of these are needed.Īll of these settings are found under the PHP section of the PHPStorm settings dialog. In this section I’ll share the final configuration I’m using. You may be able to achieve the same result with an alternative docker-compose environment, but I'm using DDev here since it mostly works out of the box. You can also checkout the ddev-phpunit-demo repo if you want to try it out yourself with DDev and PHPUnit pre-configured. Drupal Test Traits / Selenium2DriverTests.Have a look at the video below that demonstrates how to configure everything you need to run and debug:
