Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
366 views
in Technique[技术] by (71.8m points)

xampp - Xdebug and Netbeans are not communicating with each other

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.
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...