The following assumes that you are using ApiOpenStudio Docker Dev.
The dockerfile is configured toi create a build from
php:n.n-fpm, and you can enable the build to include the xDebug packages using a simple environment variable,
Turn on Xdebug in
.env in your checkout of ApiOpenStudio Docker Dev:
Rebuild your docker containers
$ docker-compose build
$ docker-compose up -d --build
If this is the first time that xDebug has been set up in your PHPStorm, you need to set up the PHP interpreters.
Ensure that your docker instance is running, so that PHPStorm can detect the
Click on Preferences -> PHP.
PHP language level - this should be the same as the PHP version in your docker setup.
In the CLI interpreter, click on the
CLI Interpreters modal that pops up, click on the
+ to add a new interpreter and select
From Docker, Vagrant, VM, WSL, Remote....
In the new popup:
PHP interpreter pathas
In PhpStorm, go to PhpStorm -> Preferences -> PHP -> Debug.
This is how PHPStorm will map the local file paths to the ones in your container.
Give a name to the server. It should be a recognisable name, so you can identify it later, i.e.
Ensure you have "Use path mappings" checked, and edit the RHS to
Apply to save your configurations.
Depending on how you have set up your projects, and you have admin in a separate project, you will also need to set up servers as above, for your admin project.
The remote path mapping will be