How does phpstorm debug code through docker?

the current operation is like this.
docker maps a port to the host,-p 8999docker xdebug,php.ini configuration port is also 8999
phpstorm setting xdebug debugging is also 8999
then debug, phpstorm prompt 8999 is occupied.
is indeed occupied by docker.
if there is something wrong with this wave of operation, I don"t know what went wrong.

Jun.13,2021

is it possible that the port of php is wrong? the default is 9000.


has solved the problem by itself. There is no need to map 8999 in docker. The xdebug debug port is one-way out.

Menu