XDEBUG behaviour change after update to 2022.2.3

Solved this myself but will leave it up in case it's useful to someone else. Solution at the bottom.

 

I just updated PhpStorm to 2022.2.3 and XDEBUG isn't working as it used to and I can't figure out why or if I can get back the old behaviour.

I use it with Chrome with the plugin and as long as the plugin 'bug' is green and PhpStorm is listening for connections, it's always just worked.

Since updating, the only way I seem to be able to get it to work is if I start a new session by clicking on the green 'bug' icon beside my debugging configuration which opens a new window and appends a parameter ?XDEBUG_SESSION_START=<some random number> to the url. This is a PITA for many reason—I can't navigate around my project because the parameter disappears if I click a link; I use my own parameters in the urls in my project, and whenever I stop, I need to restart a new session with a new number.

My XDEBUG install still validates fine; I don't see anything new or obvious in the settings... anyone know what I'm missing??

 

Edit: I've got a whole bunch of these in my apache error log:

Got error 'PHP message: Xdebug: [Step Debug] Could not connect to debugging client. Tried: localhost:9003 (through xdebug.client_host/xdebug.client_port) :-('

and it looks like PhpStorm is only listening to 9000/9003 on IPv6... I'm not sure if that's normal...

Also phpinfo() is showing xdebug.idekey as blank... it should be PHPSTORM no?

 

Solution: It was the IDE Key that was the problem. I gather that somehow PhpStorm ordinarily sets a default since they don't include this it in the set up; however, once I included:

xdebug.idekey=PHPSTORM

in php.ini (and restarted the fpm process) my phpinfo() had xdebug.idekey set correctly and everything worked again. Looks like it listening only on ipv6 is expected.

Please sign in to leave a comment.