PhpStorm Debugger extension is not detected while using with PHPUnit

Your Xdebug settings look fine to me. It shows expected values for PHPUnit and it works for a web page debug.

This has to be the IDE settings / some IDE misconfiguration. In particular, make sure that you have selected the default PHP Interpreter. Even though you have specified one in your Run/Debug Configuration, PhpStorm still requires a project-default interpreter to be selected -- it's a know limitation: WI-51570.

Settings/Preferences | Languages & Frameworks | PHP | CLI Interpreter

enter image description here

NOTE: as of 2021.1 version the PHP settings node has been moved to the top level and now it's Settings/Preferences | PHP | CLI Interpreter

enter image description here

P.S. You can also set it via File | New Projects Settings | Settings for New Projects.... This way it will be set for all future new projects created on that computer (which you can then change as required on per project basis).


This will not work in your docker since the steps will be removed when running the container:

RUN echo 'export PATH="$PATH:$HOME/.composer/vendor/bin"' >> ~/.bashrc
RUN source ~/.bashrc

you may use:

ENV PATH="$PATH:$HOME/.composer/vendor/bin"

Update

You may also not using the IP in your config, instead you can map the port to your host when starting your container.

First change XDEBUG_REMOTE_HOST=172.17.0.1 to XDEBUG_REMOTE_HOST=0.0.0.0


I had this problem. I fixed it by specifying the CLI Interpreter in Preferences > PHP

enter image description here