简体   繁体   中英

Netbeans Xdebug on Windows 7 “waiting for connection” WAMP

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配置

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

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.

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"

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!!!!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM