Eclipse, XAMPP, xDebug - waiting for XDebug session - stays in 57%

二次信任 提交于 2019-12-19 10:45:35

问题


When I start debugging the process stays there at 57% and says "waiting for XDebug session".

This is a duplicate post on StackOverFlow, but I tried all the answers, nothing worked.

It was working fine until before two days. I don't know what went wrong.


回答1:


Having used Eclipse to launch xdebug sessions in Firefox for ever now, all of a sudden 23/4/2013 it would not launch xdebug using Firefox. It gave me the launch 57% and hang problem.

It was quite happy to launch xdebug sessions in IE/Chrome/Safari/Opera but not Firefox.

The only thing I changed around this time was I upgrades my java runtime to 1.7.0_21 from a previous version ( cannot remember which but I did jump more than one release so it was probably 1.7.0_19 )

I took a look at the project log file, Check your projects workspace folder for a subfolder called .metadata where there should be a .log file, there is one of these for each project so be sure you are looking at the correct one.

This is what was in mine:

!SESSION 2013-04-23 11:06:21.238 ----------------------------------------------- eclipse.buildId=M20130204-1200 java.version=1.7.0_21 java.vendor=Oracle Corporation BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_GB Command-line arguments: -os win32 -ws win32 -arch x86

!ENTRY org.eclipse.ui.browser 4 0 2013-04-23 11:07:32.584 !MESSAGE Launching C:\Program Files\Mozilla Firefox\firefox.exe has failed. !STACK 0 java.io.IOException: Cannot run program "C:\Program": CreateProcess error=2, The system cannot find the file specified at java.lang.ProcessBuilder.start(Unknown Source) at java.lang.Runtime.exec(Unknown Source) at java.lang.Runtime.exec(Unknown Source) at java.lang.Runtime.exec(Unknown Source) at org.eclipse.ui.internal.browser.browsers.MozillaBrowser$BrowserThread.openBrowser(MozillaBrowser.java:94) at org.eclipse.ui.internal.browser.browsers.MozillaBrowser$BrowserThread.run(MozillaBrowser.java:165) Caused by: java.io.IOException: CreateProcess error=2, The system cannot find the file specified at java.lang.ProcessImpl.create(Native Method) at java.lang.ProcessImpl.(Unknown Source) at java.lang.ProcessImpl.start(Unknown Source) ... 6 more

Because I saw this line java.io.IOException: Cannot run program "C:\Program": CreateProcess error=2,

It made me thinks that for some reason java could no longer cope with folder names with spaces in them (very strange), so I changed the eclipse preferences and used the 8.3 naming convension C:\PROGRA~1\MOZILL~1\firefox.exe

Now it launches the xdebug session again!!

This is very strange as it does not seem to have problems with

C:\Program Files\Opera\opera.exe OR
C:\Program Files\Safari\Safari.exe OR
C:\Program Files\Internet Explorer\iexplore.exe

So all I can think of is that it does not like 2 folder names with spaces in them for some obsqure reason, because it wont launch firefox from C:\Program Files\Mozilla Firefox\firefox.exe I assume it launches IE from a similiar folder named address as it is the default browser on this system.

Anyhow, the solution for me was to change the eclipse preferences ->General -> Web Browser -> Firefox to use the 8.3 DOS directory naming convension.

Hope this helps




回答2:


riggsfolly's analysis and solution are both correct, however for some reason my eclipse would not allow me to use the DOS 8.3 naming convention. As an alternative for those who run into the same issue you can try the following:

  1. Create a parallel folder structure but do it without spaces (eg. "C:\ProgramFiles86\MozillaFirefox\")
  2. Download and install firefox, using the custom installation options to install to your new 'spaceless' directory
  3. In eclipse preferences ->General -> Web Browser: Make a new entry (eg. "Firefox2") and point it at your new installation (eg. C:\ProgramFiles86\MozillaFirefox\firefox.exe").
  4. Finishing touch - use Mozilla Sync between the two browsers so you don't have to worry about outfitting your new Firefox.



回答3:


And the easiest way I used to find out the 8.3 compatible windows path of Mozilla Firefox is as below.


C:\>dir .* /x
 Volume in drive C has no label.
 Volume Serial Number is XXXX-XXXX

 Directory of C:\

File Not Found

C:\>dir *.* /x
 Volume in drive C has no label.
 Volume Serial Number is XXXX-XXXX

 Directory of C:\

07/14/2009  08:50 AM    <DIR>                       PerfLogs
04/01/2013  07:32 PM    <DIR>          PROGRA~1     Program Files
05/14/2013  01:50 PM    <DIR>          PROGRA~2     Program Files (x86)
01/17/2013  01:43 PM    <DIR>                       Users
05/12/2013  05:46 AM    <DIR>                       Windows

C:\>cd PROGRA~2

C:\PROGRA~2>dir *.* /x
 Volume in drive C has no label.
 Volume Serial Number is XXXX-XXXX

 Directory of C:\PROGRA~2

05/14/2013  01:50 PM    <DIR>                       .
05/14/2013  01:50 PM    <DIR>                       ..
05/14/2013  01:50 PM    <DIR>          COMMON~1     Common Files
03/05/2013  10:50 AM    <DIR>                       Google
07/14/2009  11:07 AM    <DIR>          INTERN~1     Internet Explorer
04/19/2013  06:03 PM    <DIR>                       Java
04/14/2013  10:16 PM    <DIR>          MOZILL~1     Mozilla Firefox
04/15/2013  10:57 AM    <DIR>          MOZILL~2     Mozilla Maintenance Service

C:\PROGRA~2>cd MOZILL~1

C:\PROGRA~2\MOZILL~1>




回答4:


In addition to RiggsFolly's life-saving solution, maybe the following is useful for anyone.

Issue 1: different path on 32 bits and 64 bits Windows 7

On 32 bits Windows 7, the path is: C:\PROGRA~1\MOZILL~1\firefox.exe

On 64 bits Windows 7, the path is: C:\PROGRA~2\MOZILL~1\firefox.exe

(Note the different figure behind PROGRA~ , as I figured out by Abu Sithik's post)

Issue 2: Where to set the path?

You should do the setting (as RiggsFolly had already correctly said) in: Window > Preferences > General > Web Browser > Firefox > Edit

and NOT (as I did intuitively) in Run > Debug Configurations > Web browser > Firefox - Internal Server. At least, as far as I tried out (but I'm a relative Eclipse novice) it seems this setting doesn't influence the path that Eclipse/xdebug/java uses to start the browser in an xdebug session.

I hope this helps anyone prevent wasting time as I did fiddling around in vain, when switching between computers running resp. 32 bits and 64 bits Windows, and having to change the path to the firefox executable, until at a certain moment by luck I got the correct ways as indicated above...




回答5:


I have the same problem, but suddently works when I select de 'Default system web browser instead of Firefox directly. My default web browser is Firefox and now it starts oks.

I hope this helps.



来源:https://stackoverflow.com/questions/16121672/eclipse-xampp-xdebug-waiting-for-xdebug-session-stays-in-57

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!