Debugging Drupal Code¶
Add a PHP Server¶
First, you have to set up a Drupal environment with the tool l3d. The tool is based on Docker containers.
Now navigate to File->Settings in your IDE and create a server:
Set the following values:
Important: Always use Docker as name of your server.
Do not forget to add the file mapping to /var/www/html
.
Add a new Run/Debug Configuration¶
First create a new PHP Web Page
configuration:
Set the following values:
Select the server you just have created.
Important: Always use Docker as name of your configuration.
Start Debugging¶
First, check the debug settings in your IDE. It should look something like this:
Now activate the Phone
icon in your IDE:
Now you can set your breakpoints and enjoy debugging Drupal code.