XDebug 3 only started working out of the box with PhpStorm version 2020.3
Reference article - Configure Xdebug
Docker For Windows System Requirements
I wanted to run tests with PHPUnit on a docker environment, which was set up with docker-compose, and use the PhpStorm integration. Since PhpStorm 2013.2 there is a docker intergration which works well for single containers, but unfortunately it does not seem to use the running network of containers. So for example my PHP container does not get access to the MySQL container for integration tes. Probably the easiest way to integrate Docker with PhpStorm is to use the PhpStorm Docker registry. It provides a selection of preconfigured Docker images curated by the PhpStorm team, which cover the most common PHP development needs.
Phpstorm Docker Wsl2
Pubg mobile download pc mac. The list of changes from XDebug 2 to 3 are available here for reference - Upgrade Guide
Configuring PhpStorm
Go to PhpStorm -> Settings -> Languages & Frameworks -> PHP -> Servers
- Click '+'
- Name
docker-cli
(Same as serverName under PHP_IDE_CONFIG environment variable) - Host
_
- Default 80
- Debugger Xdebug
- Check the checkbox next to 'Use path mappings'
- Modify the absolute path on the server to
/var/www/html
Running the CLI Command
- Add breakpoints file
- In PhpStorm click the icon to 'Start Listening for PHP Debug connections'
- Run in the docker file -
docker-compose run php-container php test.php
Phpstorm And Docker Tutorial
Troubleshooting
Phpstorm And Docker Download
- Check firewall or selinux if on linux
- The configuration
host.docker.internal
only became available under Mac and Windows with Docker version20.04