Xdebug 和 Netbeans 没有相互通信 [英] Xdebug and Netbeans are not communicating with each other

查看:17
本文介绍了Xdebug 和 Netbeans 没有相互通信的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我花了几天时间上网寻找问题的答案.我已尽我所能,但迄今为止未能成功解决这个问题.Netbeans 不断提供等待连接 (netbeans-xdebug).

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).

我正在使用以下软件:

  • XAMPP 版本 1.8.1.
  • Windows 7
  • Netbeans IDE 7.2.1
  • Xdebug 2.2.1

我通过 xdebug.org 站点 (http://xdebug.org/wizard.php) 的向导安装了最新版本.Xdebug 正在根据 phpinfo() 工作.我的浏览器(Firefox 17.0.1)中的 HMTL 输出显示了 xdebug 代码.但是,这不会传回给 netbeans.通过命令提示符(运行 -> cmd.exe)使用 Netstat 显示端口 9000 上有 TCP 连接.但是,在 Netbeans 中没有报告任何内容.

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:

  • 安装类似的 IDE,Eclipse PDT.Eclipse 显示 Xdebug 是
    在职的.但是,因为 Eclipse 缺少我需要的功能,所以我
    想使用Netbeans.
  • 在 Ubuntu 12.04 LTS 上安装 Netbeans.
    还是同样的问题.Netbeans 不工作(等待
    联系).浏览器中的输出也显示 Xdebug 正在运行.

推荐答案

每当我在新的 Linux 机器上安装:php xdebug"和 netbeans
我运行这些简单的步骤,我总是设法纠正集成netbeans 上的 xdebug.
所以以你提供的数据,我只能帮你解决,你问题的一半.
允许您在 Linux 机器上连接:

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:

使用 pecl 安装:

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

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

或者直接安装:

# apt-get install php5-xdebug

# apt-get install php5-xdebug

找到图书馆:

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

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

编辑 phi.ini 文件:

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

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

...

在你的情况下重启网络服务器:Apache

$/etc/init.d/apache2 重启

$ /etc/init.d/apache2 restart


根据你发布的内容:

在 Ubuntu 12.04 LTS 上安装 Netbeans.

Installing Netbeans on Ubuntu 12.04 LTS.

我对发行版.deb"使用了安装方法apt-get".如果您使用的是发行版,.rpm"可以用yum"做同样的事情

许多这些命令在 xampp 中肯定得到了简化.
但是如果你从控制台运行这个命令不会影响最终结果.

关于 Windows 机器和 Linux 机器的另一个重要说明,
您应该检查您的防火墙规则是否允许建立从 netbeans 到 xdebug 的连接.

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.

这篇关于Xdebug 和 Netbeans 没有相互通信的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆