xdebug - Waiting for incoming connection with ide key '12089'

Here's the php.ini setup

zend_extension=/opt/debuggers/xdebug.so
xdebug.idekey = PHPSTORM
xdebug.remote_autostart = On
xdebug.remote_connect_back = On
xdebug.remote_cookie_expire_time = 3600
xdebug.remote_enable = on
xdebug.remote_handler = dbgp
xdebug.remote_host = 127.0.0.1
xdebug.remote_log = /opt/logs/xdebug.log
xdebug.remote_mode = req
xdebug.remote_port = 9000

The debugger quit working, not quite sure what I've done wrong ?

Earlier today I cleared all the breakpoints, and now I cannot set any breakpoints at all.

When I try to debug, the browser displays the page, but the debugger does not stop on the first line.

When I click on the debugger tab the following error is displayed in the Variables pane:
ERROR : Waiting for incoming connection with ide key '12089'.

It appears that not having a valid connection is causing the breakpoint problem above.



I'd be most grateful for any insights...

Bill Hernandez
Plano, Texas

Attachment(s):
PhpStorm_php_storm_043.png
6 comments

When I go to "Run -> View Breakpoints" I noticed that

[  ] PHP Line Breakpoints  (which I consider to be a category of breakpoints) is missing.

When I launched phpstorm on my MacBook Pro and go to "Run -> View Breakpoints", it contains the category of breakpoints that is missing on my workstation. Earlier in the day I selected the block of items inside the red box on image 046 below, and deleted/cleared all the breakpoints, and apparently once I did that the breakpoints are no longer working by clicking on any line in the editor.

I tried "Run -> View Breakpoints", then clickng on the (+) to create a new category for

[  ] PHP Line Breakpoints

but every time I clicked the (+) the only thing that happened is that the "[  ] Javascript Exception Breakpoints" was selected, I have tried the preferences, etc and cannot find a way to restore the missing category of breakpoints, so it seems I will have to completely re-install phpstorm.

Here are the screen captures from ( 1 ) My iMac, ( 2 ) My MacBook

( a ) Any ideas how to fix the missing "[  ] PHP Line Breakpoints" category ?

( b ) If you can't get this category back, it seems like you shouldn't be able to delete it ?

( c ) Not quite sure what the (+) does, because even after multiple clicks, nothing happens, except the first line "[  ] Javascript Exception Breakpoints"is selected ?

I spent several hours going over the documentation, prior to posting the message, but was not able to find a solution.


Bill Hernandez
Plano, Texas



Attachment(s):
PhpStorm_php_storm_046.png
PhpStorm_php_storm_045.png
PhpStorm_php_storm_044.png
0

Hi Bill,

1) You have

xdebug.remote_autostart = On
xdebug.remote_connect_back = On

With such settings you do not have to use any Run/Debug Configurations, since xdebug will attempt to establish debug session for every single request.

If you click "Debug" button (for entry of any type of Run/Debug Configuration for PHP), it will start listening for incoming debug connection with specific ide key (like "12089" in your case -- which is generated when you click on Debug button).

Instead of that you should just use "Run | Start Listen PHP Debug Connections" (or the button with phone handle icon on main toolbar) -- it will listen and accept php debug connection with ANY ide key.

Here is one good manual (in case you have not seen it yet) -- it shows how it works: http://confluence.jetbrains.com/display/PhpStorm/Zero-configuration+Web+Application+Debugging+with+Xdebug+and+PhpStorm

2) Regarding breakpoints.

  • Yes, you cannot create new breakpoint for PHP in "Run | View Breakpoints" window.
  • The missing "PHP Line Breakpoints" category will be added there automatically once at least one breakpoint in PHP code will be set in editor


If you cannot set breakpoint with the mouse for some reason:

  1. Make sure that PHP breakpoint can actually be set there (e.g. it's not a commented or empty line etc)
  2. Try with keyboard shortcut instead (Run | Toggle Line Breakpoint)
  3. Try restarting IDE -- sometimes it may hit some unknown glitch
  4. Try restarting your PHP/web server (in case it always runs/stays in memory -- e.g. when setup as part of Apache process or whatever)
  5. Try "File | Invalidate Caches" (in case IDE wrongly thinks that breakpoint cannot be set there) -- this universal recipe surprisingly helps in lots of IDE-side cases.


To see if you can set breakpoint at all, try setting breakpoint on

  • very simple code (like $a = 'bla bla';)
  • in breand new project
0

1) You have
xdebug.remote_autostart = On
xdebug.remote_connect_back = On
With such settings you do not have to use any Run/Debug Configurations, since xdebug will attempt to establish debug session for every single request.

( 1 ) ===> Great Tip!

If you click "Debug" button (for entry of any type of Run/Debug Configuration for PHP), it will start listening for incoming debug connection with specific ide key (like "12089" in your case -- which is generated when you click on Debug button).

Instead of that you should just use "Run | Start Listen PHP Debug Connections" (or the button with phone handle icon on main toolbar) -- it will listen and accept php debug connection with ANY ide key.

( 2 ) ===> Found the button, I will start using it.

Here is one good manual (in case you have not seen it yet) -- it shows how it works: http://confluence.jetbrains.com/display/PhpStorm/Zero-configuration+Web+Application+Debugging+with+Xdebug+and+PhpStorm

( 3 ) ===> I have it listed as one of the links that I need to return to...

2) Regarding breakpoints.
Yes, you cannot create new breakpoint for PHP in "Run | View Breakpoints" window.

The missing "PHP Line Breakpoints" category will be added there automatically once at least one breakpoint in PHP code will be set in editor

( 4 ) ===> Every attempt that I have made to regenerate the "[  ] PHP Line Breakpoints" has failed. I've tried different items in php.ini section for xdebug, restarted apache, rebooted multiple times, all to no avail.

If you cannot set breakpoint with the mouse for some reason:
Make sure that PHP breakpoint can actually be set there (e.g. it's not a commented or empty line etc)

( 5 ) ===> They are valid lines, not comments, etc.

Try with keyboard shortcut instead (Run | Toggle Line Breakpoint)

( 6 ) ===> "Run -> Toggle Line Breakpoint" and "Run -> Toggle Temporary Line Breakpoint" are both disabled, no matter what is selected.

Try restarting IDE -- sometimes it may hit some unknown glitch

( 7 ) ===> I've done that many times already.

Try restarting your PHP/web server (in case it always runs/stays in memory -- e.g. when setup as part of Apache process or whatever)

( 8 ) ===> I've done that many times already.

Try "File | Invalidate Caches" (in case IDE wrongly thinks that breakpoint cannot be set there) -- this universal recipe surprisingly helps in lots of IDE-side cases.

( 9 ) ===> Tried this and re-launched the application, but that did not help.

To see if you can set breakpoint at all, try setting breakpoint on
very simple code (like $a = 'bla bla';)
in brand new project

( 10 ) ===> Brand new project called "debug" with images below. See ( 6 ) also.

I think my only alternative will be to delete the preferences, to see if that causes "[  ] PHP Line Breakpoints" to be regenerated, if that doesn't do it, I will try to re-install. I am also wondering of I can export the settings for my workstation, and for my laptop, do a diff to see if the breakpoints from my laptop show up there. Then perhaps I can import the settings from the laptop into my iMac, any ideas ?



Attachment(s):
PhpStorm_php_storm_047.png
PhpStorm_php_storm_048.png
0

Thanks for screenshots! They clearly say .. that this file is NOT a PHP file (in IDE eyes, I mean) :)

Look at the file icon next to file name -- it has "Text file" icon, not PHP one. Plus -- it has no PHP syntax highlighting AT ALL!

1) If ALL files named "index.php" are like this -- make sure that there is no "index.php" (or very similar) pattern in "Settings | PHP | File Types | Text files". If it has -- remove it.
2) If it's like that for ALL PHP files -- the same place -- look for *.php pattern -- remove from there and add back to "PHP files"
3) If nothing like that there at all (only that particular file has problems) -- find that file in Project View, right click and see if it has "Mark as PHP" entry. If it has -- use it. (based on your screenshots this should not be the case here -- must be #1 or #2)

0

Andriy,

Thanks for screenshots! They clearly say .. that this file is NOT a PHP file (in IDE eyes, I mean)

Look at the file icon next to file name -- it has "Text file" icon, not PHP one. Plus -- it has no PHP syntax highlighting AT ALL!

1) If ALL files named "index.php" as like this -- make sure that there is no "index.php" (or very similar) pattern in "Settings | PHP | File Types | Text files". If it has -- remove it.

( 1 ) ===> Look at the two images, the "*.hphp" is obviously wrong, how I messed that up, I don't know ?

2) If it's like that for ALL PHP files -- the same place -- look for *.php pattern -- remove from there and add back to "PHP files"

( 2 ) ===> I changed "*.hphp" to "*.php", applied the changes, and everything is working correctly. I would have never spotted the cause of the problem, I am very happy you did!

3) If nothing like that there (only that particular file has problems) -- find that file in Project View, right click and see if it has "Mark as PHP" entry. If it has -- use it.

( 3 ) Thanks a million for the great help ! You are absolutely the hero of the hour...



Thanks again...

Bill Hernandez
Plano, Texas

Attachment(s):
PhpStorm_php_storm_049.png
PhpStorm_php_storm_050.png
PhpStorm_php_storm_051.png
0
the "*.hphp" is obviously wrong, how I messed that up, I don't know ?

I do not think so -- I also have such pattern -- it's there bundled by default. Compare to your another Mac -- it should have it as well ( http://youtrack.jetbrains.com/issue/WI-7068 : Facebook's Hiphop PHP)

Somehow you were missing *.php one -- no clues on why it's not there.

0

Please sign in to leave a comment.