For this setup, I'm using PHP 7 FPM and Nginx
Also created a xdebug.ini, php.ini and vhost.conf as separated setup files, that are copy for volumes by docker compose.
- Docker image is just an example. You can use any other image, but should have xdebug extension.
- As Docker image, Docker yml is an example. If using Mac, port on docker compose have be mapped, on Linux, should skipe this step. You must have a separated xdeubg.ini file, setted up like this example. Pointed port on this file, must be the same on all port setup, steps.
- On xdebug.ini file change remote_host parameter, with your local machine ip address
- Apply all PhpStorm session settings, like screeshots.
- On PhpStorm Server Session, you are asked to point Host, this parameter must be the same as your nginx vhost, server name.
- Take the index file of you project (or the first running one) and place a breakpoint there.
- Start listening for php Connections on PhpStorm (there is a button besides VCS ones, to start listening, it's gonna be green on click)
- Back to your browser and refresh. On first launch, PhpStorm will ask you for script map, point your index file.