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

查看:80
本文介绍了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可以正常工作.
  • 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.

推荐答案

每当我在新的Linux机器上安装"php xdebug"和netbeans时,我都会执行这些简单的步骤,并且始终设法实现corect集成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

找到库:

#查找/-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

...

根据您的情况重启Web服务器: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"进行相同操作

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

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

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

有关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天全站免登陆