This Question is Answered

1 "correct" answer available (4 pts) 2 "helpful" answers available (2 pts)
3 Replies Last post: Jun 23, 2013 5:45 AM by Andriy Bazanov  
Jack Kernel Newbie 3 posts since
Jun 22, 2013
Currently Being Moderated

Jun 22, 2013 10:08 PM

PHPStorm + Xdebug = "Waiting for incoming connection with ide key" forever

Launches page in FF, FF URL shows ?XDEBUG_SESSION_START=

 

But doesn't stop on first line of file.

 

Debugger output shows "Waiting for incoming connection with ide key  " -- always. nothing else. no debug info shown

 

Any help?

 

--------------------------------------------

 

I have recorded this problem with Windows's "Problem Steps Recorder" Tool, It's a .mht file contains every step's screenshot of my operation.

 

These screenshots above have information about:

 

1, xdebug remote log

2, phpstorm IDE log,

3,php.ini [xdebug] settings

 

Please download the attachment to view the screenshot, thanks.

Andriy Bazanov Master 4,167 posts since
May 28, 2010
Currently Being Moderated
Jun 23, 2013 1:18 AM in response to: Jack Kernel
Re: PHPStorm + Xdebug = "Waiting for incoming connection with ide key" forever

Hi there,

 

1) Well .. you have your project located at D:\Vault\Project\Develop\Space\1\src\lab . At the same time real file location is D:\Project\Develop\Space\1\src\lab (no "Vault" part here). This means that D:\Vault is symlink for D:\ (or something like that)

 

If you open your project in IDE via D:\Project\Develop\Space\1\src\lab path it could save you from some troubles (path mappings for debugging at very least).

 

But seems to me that this is NOT the problem since debug actually works (you did debug index.php page (after set up mappings) with no problems).

 

2) You have set no breakpoints AT ALL (at least I see none one screenshots) -- where you expect IDE to stop then? It stopped first time because you had no path mappings set up, so IDE forced break. But now you have path mappings .. and IDE simply has nothing to report to xdebug.

 

If you wish -- activate "Run | Break at first line in PHP scripts" to force break on first line (on initial script only, of course). Otherwise IDE will simply keep listening for NEXT incoming connection (since in this one no need to stop)

 

3) You did successfully debug index.php  -- that's the impression I have from your screenshots. You have not show if you managed to step in into another file (the last line in index.php -- $bootstrap(); ) -- possibly you have used "Step Over" command which does not go inside method/function -- try "Step In" next time.

 

4) The log file (which you could actually attach separately (like this file) instead of few screenshots shows no records of breakpoints .. and it only shows  details about one debug session only. I'm not big expert in logs .. but what you showed was accurate for your successful debug of index.php

 

 

 

My suggestions (based on info I saw so far):

 

1) Set up breakpoint -- either via "Run | Toggle Line Breakpoint" or just by clicking in the gutter area of the editor (that area between editor and line numbers)

 

2) Instead of creating "Run/Debug Configuration", you may use "Zero Configuration" approach: as described in this article: http://confluence.jetbrains.com/display/PhpStorm/Zero-configuration+Web+Application+Debugging+with+Xdebug+and+PhpStorm -- works perfectly for me every time (I do recommend it on every occasion -- but what to use is up to you -- maybe it's not convenient for you to work this way). With this approach there is no need for any Run/Debug configuration:

  • you activate "Phone Handle" icon (or "Run | Start Listen PHP Debug Connections...") -- this will turn debugger client on (do not worry that you see no debug window -- it will pop up when debug connection will be made)
  • you navigate to the page you want to debug in your browser
  • activate debug session via Bookmarklets or any xdebug browser extension (there is at least one for Firefox, Chrome and Opera) -- this will just set the xdebug cookie, similar to what ?XDEBUG_SESSION_START parameter does in query string.
  • reload the page (if this is the age you want to debug) or click the link/button that will lead to next page (once cookie is set, every subsequent request will be attempted to be debugged (since it's xdebug who connects to IDE and not other way around) until cookie removed or expired -- therefore, if you screwup at some point, you may need to manually remove debug cookie (or restart browser) if it keeps debugging).
Andriy Bazanov Master 4,167 posts since
May 28, 2010
Currently Being Moderated
Jun 23, 2013 5:45 AM in response to: Jack Kernel
Re: PHPStorm + Xdebug = "Waiting for incoming connection with ide key" forever
If not activating: "Run | Break at first line in PHP scripts", Then the breakpoints I set will not work at all.

That's odd. I have never seen it working this way. For me -- if I have breakpoint, and I know that the code will actually be executed, then it always breaks there (unless xdebug itself cannot break there -- but that is xdebug issue)

 

If you have time -- try configuring project from scratch again (backup and delete .idea subfolder -- that's where project settings are stored) -- maybe you will set it up correctly this time (because I strongly believe that it is misconfiguration somewhere and not a bug (very slim chance, IMO)).

 

But if you are happy with current workflow .. then issue is solved, I guess.

More Like This

  • Retrieving data ...