0

I cant' activate the step debugger of Xdebug 3.0.4 with PHP 7.4.20.

Xdebug features status:

enter image description here

So, my Xdebug configuration is :

[xdebug]
;xdebug.discover_client_host=1
xdebug.mode=debug
xdebug.start_with_request=yes
xdebug.remote_handler=dbgp
xdebug.client_host=host.docker.internal
xdebug.client_port=9003
xdebug.max_nesting_level=1000
xdebug.idekey=PHPSTORM

Also, my Xdebug run into a PHP FPM docker container.

If anyone can help me :), thanks.

Derick
  • 35,169
  • 5
  • 76
  • 99
Alexandre
  • 159
  • 1
  • 10
  • 1
    1) Show the **whole** section, not just top of it. It's to see if other settings are applied or not. 2) Right now the best guess is that you override `xdebug.mode` via `XDEBUG_MODE` environment variable. You may want to check your Docker file for that. – LazyOne Jun 30 '21 at 09:04
  • 1
    No need to guess for that @LazyOne, it says so right under "Enabled Features". – Derick Jun 30 '21 at 10:47

1 Answers1

0

I couldn't solve the issue directly, but it worked with an SSH tunnel. Although my docker host IP 172.17.0.1 should have been just as good, as nc -vz 172.17.0.1 9003 could easily connect, for some reason Apache+PHP+Xdebug just refused to do it.

So, I connected to my container via ssh -R 9003:127.0.0.1:9003 dev@172.17.0.2 and then changed my xdebug.client_host to 127.0.0.1 instead of where the IDE is running (172.17.0.1). This SSH tunnel will make it such that anything that connects to port 9003 locally to the container will actually go and connect to 9003 from where I initiated the ssh command (which is my host running my IDE).

Then, Xdebug connected and worked fine when I accessed my PHP pages (or even running a CLI php script) without any issues and step debugging worked properly.

I have no idea why this works via SSH tunnel, but I suspect docker networking has some things that I'm not familiar with.

thorie
  • 160
  • 1
  • 7