PhpStorm debugger not stopping at BreakPoints; keeps waiting for xdebug _SESSION_
Solution 1
There was a syntax error in php.ini
. There were extra "
quotes"
and ;
colons;
.
Solution 2
These lines are crucial to make it work (in php.ini):
zend_extension=/usr/lib/php/extensions/no-debug-non-zts-20121212/xdebug.so
xdebug.remote_autostart = 1 # <-------- THIS
xdebug.remote_enable = 1 # <----------- AND THIS
Without these lines xdebug will never work on phpstorm ;)
Solution 3
Try changing the xdebug listen port in your php.ini and your IDE.
Running Mac Yosemite, for me the problem was that I installed with homebrew, following a guide that used php-fpm, which uses port 9000
by default (which conflicts with the xdebug default port)... Changing my xdebug.remote_port
to 9001
and changing the xdebug port in phpstorm fixed the problem, though I suspect this issue could happen for anyone in any IDE. I googled for the better part of a day and didn't see this solution (since I believe it's so specific to install method).. but I hope it helps someone.
Solution 4
Took me about an hour until I noticed that this button wasn't activated ;)
"Run" -> "Start Listening for PHP Debug Connections"
Solution 5
First check for on what port xdebug is working on, you can find it in your php.ini under xdebug.remote_port=9123
. As you can see in my case it is set to 9123.
Now open PhpStorm go to php debug, see screenshot:
under Xdebug you will find Debug port, make sure that its value is the same as in the php.ini file under xdebug.remote_port
(9123 in my case).
Hope it helps
laggingreflex
Updated on January 20, 2022Comments
-
laggingreflex over 2 years
I'm running localhost web server on my Windows machine with WebMatrix and IISExpress. I've installed PHP and Xdebug in it and they both are working.
I have a local WordPress install.
I'm now trying to get PhpStorm to debug it using Xdebug.
When I run PhpStorm it launches the web app in the browser with relevant debugging parameters in the browser.
IDE KEY is matching
xdebug.remote_port
is configured correctly. (Later I found that this is wrong, but not erroneous. It should be port 9000)But it seems Xdebug never gets to communicate with PhpStorm. PhpStorm keeps listening, and the execution runs completely without stopping at any break-points.
-
Vladd almost 9 yearsThis has saved my day. Not a day. 4 days i was strugling with debugging and problem was caused by installing with homebrew. I followed your advice and changed port and voila! phpstorm stopped at break point, finally :)
-
Piskvor left the building over 8 years
127.0.0.1
works everywhere, no need to find out ;) -
Piskvor left the building over 8 yearsDownvoted for misinformation: "The new version (9) of PHPStorm changed the default xdebug port to 9123" - PHPStorm has no business changing any default ports, and does not do so; the config happens on the server side; and PHPStorm needs to match it client-side. Do not present your specific configuration as "default."
-
Piskvor left the building over 8 yearsActually, with
remote_autostart=0
, XDebug is looking for a cookie namedXDEBUG_SESSION
. Slightly more complex to set up, but also works (with PHPStorm). +1 for the easier option. -
c-a over 8 yearsPHPStorm has settings, and this is the topic. PHPStorm OBVIOUSLY did not change the actual port of Xdebug. PHPStorm settings had 9123 as a default xdebug port, which it did not take on my xdebug config, since my xdebug config was set to 9000, so I assumed PHPStorm changed its own configuration to default at 9123 (i.e. try to connect to 9123). How would you have phrased it?
-
Admin over 8 yearssince I'm debugging the vagrant(guest box) 127.0.0.1 didn't do the trick. ;)
-
Piskvor left the building over 8 yearsAha, okay, now I understand. Thanks for the explanation.
-
Thlbaut over 8 yearsYou save my day too. Thank you so much.
-
SoManyGoblins over 8 yearsJust saved me days of pulling hairs. Works perfectly!
-
rfay almost 8 yearsEven though I normally have a regular debug configuration set up and don't use this button, this was the ticket for me. Thanks!
-
ArunTejCh over 7 yearsOmg this is was the problem with my phpstorm. Was searching for hours. I Thought it would start listening automatically like eclipse
-
Akash Singh over 7 yearsDude top answers didn't help me and I was pulling my hair for two days, I wish I could upvote this thousand times
-
Ignacio Sánchez about 7 yearsWorks like a charm. Thanks so much!
-
Luiz Eduardo over 6 yearsThank you so much! I installed following a homebrew based tutorial witch used php-fpm too and didn't noticed the 9000 port thing... Lost hours here... Thank you!
-
carlcs over 6 yearsWhy didn’t I come across your post earlier. Thank you so much!
-
Manish Goswami over 6 yearsSearch a lot ! thanks @Rotareti you saved my hours !
-
Wes Dollar about 6 yearsJust wanted to say thanks! Been fighting with this. Finally found your comment and proceeded to run around my house jumping for joy.
-
abounket about 6 yearsYES! Thank you!
-
Alex about 6 yearsYou're a life saver!
-
Shyam Ranpara over 5 yearsThanks this helped me.
-
Bhavesh G over 5 yearsMakes my day. Was figuring out why not working. I tried many things port forwarding, restarting the server. none of them works but this. Thanks
-
Ali Nouman about 5 yearsThank you very much for it!
-
kosta over 4 yearsThanks, just "sudo ufw disable" has resolved my xdebug issue
-
The Unknown Dev about 4 yearsThis was the solution for me on Windows 10! Open Windows Defender > Firewall > Allow an app through firewall > Change Settings. Then make sure all instances of "PHPStorm" listed are enabled (for public/private networks, whichever you use).
-
Edoardo Facchinelli almost 3 yearsThis pushed me in the right direction, except the settings changed with XDebug 3 (Nov 2020), though the idea is the same: use
xdebug.mode=debug
instead ofxdebug.remote_enable=1
, andxdebug.start_with_request=yes
instead ofxdebug.remote_autostart=1
. Full list of changes here