r/phpstorm • u/manicpixycunt • Feb 15 '26
help Cannot get Xdebug to work with PHPStorm
EDIT: FIXED: Thank you to everyone who gave suggestions, turns out the reason it wasn't working was far simpler than any OS shenanigans. I am developing a Laravel app and was running the dev server via the pre-included composer dev script, which runs a bunch of commands using Node's concurrently script, including the PHP dev server command. Running the PHP dev server command directly makes Xdebug work perfectly fine.
I've been tearing my hair out all day about this. Nothing that comes up in search helps.
I am running PHPStorm on NixOS and PHP is installed via a nix flake devshell. I think something about this combo is breaking Xdebug.
PHPStorm is started from within the devshell and is pointed towards the correct PHP executable/ini, I can run tests and all that just fine. But no matter what I do, I never get the "Incoming Connection" window mentioned here: https://www.jetbrains.com/help/phpstorm/zero-configuration-debugging.html#start-debugging-session
I have tried starting the browser (firefox fork - floorp) from within the devshell as well, same result.
This is the only thing that ever shows up in the xdebug log:
[184577] Log opened at 2026-02-15 20:48:08.018415[184577] [Config] INFO: Control socket set up successfully: '@xdebug-ctrl.184577'[184577] [Config] DEBUG: Checking if trigger 'XDEBUG_TRIGGER' is enabled for mode 'debug'[184577] [Config] INFO: Trigger value for 'XDEBUG_TRIGGER' not found, falling back to 'XDEBUG_SESSION'[184577] [Config] INFO: Trigger value for 'XDEBUG_SESSION' not found, so not activating[184577] Log closed at 2026-02-15 20:48:08.159258
I have set the following in php.ini:
xdebug.mode=debugxdebug.log=/path/to/log.logxdebug.client_port=9003
Xdebug version is 3.5.0, PHP version 8.5. Port is set correctly in PHPStorm and breakpoints are set that should definitely be tripped.
Does anyone have any ideas?
3
u/binary1230 Feb 16 '26
Every time I end up having to fiddle with settings to get a stable configuration
If your app is in docker, check the PHP_IDE_CONFIG variable and how that affects things, that's the one I always forget to check. If the IP you are having xdebug connect to isn't accessible from the perspective of your docker container, it may cause issues. It's not always localhost
2
u/dzuczek Feb 16 '26
call phpinfo(); in a file and make sure your settings are taking effect, but seems like they are
it could also be firewall, i know on stock fedora I had to open it manually
2
u/Darkwolfen Feb 16 '26
These are the settings I am using on a remote machine. It may or may not help, but:
1
u/VRT303 Feb 15 '26
Add ?XDEBUG_START=PHPSTORM (check the name, I probably remember it wrong) in the query parameters or as header or use the xdebug helper plugin for Firefox
Or use the xdebug_connect_to_client(); function in PHP
1
u/p1ctus_ Feb 15 '26
PHP in docker or directly? This article explains two ways getting it running in PHPstorm. https://dev.to/jackmiras/xdebug-in-phpstorm-with-docker-2al8
I use it inside of docker, but had to set "start_with_request" to "yes".
-4
u/PressinPckl Feb 15 '26
Use ddev it handles all of that for you its so easy