3

I read a lots of solutions for this common Xdebug's error, but it did not seems to resolve my issue:

netbeans shows “Waiting For Connection (netbeans-xdebug)”

Netbeans not connecting with xdebug on Wamp : “showing waiting for connection”

in phpinfo() Xdebug seems properly configured: xdebug phpinfo

And below is my php.ini:

zend_extension = "c:/wamp/bin/php/php5.5.12/zend_ext/php_xdebug-2.2.5

-5.5-vc11-x86_64.dll"
;
[xdebug]

xdebug.remote_enable=1
xdebug.remote_mode = req
xdebug.remote_handler=dbgp
xdebug.remote_host=127.0.0.1
xdebug.remote_port=9001

xdebug.profiler_enable = off
xdebug.profiler_enable_trigger = off
xdebug.profiler_output_name = cachegrind.out.%t.%p
xdebug.profiler_output_dir = "c:/wamp/tmp"
xdebug.show_local_vars=0
xdebug.idekey=netbeans-xdebug

Netbeans: netbeans configuration

Tried disable firewall doesn't seems to help. Running out of ideas to know what is going on with my Xdebug.

Community
  • 1
  • 1
SonDang
  • 1,468
  • 1
  • 15
  • 21
  • try to add _xdebug.remote_connect_back = 1_ to your configuration in _php.ini_ – Tony May 05 '15 at 06:45
  • Thanks Tony, but it didn't seem to work either :( – SonDang May 05 '15 at 06:54
  • add _xdebug.remote_log="path where you wish to store log"_ and check it after beginning of debugging in netbeans – Tony May 05 '15 at 07:02
  • For me, I didn't know that there were THREE locations where I had to specify port = 9000, and the mismatch was causing “Waiting For Connection (netbeans-xdebug)”: http://stackoverflow.com/a/41768167/470749 – Ryan Jan 20 '17 at 16:27

3 Answers3

2

Once you start debugging , Check in your command prompt that netbeans is listening on port 9001 :

C:\Users\***> netstat -ano | findstr 9001

  TCP    0.0.0.0:9001           0.0.0.0:0              LISTENING       20928
  TCP    [::]:9001              [::]:0                 LISTENING       20928

the PID in the end (20928 in my case) should belong to netbeans, this can be verified from Windows task manager (after adding pid : view > select columns > pid)

If the PID is not correct or the port is not up., restart netbeans or restart system and it will work

If netbeans has the 9001 port, this means your browser is not listening or getting attached to netbeans. Sometimes browser cannot establish the connection or cannot start properly.

In order to manually attempt a connection , you need to press the debugging button in netbeans and within the next minute or so(before it times out) open the following url in your favorite browser (try different browser if one fails)

localhost/<yoursite>/page/?XDEBUG_SESSION_START=netbeans-xdebug

You may also try switching to embedded browser in netbeans project properties.

You can also try changing the port from 9001 to something else , eg 9002 on both sides , this helps if some other program is trying to connect to port 9001 or trying to listen on this port.

arkoak
  • 2,437
  • 21
  • 35
1

Set

zend_extension = "c:/wamp/bin/php/php5.5.12/zend_ext/php_xdebug-2.2.5 -5.5-vc11-x86_64.dll";

inside the [xdebug] section , not outside.
remove ; from the end.

wrong:

zend_extension = "c:/wamp/bin/php/php5.5.12/zend_ext/php_xdebug-2.2.5-5.5-vc11-x86_64.dll";
[xdebug]
xdebug.remote_enable=1
.....

right:

[xdebug]
zend_extension = "c:/wamp/bin/php/php5.5.12/zend_ext/php_xdebug-2.2.5-5.5-vc11-x86_64.dll"
xdebug.remote_enable=1
.....

also try

zend_extension_ts="c:/.../php_xdebug-2.2.5-5.5-vc11-x86_64.dll"

instaed of

zend_extension="c:/.../php_xdebug-2.2.5-5.5-vc11-x86_64.dll"

moskito-x
  • 11,832
  • 5
  • 47
  • 60
1

Finally, managed Xdebug to work follow this article, and one more thing i need to do is when netbeans showing "waiting for connection" message. I need to open the page manually in browser(netbeans not open pop-up itself), added index.php?"XDEBUG_SESSION_START=netbeans-xdebug" to the URL and refresh the page, and then netbeans Xdebug status changed to running right away :)

Thank you guys so much for valuable helps!!!!

SonDang
  • 1,468
  • 1
  • 15
  • 21
  • Have you put `zend_extension` inside `[xdebug]` section ? You should in your answer say all that you have done , not in a link. ! If all is ok, you have not to open a url in Browser. All is done by netbeans, automatic. – moskito-x May 07 '15 at 14:52
  • yes, already tried put zend_extension inside [xdebug] section but did not work either. And netbeans didn't open a url in Browser normally, i need to put "XDEBUG_SESSION_START=netbeans-xdebug" to URL manually after running the debug in netbeans :) – SonDang May 08 '15 at 06:02
  • @SonDang, Looking at your answer, this is exactly what I meant when I mentioned as second option to open `localhost//page/?XDEBUG_SESSION_START=netbeans-xdebug` – arkoak May 11 '15 at 07:20
  • Please make sure that everything relevant from the article is included in your post, otherwise your post won't be helpful if the link is dead. – Black Apr 10 '18 at 19:45