Slow or hanging xdebug

I'm having problems with Xdebug in PHPStorm 2024.2.3 running on MacOS Sonoma 14.7 and docker desktop 4.43.3. 

I enabled the debug logger in PHPStorm and this is what I see. The connection is started when I execute a cli command inside of a docker container but the process is “hanging” for like 3 minutes (varies in time) until I get the “Stop reading” message and then the command continues execution. Please note that it does not happen every time, for example it can happen 10 times in a row but then works two times and then stops working again. If I stop the xdebug listener in PHPStorm when it has hung, the cli command continues executing. 

If i close the PHPStorm project when it has been hanging and reopen the project is works as expected for a couple of times again.

I've tried to let the process hang too see if it eventually will “get going” but without progress.

“Max. simultaneous connections” is set to 3, chagning this does not have any noticable effect.

I've tried another IDE (VS Code) and did not experience the same problems.


php-xdebug.inif looks like this:

zend.extension=xdebug.so
xdebug.discover_client_host=0
xdebug.idekey=PHPSTORM
xdebug.mode=debug
xdebug.start_with_request=yes
xdebug.connect_timeout_ms=100

; XDebug 3 is configured to use port 9000 to keep compatibility with Xdebug 2 and the Bastion SSH tunnel:
xdebug.client_port=9000

; This setting will be modified to contain Bastion IP when doing remote debugging:
xdebug.client_host=host.docker.internal

 

idea.log

2024-10-18 11:38:39,389 [1277035]   FINE - #c.j.p.d.c.PhpDebugConnection - 396222065#----connection started
2024-10-18 11:39:01,449 [1299095]   FINE - #c.j.p.d.c.PhpDebugConnection - 1751778645#----connection started
2024-10-18 11:40:02,072 [1359718]   FINE - #c.j.p.d.c.PhpDebugConnection - 765813388#----connection started
2024-10-18 11:40:02,072 [1359718]   FINE - #c.j.p.d.c.PhpDebugConnection - 549322166#----connection started
2024-10-18 11:41:01,176 [1418822]   FINE - #c.j.p.d.c.PhpDebugConnection - 720083897#----connection started
2024-10-18 11:41:03,996 [1421642]   FINE - #c.j.p.d.c.PhpDebugConnection - 653030207#---stop reading
2024-10-18 11:41:03,996 [1421642]   FINE - #c.j.p.d.c.PhpDebugConnection - 653030207#---stop writing
2024-10-18 11:41:03,996 [1421642]   FINE - #c.j.p.d.c.PhpDebugConnection - 653030207#----connection stopped
2024-10-18 11:42:01,210 [1478856]   FINE - #c.j.p.d.c.PhpDebugConnection - 1683736661#----connection started
0

Please sign in to leave a comment.