PhpStorm debugger not stopping at BreakPoints; keeps waiting for xdebug _SESSION_

42,159

Solution 1

There was a syntax error in php.ini. There were extra "quotes" and ;colons;.

xdebug.remote_port

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"

enter image description here

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: enter image description here

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

Share:
42,159
laggingreflex
Author by

laggingreflex

Updated on January 20, 2022

Comments

  • laggingreflex
    laggingreflex over 2 years

    Updated question : PhpStorm | WebMatrix (IISExpress) | Xdebug.remote_port | — Which Port(s) to put where?


    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

    ide

    xdebug.remote_port is configured correctly. (Later I found that this is wrong, but not erroneous. It should be port 9000)

    xdebug.remote_port

    But it seems Xdebug never gets to communicate with PhpStorm. PhpStorm keeps listening, and the execution runs completely without stopping at any break-points.

    PhpStorm PhpStorm

  • Vladd
    Vladd almost 9 years
    This 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
    Piskvor left the building over 8 years
    127.0.0.1 works everywhere, no need to find out ;)
  • Piskvor left the building
    Piskvor left the building over 8 years
    Downvoted 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
    Piskvor left the building over 8 years
    Actually, with remote_autostart=0, XDebug is looking for a cookie named XDEBUG_SESSION. Slightly more complex to set up, but also works (with PHPStorm). +1 for the easier option.
  • c-a
    c-a over 8 years
    PHPStorm 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
    Admin over 8 years
    since I'm debugging the vagrant(guest box) 127.0.0.1 didn't do the trick. ;)
  • Piskvor left the building
    Piskvor left the building over 8 years
    Aha, okay, now I understand. Thanks for the explanation.
  • Thlbaut
    Thlbaut over 8 years
    You save my day too. Thank you so much.
  • SoManyGoblins
    SoManyGoblins over 8 years
    Just saved me days of pulling hairs. Works perfectly!
  • rfay
    rfay almost 8 years
    Even though I normally have a regular debug configuration set up and don't use this button, this was the ticket for me. Thanks!
  • ArunTejCh
    ArunTejCh over 7 years
    Omg this is was the problem with my phpstorm. Was searching for hours. I Thought it would start listening automatically like eclipse
  • Akash Singh
    Akash Singh over 7 years
    Dude 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
    Ignacio Sánchez about 7 years
    Works like a charm. Thanks so much!
  • Luiz Eduardo
    Luiz Eduardo over 6 years
    Thank 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
    carlcs over 6 years
    Why didn’t I come across your post earlier. Thank you so much!
  • Manish Goswami
    Manish Goswami over 6 years
    Search a lot ! thanks @Rotareti you saved my hours !
  • Wes Dollar
    Wes Dollar about 6 years
    Just wanted to say thanks! Been fighting with this. Finally found your comment and proceeded to run around my house jumping for joy.
  • abounket
    abounket about 6 years
    YES! Thank you!
  • Alex
    Alex about 6 years
    You're a life saver!
  • Shyam Ranpara
    Shyam Ranpara over 5 years
    Thanks this helped me.
  • Bhavesh G
    Bhavesh G over 5 years
    Makes 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
    Ali Nouman about 5 years
    Thank you very much for it!
  • kosta
    kosta over 4 years
    Thanks, just "sudo ufw disable" has resolved my xdebug issue
  • The Unknown Dev
    The Unknown Dev about 4 years
    This 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
    Edoardo Facchinelli almost 3 years
    This 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 of xdebug.remote_enable=1, and xdebug.start_with_request=yes instead of xdebug.remote_autostart=1. Full list of changes here