To get the project up and working, do these things:
- Set up PhpStorm
- Create a
.env
file with the following content:XDEBUG_MODE=debug
- Set a breakpoint in the
index.php
file - Enable xDebug connection listening in PhpStorm
- If you are using Windows or macOS, remove
extra_hosts
fromdocker-compose.yml
- Run the
docker-compose up -d
command. We don't need to start services, but we need to create a network. The next command will not work without it. - Run the
docker-compose run --rm php php index.php
command. Before the first launch, the container image will be built, this will take a few minutes. - Voila, script execution is stopped at your breakpoint!
Full description is available in the blog post.