Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

netbeans shows "Waiting For Connection (netbeans-xdebug)"

need help to configure xdebug, for debugging projects from IDE netbeans.

These are the features of my components:

XAMPP 1.8.2

PHP: 5.4.16

netbeans: 7.3.1

Apache: 2.4.4 (Win32)

this is the final part of my php.ini file:

 [XDebug]  zend_extension = "C:\xampp\php\ext\php_xdebug-2.2.3-5.4-vc9-nts.dll"  ;xdebug.profiler_append = 0  ;xdebug.profiler_enable = 1  ;xdebug.profiler_enable_trigger = 0  xdebug.profiler_output_dir = "C:\xampp\tmp"  ;xdebug.profiler_output_name = "cachegrind.out.%t-%s"  xdebug.remote_enable = 1  xdebug.remote_handler = "dbgp"  xdebug.remote_host = "127.0.0.1"  ;xdebug.trace_output_dir = "C:\xampp\tmp" 

when I run phpinfo(), there is no xdebug installed, and when I debug a project from netbeans, it says "Waiting For Connection (netbeans-xdebug)".

can someone help me to configure it? would be very appreciated.

thanks in advance.

like image 570
pasluc74669 Avatar asked Jul 12 '13 11:07

pasluc74669


2 Answers

Have you rectified the issue ? If not then please try this.

1.) php.ini file content

[xDebug] zend_extension = "c:\xampp\php\ext\php_xdebug-2.2.3-5.4-vc9.dll" xdebug.remote_autostart=on xdebug.remote_enable=on xdebug.remote_enable=1 xdebug.remote_handler="dbgp" ;xdebug.remote_host="localhost:81" xdebug.remote_host=192.168.1.5 ;xdebug.remote_connect_back=1 xdebug.remote_port=9000 xdebug.remote_mode=req xdebug.idekey="netbeans-xdebug" 

xdebug.remote_host=192.168.1.5 - This is the IPv4 address of my system, I changed to this because I couldn't debug with localhost and 127.0.0.1.

in NetBeans IDE, open Tools-> Options -> PHP -> Debugging. The values of debugger port and Session Id should match with the port and idekey specified in php.ini.

Now save php.ini, restart Apache and try to debug.

Thanks Johnson

like image 56
Johnson T A Avatar answered Sep 19 '22 14:09

Johnson T A


When Netbeans starts a Debugging session, it starts two Listeners, one on 0.0.0.0:9000 (all IPv4 IPs the system has), and the other on the IPv6 interface.

If Netbeans and the Web Server are on the same system, ideally XDebug would be configured to send the data back to 127.0.0.1:9000, on which NetBeans would be listening on (and only per session)...

xdebug.remote_enable=1 xdebug.remote_handler=dbgp xdebug.remote_host=127.0.0.1 xdebug.remote_port=9000 xdebug.remote_autostart=0 xdebug.remote_connect_back=0 

If for whatever reason XDebug is not able to report back to 127.0.0.1, or Netbeans is not listening on 127.0.0.1, you can configure XDebug to send the data back to the $_SERVER['REMOTE_ADDR'] of the original request...

xdebug.remote_connect_back=1 

This way you don't have to specify the exact IP (i.e., as in the above answer the LAN IP: 192.168.1.5). The downside here is that any source can connect.

If you have further trouble, this...

xdebug.remote_autostart=1 

... will also start the debugging process for all requests, and not just for the ones with the proper session start query or cookie. The downside here is that all requests will initiate debug data collection and reporting back (making everything slower, and generating more data).

Though from what I've gathered, the majority of these "Waiting For Connection (netbeans-xdebug)" issues on Windows (with XAMPP, Wamp-Server, etc) are usually a result of Windows Firewall and McAfee (or other firewall and anti-virus software) blocking the connection...

Source: Netbeans "Waiting For Connection (netbeans-xdebug)" Issue

like image 38
rightstuff Avatar answered Sep 20 '22 14:09

rightstuff