Netbeans shows "Waiting for connection (netbeans-xdebug)"

I need help to configure xdebug, to debug projects from NetBeans networks.

These are the functions of my components:

XAMPP 1.8.2

PHP: 5.4.16

netbeans: 7.3.1

Apache: 2.4.4 (Win32)

this is the last 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 (), xdebug is not installed, and when I debug the project from netbeans, it says "Waiting for connection (netbeans-xdebug)".

can someone help me set it up? would greatly appreciate it.

early.

+50
php apache xdebug netbeans
Jul 12 '13 at 11:16
source share
18 answers

Have you fixed the problem? If not, try this.

1) Content of php.ini file

 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 could not debug with localhost and 127.0.0.1 .

in NetBeans IDE, go to Tools-> Options-> PHP-> Debugging. The values ​​of the debugger port and session identifier must match the port and idekey specified in php.ini

Now save php.ini, restart Apache and now try debugging

Thanks Johnson

+93
Aug 24 '13 at 12:50
source share

When Netbeans starts a debugging session, it starts two Listeners, one on 0.0.0.0:9000 (all IPv4-IP systems that are on the system) and the other on the IPv6 interface.

If Netbeans and the web server are on the same system, ideally XDebug will be configured to send data back to 127.0.0.1:9000 , on which NetBeans will listen (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 some reason XDebug cannot report back to 127.0.0.1 , or Netbeans does not listen to 127.0.0.1 , you can configure XDebug to send data back to $_SERVER['REMOTE_ADDR'] original request ...

 xdebug.remote_connect_back=1 

Thus, you do not need to specify the exact IP (i.e., as in the above answer LAN LAN: 192.168.1.5 ). The disadvantage here is that any source can connect.

If you have additional problems, this ...

 xdebug.remote_autostart=1 

... will also start the debugging process for all requests, and not just for those who have the correct request to start a session or cookie. The downside here is that all requests will trigger debugging data collection and reporting (making everything slower and generating more data).

Although from what I have compiled, most of these "Waiting for connectivity (netbeans-xdebug)" problems on Windows (with XAMPP, Wamp-Server, etc.) are usually the result of the Windows firewall and McAfee (or another firewall and antivirus software security) by blocking the connection ...

Source: Netbeans "Waiting for Connection (netbeans-xdebug)" Problem

+8
Dec 16 '14 at 21:33
source share

I am a .Net programmer and very new to PHP. I recently tried to host an open source PHP application on my machine (Windows). After the battle for 5-6 days, I will talk about the steps that worked for me.

I uninstalled all previous installations of XAMPP and NetBeans and proceeded with new installations.

It may not be a solution for everyone, but it worked for me, and I hope this helps someone.

  • install xampp

  • install netbeans for php.

  • Open IIS and stop it. It works on port 80 by default (I run XAMPP on port 80, that is, by default, additional configuration settings may be required to work on another port)

  • Open the XAMPP control panel and start Apache. If port 80 is free, the problem does not occur.

  • Open the local host in the browser should display the XAMPP home page.

  • open the phpinfo() link in the left pane and copy all the content on the page. Go to: http://xdebug.org/wizard.php and paste all the content into a TextBox and click on "Analyze my phpinfo output". It will buy you an Xdebug file suitable for your configuration.

  • Download this Xdebug DLL and copy it to C:\xampp\php\ext (Xampp is the default Xampp installation directory)

  • Open the XAMPP control panel, click the Config button in front of Apache and select php.in ,

  • Find a line similar or similar,

; zend_extension = "C: \ xampp \ php \ ext \ php_xdebug.dll"

(semicolon means commented out)

Delete the semicolon and replace the path with the path you just copied:

 zend_extension = "C:\xampp\php\ext\php_xdebug-2.3.2-5.4-vc9.dll" 
  1. Similarly find strings

    ; xdebug.remote_enable = 0; xdebug.remote_handler = "dbgp"

remove the semicolons in front of both lines and do remote_enable = 1

 xdebug.remote_enable = 1 xdebug.remote_handler = "dbgp" 
  1. Restart the Apache server.

  2. Copy the code of your site to C:/XAMPP/htdocs/(your_website)/ this means that your index.php should be in C:/XAMPP/htdocs/(your_website)/index.php

  3. To open Netbeans, select New Project β†’ PHP β†’ PHP Project from an existing source and select the folder that you just copied to the htdocs folder. Install it to run on the local web server.

  4. Set a breakpoint on the first line of index.php and debug it.

What is it.

Additional settings were suggested at different posts, but the steps above worked fine for me.

+3
May 30 '15 at 5:49
source share

I just spent hours reading so many answers on this page, while others liked it and no one mentioned that it turned out to be a solution for me:

Make sure that the selected port settings match in all three places.

My problem was that there are three places that should match the selected port. Two of mine said 9001 and one said 9000. I changed them all to 9000.

That was the problem, and why Netbeans will only say "Waiting for connection (netbeans-xdebug)".

Location settings 3 ports:

  • php.ini ( xdebug.remote_port=9000 )
  • project properties> Run configuration> Advanced
  • Netbeans> Tools> Options> PHP> Debugging
+2
Jan 20 '17 at 16:25
source share

In my case, the Apache log showed a PHP warning that date.timezone was not set. Xdebug / netbeans started working as soon as I installed it in php.ini and restarted apache.

 date.timezone = America/Los_Angeles 

This is PHP 5.5.

+1
Aug 20 '13 at 21:47
source share

Also check the window firewall settings.

For me, this did not work because my LAN was advertised as a "Public Network". After I switched it to Work Network, it worked fine.

+1
Jul 12 '14 at 8:59
source share

I am on Windows with xampp and changed the [XDebug] section of my php.ini (below) to the following to make it work:

 zend_extension = "C:\xampp\php\ext\php_xdebug.dll" xdebug.remote_enable=on xdebug.remote_handler=dbgp xdebug.remote_host=localhost xdebug.remote_port=9000 

Obtained from the Netbeans wiki here: http://wiki.netbeans.org/HowToConfigureXDebug

If you have Apache running, be sure to restart it after setting up XDebug and saving php.ini.

+1
Nov 18 '14 at 10:20
source share

Adding this did the job for me:

 xdebug.idekey=netbeans-xdebug 
+1
Feb 25 '15 at 9:09
source share

In my case, if I add the following to php ini, this did not work

zend_extension_ts = "C: \ PHP \ PHP560 \ ext \ php_xdebug-2.4.0rc4-5.6-vc11.dll"

But if I add

zend_extension = "C: \ PHP \ PHP560 \ ext \ php_xdebug-2.4.0rc4-5.6-vc11.dll"

It works great.

+1
Jun 04 '16 at 7:42 on
source share

I want to mention something here about xdebug.remote_host

 xdebug.remote_host="127.0.0.1" 

Not valid. It may work in some cases, but quotes can also cause problems. Most people have no problem using quotes around IP addresses, but this sets a bad precedent. This makes people think that if you want to use the hostname or URL, you need to put it in quotation marks. This is not true, quotation marks will not work.

If you want to debug the use of the URL, you can do this by simply placing the URL after the following values:

 xdebug.remote_host=subdomain.mydomain.com 

I also want to mention that if you have a port number, do not add it. This does not work:

 xdebug.remote_host=subdomain.mydomain.com:9000 

This is what you want to do:

 xdebug.remote_host=subdomain.mydomain.com xdebug.remote_port=9000 

If you do this, I also warned you that remote_connect_back is disabled. Like this:

 xdebug.remote_connect_back=0 

or you can completely exclude it, for example:

 ;xdebug.remote_connect_back=1 

If remote_connect_back is enabled, it will try to pull your IP address from the incoming connection and ignore the remote_host and port settings.

Xdebug uses plain old TCP to connect. This is not HTTP. This means that tools like Fiddler will not display packages or debugging information. If you need to debug and see if the server is going to your IDE, there are several ways to check it.

Wireshark lets you see TCP traffic. Also, if you are on Windows, Microsoft Message Analyzer can also control TCP.

But if all you are trying to do is to remove your IDE - a possible cause of problems with remote debugging, I suggest starting a local TCP server instead.

This is a great free java program to run a TCP server: http://sockettest.sourceforge.net/

How to start a TCP server

In the IP Address section, simply enter 127.0.0.1 or leave it at 0.0.0.0. Then specify the port number, which is usually 9000 for xdebug by default.

Once the TCP server is started, open the remote web page using xdebug_break (); function call in it. This will tell xdebug on the remote server to start debugging on any server and port specified in your php.ini.

Keep an eye on the socket server and see if you have a connection. The first data sent should look something like this:

 <init appid="APPID" idekey="IDE_KEY" session="DBGP_COOKIE" thread="THREAD_ID" parent="PARENT_APPID" language="LANGUAGE_NAME" protocol_version="1.0" fileuri="file://path/to/file"> 

If you have made it this far, remote debugging works! Just stop the server and configure your IDE to listen on this port!




If you are like most of us, your development machine is behind a NAT router. This means that everyone in your office has the same IP address. This is a problem because when xdebug contacts this IP address to start debugging, it gets to the router and not to your computer. The router can be configured to transfer certain port numbers to individual computers, but you may not want to do this, since this port will be open until you change the settings of your router.

Another option is to use SSH. There is a great example of how to do it here: http://stuporglue.org/setting-up-xdebug-with-netbeans-on-windows-with-a-remote-apache-server/#attachment_1305

My preferred option is to use Ngrok . Ngrok is a great tool for redirecting http, https and TCP traffic. To use the TCP forwarding feature, you need to register for a free account.

Once you have signed up for an account and added your API key to your computer, run this command on the computer on which your ID environment is installed:

 ngrok tcp 9000 

This will open the tcp (not http) tunnel from the ngrok server to any computer on which you ran the command. I use port 9000, you can change this port if your IDE is configured for another Xdebug port.

This is what you should see:

Ngrok tcp tunnel open

You will need to see that the TCP tunnel URL has been opened. In this example, this is:

 0.tcp.ngrok.io:14904 

For this session, the Xdebug parameter on your server should be as follows:

 xdebug.remote_host=0.tcp.ngrok.io xdebug.remote_port=14904 

The URL and port will change each time ngrok starts. If you want to have the same URL and port, you need to go to a paid account. Be sure to restart apache after making changes to your php.ini.

+1
Sep 12 '16 at 16:22
source share

Having correctly configured the php.ini file, netbeans, port forwarding on the router, I still got a miserable "connection wait (netbeans-xdebug). In the end, I noticed on the netbeans page" Remember to set output_buffering = Off in your php.ini file " .

So, I checked the file / etc / php / 7.x / apache2 / php.ini and, of course, its value was 4096. So, I reset output_buffering = Off and it will work !!!

Hope this helps someone, as the message implies that this is a connection error, not a configuration error.

+1
Mar 03 '17 at 17:11
source share

check this: Launch XDebug in Netbeans by external request




Another way is to open a new window:

try going to Project> run configuration> advance

and switch to the default value, check if it will open another window in the browser

0
Mar 19 '14 at 5:46
source share

Try running php -i in the command window. There was an error while redirecting output

For me, this was the final decision because I had the wrong version of Xdebug being downloaded

For me it should have been: php_xdebug-2.1.2-5.3-vc6.dll

But I had: php_xdebug-2.2.4-5.3-vc9.dll . So an error occurred from php -i

 E:\Programme\php>php -i > myOutputFromPhp 

next ERROR is displayed

Unable to load Xdebug - it was built with the configuration of API220090626, TS, VC9, while the API220090626, TS, VC6 engine is running

0
Apr 07 '14 at 8:55
source share

I had the same problem. What for? First I installed WAMP, thanks to Netbeans, and they work together like a charm. Later, I installed the XAMPP and Localhost sites, which worked smoothly, but NetBeans could never connect to XAMPP (netbeans-xdebug). At the same time, NetBeans worked well with Wamp.

My solution was to return to Wamp. This is better than nothing.

My computer: Win-7-32, NetBeans-8.0.2,

wampserver2.5-Apache-2.4.9-Mysql-5.6.17-php5.5.12-32b

XAMPP-win32-5.6.8-0-VC11

0
May 14 '15 at
source share

For Ubuntu users:

  • sudo su
  • apt-get install php5-dev php-pear
  • pecl install xdebug
  • find / -name 'xdebug.so' 2> / dev / null
  • it will return something like: /usr/lib/php5/20121212/xdebug.so
  • vi / etc / php5 / apache2 / php.ini
  • add this line: zend_extension = "/usr/lib/php5/20121212/xdebug.so"
  • apache2 restart service
  • reboot IDE
0
May 15 '15 at 7:36
source share

I spent a lot of time trying to get the best setup, and this deserves my own answer, although @Johnson TA is almost right.

He says

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

Well, not everyone can use a private address, or it can be dynamic or different. In addition, in my case, I had a hard time, a very long wait time before debugging actually started - 30 s or so each time. It was impractical.

I am sure that everyone who has these problems, at least on Windows 7 or so. The problem is with the combination of name resolution and xdebug. To overcome them, make sure that:

  • Port 9000 is not used. If this happens, replace it with an unused one in both php.ini and netbeans.
  • Make sure xdebug.remote_enable on .
  • If you want to be able to debug using localhost and 127.0.0.1 , open \Windows\System32\drivers\etc and make sure you have the following lines:

    127.0.0.1 localhost

    :: 1 localhost

Make sure the first line does not have # in front of it, and the second has it.

My working section is php.ini (I don’t need a profiler, so I disabled it):

 [XDebug] zend_extension = "C:\xampp\php\ext\php_xdebug.dll" xdebug.profiler_append = 0 xdebug.profiler_enable = 0 xdebug.remote_enable = on xdebug.remote_handler = "dbgp" xdebug.remote_host = "localhost" xdebug.remote_port = 9001 xdebug.trace_output_dir = "C:\xampp\tmp" xdebug.remote_log = "C:\xampp\tmp\xdebug\xdebug.log" xdebug.idekey = "netbeans-xdebug" xdebug.remote_autostart = on xdebug.remote_connect_back = on 

Disable the netbeans debugger. Restart Apache.

I bet you will no longer suffer from long wait times or strange behavior with a debugger.

Explanation: Although they say in etc / hosts that "resolving the local host name is handled in the DNS itself," for some reason this does not work very well with xdebug unless you explicitly specify it in this file. I clearly believe that this will not hurt in general, and solves this problem with xdebug. But also you need to explicitly disable the sIPv6 short notation for localhost (:: 1) for this to work. I don’t know the internal reasons, but triead are all combinations, and it works for me like a charm.

0
May 28 '15 at 10:30
source share

I had this problem for one project, but not for others. So, xdebug was configured correctly, the project settings were fine, but it still didn't work.

So, I just deleted the nbproject subdirectory containing the project settings and created a new project with an existing source. This solved the problem for me.

0
Dec 14 '15 at 15:40
source share

Select a dedicated browser for debugging:

  • Right click on the project -> select Properties
  • Select categories: The browser then selects a specific browser for debugging.
0
Mar 30 '16 at 5:03
source share



All Articles