S
S
Sergey Ilichev2022-01-09 05:56:37
xdebug
Sergey Ilichev, 2022-01-09 05:56:37

How to properly set up xdebug + php-fpm on docker desktop in mac os + phpstorm?

Hello colleagues!

Again, the docker gave a joke after the update (it has not been updated for a long time).

I'm trying to figure out what kind of dances with tambourines are needed in order to run xdebug for php-fpm in the docker on mac os.

Now I picked up such a working config dev.php.ini

xdebug.remote_enable=1
xdebug.remote_autostart=1
xdebug.remote_connect_back=0
xdebug.remote_host=10.254.254.254
xdebug.remote_port=9000
xdebug.idekey=PHPSTORM
xdebug.max_nesting_level=1500
xdebug.remote_log=/tmp/xdebug.log


Before that, you need to alias sudo ifconfig lo0 alias 10.254.254.254 to localhost.

Xs, what are these dances with tambourines and why does it work.

It used to be for remote_host=host.docker.internal, then it was docker.for.mac.localhost, once again it was docker.for.mac.host.internal, then one option stopped working, then another, and now only the option works with an alias for localhost.

Who knows why and why all these dances with a tambourine are needed?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
B
Ba An Doan, 2022-01-09
@doanbaanh

host.docker.internal did not change, it worked as it did. There is a possibility that you have updated XDebug to version 3, there, as far as I remember, there are other configurations and port 9003.
And, perhaps, you have not configured mapping in Servers:
61dada624444c142069531.jpeg
Configured for your environment. MacOS, Docker fo Mac, PHPStorm, XDebug 3. You can peep here:
https://github.com/doanbaanh/docker-php-fpm

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question