1

I have spent a couple of days surfing the internet to find an answer to my question. I have tried everything I could but have been unsuccessful thus far in solving this problem. Netbeans keeps giving Waiting for Connection (netbeans-xdebug).

I am using the following software:

  • XAMPP Version 1.8.1.
  • Windows 7
  • Netbeans IDE 7.2.1
  • Xdebug 2.2.1

I installed the latest version according via the wizard for the xdebug.org site (http://xdebug.org/wizard.php). Xdebug is working according to phpinfo().The HMTL output in my browser (Firefox 17.0.1) shows xdebug code. However this is not communicated back to netbeans. Using Netstat via command prompt (Run -> cmd.exe) shows that there is a TCP connection on port 9000. However , nothing is reported back in Netbeans.

I have tried several different alternatives, for example:

  • Installing a similar IDE, Eclipse PDT. Eclipse shows that Xdebug is
    working. However, because Eclipse is lacking functions I need I
    wanted to use Netbeans.
  • Installing Netbeans on Ubuntu 12.04 LTS.
    Still the same problem. Netbeans not working (waiting for
    connection). Also output in browsers shows that Xdebug is working.
Mr. Radical
  • 1,847
  • 1
  • 19
  • 29

2 Answers2

1

Whenever I install on a new Linux machine: "php xdebug" and netbeans
I run these simple steps and I've always managed to corect integration of xdebug on netbeans.
So with the data you provide, I can only help you solve, the half of your problem.
Allowing you to connect on Linux machines:

Installation with pecl:

# apt-get install php5-dev php-pear
# pecl install xdebug

Or direct installation:

# apt-get install php5-xdebug

find the library:

# find / -name 'xdebug.so'
/usr/lib/php5/20090626+lfs/xdebug.so

Edit phi.ini file:

...

zend_extension=/usr/lib/php5/20090626+lfs/xdebug.so
xdebug.remote_enable=1
xdebug.remote_handler=dbgp
xdebug.remote_mode=req
xdebug.remote_host=127.0.0.1
xdebug.remote_port=9000

...

Restart web-server in your case: Apache

$ /etc/init.d/apache2 restart


According to what you have posted:

Installing Netbeans on Ubuntu 12.04 LTS.

I have used the installation method "apt-get" for distributions ".deb". If you are using a distribution ".rpm" can do the same with "yum"

Many of these commands are surely simplified within the xampp.
But if you running this commands from console will not affect the final result.


Another important note about Windows's machines and Linux's machines,
You should check that your firewall rules are allowing to establish a connection from netbeans to xdebug.

RTOSkit
  • 1,181
  • 1
  • 11
  • 23
  • Hi, thank you for you reply. I got it working in windows, however the way why I got it working is very strange. I had to set the port to "9001" and the proxy to "localhost". This is strange because the port in php.ini is set at 9000. – Mr. Radical Dec 15 '12 at 19:25
  • I will give Ubuntu a new try. B.T.W. I installed LAMP via Tasksel instead of XAMPP and followed the instruction on the Xdebug wizard site. I edited the xdebug.ini ($ sudo gedit /etc/php5/apache2/conf.d/xdebug.ini) file in the way as you did with php.ini. I added "xdebug.idekey=netbeans-xdebug" to the file. I didn't install UFW on Ubuntu at first so that wasn't a problem. I will now because a firewall is always a good security measure. – Mr. Radical Dec 15 '12 at 20:29
  • Netbeans and xdebug on Ubuntu is now up and running. Same solution as with windows, setting the port to 9001 did the trick. Very strange. – Mr. Radical Dec 15 '12 at 20:32
  • good work! On the windows surely the port is reserved to another process You could try to identify the conflict with [**TCPView**](http://technet.microsoft.com/en-us/sysinternals/bb897437.aspx) tool, or from console with [**netstat**](http://www.computerhope.com/netstat.htm) or want to find a mathematical answer to your problem could use [**Wireshark**](http://www.wireshark.org/) to see each packet processing – RTOSkit Dec 15 '12 at 20:47
  • There is no conflict with the ports as far as I can see. However, it is strange that setting a netbeans project to another port solves the problem. – Mr. Radical Dec 15 '12 at 21:50
1

I know this is old but for people using Ubuntu this might help.

OS Version = Ubuntu 14.04.3 LTS; Codename: trusty
PHP Version = PHP 5.5.9-1ubuntu4.11 (cli) (built: Jul  2 2015 15:17:32) 
Apache Version = Server version: Apache/2.4.7 (Ubuntu)

Procedure

  1. Install xdebug for php5
sudo apt-get install php5-xdebug
  1. Open php.ini and add the following lines below (usually sudo vim /etc/php5/apache2/php.ini)
xdebug.remote_enable=On;
xdebug.remote_host=127.0.0.1
xdebug.remote_port=9000;
xdebug.remote_handler="dbgp"; 
  1. Restart apache and your good to go
sudo service apache2 restart

Note 1: I have not tried doing this without firefox add-on for xdebug, so if after doing the procedure above and still to no avail, download the add-on for firefox Easy Xdebug

Note 2: I did not touch the PHP Configuration of Netbeans

Note 3: I did not touch xdebug.ini

KiX Ortillan
  • 210
  • 2
  • 13
  • Thank you for your answer. It is very well documented. I did already solve it with a while back, but as you mentioned it might help others. – Mr. Radical Aug 27 '15 at 22:21