MediaWiki-Docker/Configuration recipes/Xdebug

XDebug
To use XDebug with MediaWiki running inside a docker container, you have to tell the PHP environment running inside the container to connect to the IDE on the host machine. Tho do this, set the  variable in your   file:

The following values may have to be adjusted for your system:
 *  : this has to be the IP address of the host system (your laptop) as seen from inside the container. Generally, this will just the IP address assigned to the host in the local network. On Linux, you can use  or   to list these addresses. Caveat: if you are running docket in a virtual machine, additional configuration may be necessary.
 *  : adjust this to the port the IDE is listening on (or a port that is configured to forward to the IDE). This should rarely change from xdebug's default, which is 9000.
 *  : the key to use when connecting to the IDE. This has to match the key configured in the IDE. For PhpStorm, the default is.
 *  : the server name to use by the IDE to apply path mappings. You will have to create appropriate configuration in your IDE (instructions for PhpStorm). This may not be needed for debugging web requests, but it is needed for debugging command line scripts such as PHPUnit tests.

Caveat: as of November 4 2020, PHP_IDE_CONFIG needs a patch for docker-compse.yaml. And it still didn't quite work for me.