Tips for using PHPStorm with Docker.
Go to database view, choose Add >> Database Source >> MariaDB
Set localhost with the port defined in docker compose file (3306 by default).
Set password defined in .env file.
Warning
We haven't successfully imported dump files from PhpStorm yet. You can use the command line way How To...
Go to PHP CLI interpreter settings section File >> Settings >> Languages & Frameworks >> PHP
Click on the ... button to add a new interpreter.
Click on + button and choose From Docker, Vagrant, VM, WSL...
Choose Docker Compose and set the following options:
Choose the php service you want to use from the list (e.g. php84).
Open the environment variables editor.
Set the CONF_FOLDER and HTML_FOLDER variables as in the .env.local file of your docker_environment instance.
Confirm the settings, then choose the Connect to an existing container option, in the Lifecycle section.
You need to set addition information from php section.
First set path mappings for the project.
Set the correct location of your project.
Warning
You will have to set the path mappings for every projects, its not a shared setting.
Add other php versions as needed.
In the PhpStorm services view, click on the + button and choose Docker, Connection, WSL....
You will have access to docker containers and images.
This is easy from here to control container and see logs.
You may also perform terminal commands in the container.
Inside PHPStorm's terminal pane, using the dropdown arrow allows you to select the dockered-itop WSL2 host, where you can run commands to install iTop.
Open the iTop project in PHPStorm.
In PHPStorm settings, under PHP > Debug, you can uncheck these options :
- Xdebug
- Force break at first line when no path mapping specified
- Force break at first line when a script is outside the project
- Evaluation
- Settings
- Notify if debug session was finished without being paused
- Settings
In PHPStorm settings, under PHP > Servers, add a new server with the following configuration :
- Host : localhost
- Port : 88
- Debugger : Xdebug
Check the following option to configure path mappings :
- Use path mappings (select if the server is remote or symlinks are used)
- Add a target to the default option from
//wsl.localhost/dockered-itop/home/{your-username}/docker_environment/html/iTop(which should already be filled in with the appropriate user) to/var/www/html/iTop.











