Make sure you associate it with the previously created "server" definition. On the top right, click on "edit configurations":Ĭlick in the green "plus" sign at the top left and select "PHP Remote Debug" from the list. In my case its "/var/The last part is to configure the remote debugger of your project. In the "Project files" section you have to map the root path of your application to the path inside the container. The "host" and "port" is how will access your application. It should match the value you have defined in your "PHP_IDE_CONFIG" environment variable.
Go to File -> Settings -> Languages and Frameworks -> PHP -> Servers This is how PHPStorm will map the file paths in your local system to the ones in your container. Make sure you have the some port that you have configured previously in "XDEBUG_CONFIG" environment variable: In PHPStorm, go to File -> Settings -> Languages and Frameworks -> PHP > Debug. The first thing you should do is to check your Debug settings. Next lets dig into PHPStorm configurations. We will add them to our ".env" file like this: These two settings allow PHPStorm and Xdebug to communicate. The "remote_port" is the port that PHPStorm will be listening for incoming Xdebug connections. The "remote host" is the private ip of your host machine (the one your PHPStorm is running).
I wont enter in detail about how to Dockerize a Symfony application. The way to do this, will depend of your base image.
Of course, to be able to use Xdebug you must install it on your Docker container.