netbeans显示“等待连接(netbeans-xdebug)”

时间:2023-01-18 08:59:35

need help to configure xdebug, for debugging projects from IDE netbeans.

需要帮助配置xdebug,用于从IDE netbeans调试项目。

These are the features of my components:

这些是我的组件的特点:

XAMPP 1.8.2

XAMPP 1.8.2

PHP: 5.4.16

PHP:5.4.16

netbeans: 7.3.1

netbeans:7.3.1

Apache: 2.4.4 (Win32)

Apache:2.4.4(Win32)

this is the final part of my php.ini file:

这是php的最后一部分。ini文件:

 [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(), there is no xdebug installed, and when I debug a project from netbeans, it says "Waiting For Connection (netbeans-xdebug)".

当我运行phpinfo()时,没有安装xdebug,当我从netbeans调试一个项目时,它会说“等待连接(netbeans-xdebug)”。

can someone help me to configure it? would be very appreciated.

有人能帮我配置一下吗?将会非常感激。

thanks in advance.

提前谢谢。

21 个解决方案

#1


102  

Have you rectified the issue ? If not then please try this.

你纠正这个问题了吗?如果没有,请尝试一下。

1.) php.ini file content

1 . php)。ini文件内容

[xDebug]
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 couldn't debug with localhost and 127.0.0.1.

xdebug.remote_host=192.168.1.5 -这是我的系统的IPv4地址,我改变了这一点,因为我无法与localhost和127.0.0.1进行调试。

in NetBeans IDE, open Tools-> Options -> PHP -> Debugging. The values of debugger port and Session Id should match with the port and idekey specified in php.ini.

在NetBeans IDE中,打开工具->选项-> PHP ->调试。调试器端口和会话Id的值应该与php.ini中指定的端口和idekey匹配。

Now save php.ini, restart Apache and try to debug.

现在保存php。ini,重启Apache并尝试调试。

Thanks Johnson

由于约翰逊

#2


8  

When Netbeans starts a Debugging session, it starts two Listeners, one on 0.0.0.0:9000 (all IPv4 IPs the system has), and the other on the IPv6 interface.

当Netbeans启动一个调试会话时,它将启动两个侦听器,一个在0.0.0.0:9000(所有的IPv4 IPs系统都有),另一个在IPv6接口上。

If Netbeans and the Web Server are on the same system, ideally XDebug would be configured to send the data back to 127.0.0.1:9000, on which NetBeans would be listening on (and only per session)...

如果Netbeans和Web服务器在同一系统上,最好将XDebug配置为将数据发送回127.0.0.1 . 9000,其中Netbeans会监听(并且仅在每个会话中)……

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 whatever reason XDebug is not able to report back to 127.0.0.1, or Netbeans is not listening on 127.0.0.1, you can configure XDebug to send the data back to the $_SERVER['REMOTE_ADDR'] of the original request...

如果出于某种原因,XDebug无法返回127.0.0.1,或者Netbeans没有监听127.0.0.1,您可以配置XDebug将数据发送回原始请求的$_SERVER['REMOTE_ADDR']…

xdebug.remote_connect_back=1

This way you don't have to specify the exact IP (i.e., as in the above answer the LAN IP: 192.168.1.5). The downside here is that any source can connect.

这样您就不必指定确切的IP(即:,如上所述,局域网IP: 192.168.1.5。这里的缺点是任何源都可以连接。

If you have further trouble, this...

如果你有进一步的麻烦,这…

xdebug.remote_autostart=1

... will also start the debugging process for all requests, and not just for the ones with the proper session start query or cookie. The downside here is that all requests will initiate debug data collection and reporting back (making everything slower, and generating more data).

…还将启动所有请求的调试过程,而不只是针对具有适当会话启动查询或cookie的请求。这里的缺点是,所有请求都将启动调试数据收集和报告(使所有事情变得更慢,并生成更多数据)。

Though from what I've gathered, the majority of these "Waiting For Connection (netbeans-xdebug)" issues on Windows (with XAMPP, Wamp-Server, etc) are usually a result of Windows Firewall and McAfee (or other firewall and anti-virus software) blocking the connection...

尽管从我收集的内容来看,大多数“等待连接(netbeans-xdebug)”的问题(使用XAMPP、Wamp-Server等)通常都是Windows防火墙和McAfee(或其他防火墙和杀毒软件)阻止连接的结果。

Source: Netbeans "Waiting For Connection (netbeans-xdebug)" Issue

来源:Netbeans“等待连接(Netbeans -xdebug)”问题

#3


5  

I am a .Net programmer and very new to PHP. Recently I was trying to host an open source PHP application on my machine(Windows). After the Struggle for 5-6 days I will list the steps which worked for me.

我是一个。net程序员,非常熟悉PHP。最近,我尝试在我的机器上(Windows)上托管一个开源PHP应用程序。在奋斗了5-6天之后,我将列出为我工作的步骤。

I uninstalled every previous installations of XAMPP and NetBeans and proceeded with fresh installations.

我卸载了XAMPP和NetBeans之前的所有安装,并进行了新的安装。

This might not be the solution for everyone but it worked for me and I hope it helps someone.

这可能不是每个人都能解决的问题,但对我来说是有效的,我希望它能帮助别人。

  1. install XAMPP

    安装XAMPP

  2. install netbeans for PHP.

    安装netbeans PHP。

  3. Open IIS and stop it. It is running on port 80 by default.(I am running XAMPP on port 80 i.e. default, Running on other port might need additional configuration settings)

    打开IIS并停止它。默认情况下,它在端口80上运行。(我在端口80上运行XAMPP,即默认情况下,在其他端口上运行可能需要额外的配置设置)

  4. Open XAMPP control panel and start Apache. If port 80 is free no problem should arise.

    打开XAMPP控制面板并启动Apache。如果端口80是免费的,就不会出现问题。

  5. Open localhost in browser in should display XAMPP home page.

    在浏览器中打开localhost应该显示XAMPP主页。

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

    在左窗格上打开phpinfo()链接,并将所有内容复制到页面上。访问:http://xdebug.org/wizard.php,并将所有内容粘贴到文本框中,然后单击分析我的phpinfo输出。它将为您提供适合您的配置的Xdebug文件。

  7. Download the given Xdebug dll and copy it in C:\xampp\php\ext (Xampp being the default Xampp installation directory)

    下载给定的Xdebug dll并将其复制到C:\xampp\php\ext (xampp是默认的xampp安装目录)

  8. Goto XAMPP control panel, click on Config button in front of Apache and select php.in,

    Goto XAMPP控制面板,点击Apache前面的Config按钮,选择php.in,

  9. Find line similar or exacly like,

    找到类似或完全一样的线,

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

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

(Semicolon means it is commented)

(分号表示注释)

Remove the semicolon and replace the path with the path of dll you just copied like:

删除分号,用你刚才复制的dll路径替换路径:

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

    同样找到线

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

    xdebug。xdebug remote_enable = 0。remote_handler = " dbgp "

remove semicolons in front of both lines and make remote_enable = 1

在两行前面删除分号,并使remote_enable = 1。

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

    重新启动Apache服务器。

  2. Copy your website code under C:/XAMPP/htdocs/(your_website)/ that means your index.php should be at C:/XAMPP/htdocs/(your_website)/index.php

    复制你的网站代码在C:/XAMPP/htdocs/(your_website)/这意味着你的索引。php应该在C:/XAMPP/htdocs/(your_website)/index.php中。

  3. Open Netbeans select New project -> PHP -> PHP project from existing source and select the folder you just copied in htdocs folder. Set it to run on Local web server.

    打开Netbeans选择新项目-> PHP -> PHP项目从现有的源代码,并选择你刚才拷贝在htdocs文件夹中的文件夹。将其设置为在本地web服务器上运行。

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

    在索引的第一行设置断点。php和调试。

That's it.

就是这样。

Additional settings were suggested on various different posts but above mentioned steps worked perfectly for me.

在各种不同的岗位上都有额外的设置,但是上面提到的步骤对我来说是完美的。

#4


3  

I just spent hours reading so many answers on this page and others like it, and nobody mentioned what ended up being the solution for me:

我花了几个小时在这一页上读了这么多的答案,还有一些人喜欢它,没人提到我的解决方案是什么:

Make Sure Your Chosen Port Settings Match in All 3 Locations

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

我的问题是,选择的端口需要匹配三个位置。我的两个说9001,一个说9000。我把它们都改成了9000。

That was the problem and why Netbeans would only say “Waiting For Connection (netbeans-xdebug)”.

这就是问题所在,为什么Netbeans只说“等待连接(Netbeans -xdebug)”。

The 3 port setting locations are:

3个港口设置地点为:

  • php.ini (xdebug.remote_port=9000)
  • php。ini(xdebug.remote_port = 9000)
  • project properties > Run Configuration > Advanced
  • 项目属性>运行配置>高级。
  • Netbeans > Tools > Options > PHP > Debugging
  • Netbeans >工具>选项> PHP >调试。

#5


3  

I want to mention something here about xdebug.remote_host

我想在这里提到xdebug.remote_host。

xdebug.remote_host="127.0.0.1"

Is Not valid. It may work in some cases, but the quotes can also cause issues. Most people don't have issues when using IP addresses in quotes, but this sets a bad precedent. It makes people think that if you want to use a hostname or URL you need to put it in quotes. This is incorrect, urls in quotes will not work.

不是有效的。它可能在某些情况下起作用,但是引号也会引起问题。大多数人在使用IP地址时没有问题,但这是一个不好的先例。它使人们认为,如果您想要使用主机名或URL,您需要将其放入引号中。这是错误的,引号中的url将不起作用。

If you want to debug using a url, you can do this by just putting the url after the equals like this:

如果想要使用url进行调试,可以通过将url放在等号后面来实现:

xdebug.remote_host=subdomain.mydomain.com

I also want to mention that if you have a port number, don't add it. This doesn't 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 caution you make sure remote_connect_back is disabled. Like this:

如果您这样做,我还警告您确保remote_connect_back是禁用的。是这样的:

xdebug.remote_connect_back=0

or you can ommit it entirely, like this:

或者你也可以完全忽略它,像这样:

;xdebug.remote_connect_back=1

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

如果启用remote_connect_back,它将尝试从传入的连接中提取您的IP地址,并忽略remote_host和端口设置。

Xdebug uses plain old TCP to make connections. This is not HTTP. This means tools like Fiddler will not show any packets or information on debugging. If you need to debug, and see if the server is making a call to your IDE there are a few ways you can go about checking.

Xdebug使用普通的TCP来连接。这不是HTTP。这意味着像Fiddler这样的工具不会显示任何数据包或关于调试的信息。如果您需要调试,并查看服务器是否正在对您的IDE进行调用,您可以进行一些检查。

Wireshark will allow you to see TCP traffic. Also if you are on Windows, Microsoft Message Analyzer can also monitor TCP.

Wireshark将允许您查看TCP流量。同样,如果你在Windows上,微软的消息分析器也可以监控TCP。

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

但是,如果您所要做的只是移除您的IDE,这可能是远程调试问题的原因,我建议您启动一个本地TCP服务器。

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

这是一个启动TCP服务器的很棒的免费java程序:http://sockettest.sourceforge.net/。

netbeans显示“等待连接(netbeans-xdebug)”

In the IP Address section, just list 127.0.0.1 or leave it at 0.0.0.0. Then list the port number, which is usually defaulted to 9000 for xdebug.

在IP地址部分,只需列出127.0.0.1或将其保留为0.0.0.0。然后列出端口号,它通常默认为9000,用于xdebug。

Once the TCP server is running, open your remote webpage with an xdebug_break(); function call in it. This will tell xdebug on the remote server to start debugging on whatever server and port you listed in your php.ini.

一旦TCP服务器运行,打开您的远程页面,并使用xdebug_break();函数调用。这将告诉远程服务器上的xdebug启动在php.ini中列出的任何服务器和端口上的调试。

Watch the socket server and see if you get 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 is working! Just stop the server and setup your IDE to listen on that port!

如果您已经做到了这一点,那么远程调试正在工作!停止服务器并设置您的IDE监听那个端口!


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

如果您和我们大多数人一样,您的开发人员机器在NAT之后,这意味着您办公室的每个人都有相同的公共IP地址。这是一个问题,因为当xdebug接触到IP地址开始调试时,它会击中路由器,而不是你的计算机。可以将路由器配置为将某些端口号传递给单个计算机,但您可能不希望这样做,因为端口将打开,直到您更改路由器设置。

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

另一种选择是使用SSH。这里有一个很好的例子来说明如何做到这一点:http://stuporglue.org/settingxdebug -with-netbeans-on-window -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. In order to use the TCP redirect function you need to sign up for a free account.

我的首选是使用Ngrok。Ngrok是一个用于重定向http、https和TCP流量的好工具。为了使用TCP重定向功能,您需要注册一个免费帐户。

Once you have signed up for an account, and added your API key to your computer run this command on the computer that your IDE is on:

一旦您注册了一个帐户,并将您的API密钥添加到您的计算机上,在计算机上运行这个命令,您的IDE就在上面:

ngrok tcp 9000

This will open a tcp (not http) tunnel from the ngrok server to whatever machine you ran the command on. I am using port 9000, you can change this port if your IDE is configured for a different Xdebug port.

这将打开一个tcp(不是http)隧道从ngrok服务器到任何你运行命令的机器。我正在使用端口9000,如果您的IDE配置了一个不同的Xdebug端口,您可以更改这个端口。

This is what you should see:

这是你应该看到的:

netbeans显示“等待连接(netbeans-xdebug)”

You will need to see what the url is for the TCP tunnel that was opened. In this example it is:

您需要查看打开的TCP通道的url。在这个例子中,它是:

0.tcp.ngrok.io:14904

For this session, the Xdebug setting on your server should be this:

对于这个会话,服务器上的Xdebug设置应该是这样的:

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

The URL and port will change each time ngrok is launched. If you want to have the same url and port, you have to upgrade to a paid account. Make sure to restart apache after you make changes to your php.ini.

每次启动ngrok时,URL和端口都会发生变化。如果你想拥有相同的url和端口,你必须升级到付费帐户。在对php.ini进行更改之后,确保重新启动apache。

#6


2  

Check also the "windows" firewall settings.

检查“windows”防火墙设置。

For me it doesn't worked because my LAN network was declared as "Public network". After i switched it to "Work network" it worked fine.

对我来说,它不起作用,因为我的局域网被宣布为“公共网络”。当我把它转换成“工作网络”后,它运行得很好。

#7


1  

In my case the Apache log showed a PHP warning about not having set date.timezone. Xdebug/netbeans began working as soon as I set it in php.ini and restarted apache.

在我的例子中,Apache日志显示了一个关于没有设置日期的PHP警告。Xdebug/netbeans在我用php设置的时候就开始工作了。ini并重新启动apache。

date.timezone = America/Los_Angeles

This is PHP 5.5.

这是PHP 5.5。

#8


1  

I'm on Windows with xampp and changed the [XDebug] section of my php.ini (at the bottom) to the following to get it working:

我使用xampp在Windows上,并更改了php的[XDebug]部分。ini(在底部)到下面来让它工作:

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

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

来自Netbeans wiki: http://wiki.netbeans.org/HowToConfigureXDebug。

If you have Apache running, remember to restart it after configuring XDebug and saving php.ini.

如果您有Apache运行,请记住在配置了XDebug并保存php.ini之后重新启动它。

#9


1  

Adding this did work for me:

他补充道:

xdebug.idekey=netbeans-xdebug   

#10


1  

I my case if I add following in php ini it did not work

如果我在php ini中添加以下内容,我的情况就不一样了。

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

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"

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

It is working fine.

它工作正常。

#11


1  

Having correctly set up the php.ini file, netbeans, port forwarding on the router, I was still getting the wretched "waiting for connection (netbeans-xdebug). I eventually noticed on the netbeans page "Do not forget to set output_buffering = Off in your php.ini file".

正确设置了php。在路由器上的ini文件、netbeans、端口转发,我还在等待“等待连接”(netbeainxdebug)。我最终在netbeans页面上注意到“不要忘记在php中设置output_buffering = Off”。ini文件”。

So I checked the /etc/php/7.x/apache2/php.ini file and sure enough it's value was 4096. So I reset output_buffering=Off and lo it worked !!!

所以我检查了/etc/php/7.x/apache2/php。ini文件,它的值是4096。所以我重置了output_buffering=Off,并且它成功了!!!

Hope this helps someone, as the message implies it is a connection error rather than a configuration error.

希望这有助于某人,因为消息暗示它是一个连接错误,而不是一个配置错误。

#12


0  

check this out: Launch XDebug in Netbeans on an external request

检查这个:在Netbeans中对外部请求启动XDebug。


another way is to open a new window:

另一种方法是打开一个新窗口:

try to go on Project > run configuration > advance

试着继续>运行配置>。

and switch to default, check if it opens another window in the browser

然后切换到默认值,检查它是否在浏览器中打开了另一个窗口。

#13


0  

A try could be to start php -i in command window. When redirecting the output an error was

可以尝试在命令窗口中启动php -i。当重定向输出时,错误是。

For me it was the FINAL solution because I had a wrong version of Xdebug downloaded

对我来说,这是最终的解决方案,因为我下载了错误的Xdebug版本。

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

对我来说,它应该是: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

但我有:php_xdebug vc9.dll——2.2.4 - 5.3。所以php -i出现了一个错误。

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

yields following ERROR

产量跟踪误差

Cannot load Xdebug - it was built with configuration API220090626,TS,VC9, whereas running engine is API220090626,TS,VC6

不能加载Xdebug -它是通过配置API220090626,TS,VC9构建的,而运行的引擎是API220090626,TS,VC6。

#14


0  

I had the same problem. why? First I installed WAMP, thank Netbeans and they work together as a charm. Later I installed XAMPP and Localhost sites were run smoothly but NetBeans could never connect to XAMPP (netbeans-xdebug). At the same time NetBeans were working good with Wamp.

我遇到了同样的问题。为什么?首先,我安装了WAMP,感谢Netbeans,它们协同工作,作为一种魅力。后来,我安装了XAMPP和Localhost站点,但是NetBeans无法连接XAMPP (NetBeans -xdebug)。与此同时,NetBeans也在使用Wamp。

My solution was to go back to Wamp. It is better than nothing.

我的解决办法是回到Wamp。总比没有好。

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

我的电脑:Win-7-32 NetBeans-8.0.2,

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

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

xampp-win32-5.6.8-0-VC11

xampp-win32-5.6.8-0-VC11

#15


0  

For Ubuntu users:

对于Ubuntu用户:

  1. sudo su
  2. sudo苏
  3. apt-get install php5-dev php-pear
  4. apt-get安装php5-dev php-pear
  5. pecl install xdebug
  6. pecl安装xdebug
  7. find / -name 'xdebug.so' 2> /dev/null
  8. 找到/ - name ' xdebug。所以“2 > / dev / null
  9. it will return something like: /usr/lib/php5/20121212/xdebug.so
  10. 它将返回如下内容:/usr/lib/php5/20121212/xdebug.so。
  11. vi /etc/php5/apache2/php.ini
  12. vi /etc/php5/apache2/php.ini
  13. add this line: zend_extension="/usr/lib/php5/20121212/xdebug.so"
  14. 添加这一行:zend_extension = " / usr / lib / php5/20121212 / xdebug.so”
  15. service apache2 restart
  16. 服务输入重启
  17. restart IDE
  18. 重新启动IDE

#16


0  

I spent a lot of time trying to get the optimal set up and thing this deserves its own reply, even though @Johnson T A's one it's almost correct.

我花了很多时间试图得到最优的设置,这值得它自己的回复,尽管@Johnson T a的答案几乎是正确的。

He says

他说

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

xdebug.remote_host=192.168.1.5 -这是我的系统的IPv4地址,我改变了这一点,因为我无法与localhost和127.0.0.1进行调试。

Well, not everybody can use a private address, or it may be dynamic, or other things. Also, in my case I was suffering from very long wait times before debugging actually started - 30 s or so every time. That was unpractical.

不是每个人都可以使用私人地址,或者是动态的,或者其他的。而且,在我的情况下,我在调试实际上开始前的等待时间非常长,每次30秒左右。这是不现实的。

I'm sure everyone having these problems are at least on Windows 7 or so. The problem is related to a mix between name resolution and xdebug. To overcome them make sure that:

我相信每个人至少在Windows 7上都有这些问题。这个问题与名称解析和xdebug的混合有关。要克服它们,请确保:

  • Port 9000 is not in use. If that's the case, change it to a unused one, both in php.ini and in netbeans.
  • 端口9000没有使用。如果是这样的话,将它改为一个未使用的,都用php。ini netbeans。
  • Make sure that xdebug.remote_enableis on.
  • 确保xdebug。remote_enableis。
  • If you want to be able to debug using both localhost and 127.0.0.1 addresses, open \Windows\System32\drivers\etc and make sure that there you have the following lines:

    如果您希望能够使用localhost和127.0.0.1地址进行调试,请打开\Windows\System32\驱动器\等,并确保您有以下几行:

    127.0.0.1 localhost

    127.0.0.1 localhost

    ::1 localhost

Make sure that the first line doesnt have a # before it and the second one does have it.

确保第一行没有前面的#,第二行有。

My working php.ini section (I don't need profiler so I disabled it):

我的工作php。ini部分(我不需要profiler,所以我禁用它):

[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

Stop netbeans debugger. Restart Apache.

停止netbeans调试器。重新启动Apache。

I bet you won't suffer from long waiting times anymore nor strange behaviour with debugger.

我打赌你再也不会忍受长时间的等待了,也不会因为调试器而出现奇怪的行为。

Explanation: Althought in etc/hosts they say "localhost name resolution is handled within DNS itself", for whatever reason it doesn't work well with xdebug if you don't have it explicitely stated in that file. Explicitly putting it seems to do no harm overall, and solves this problem with xdebug. But also you need to explicitly disable the sIPv6 short notation for localhost (::1) in order for all this to work. Don't know the internal reasons but triead all the combinations and this one works for me like a charm.

说明:在etc/hosts中,他们说“localhost名称解析是在DNS本身中处理的”,因为无论什么原因,如果在该文件中没有明确说明,它就不能很好地使用xdebug。显式地放置它似乎不影响全局,并通过xdebug解决了这个问题。但是,您还需要显式地禁用localhost(::1)的sIPv6简短标记,以使所有这些都能工作。不知道内部原因,但把所有的组合都读出来,这个对我来说就像一个咒语。

#17


0  

I had this issue for one project, but not for others. So xdebug was correctly configured, the project settings were ok, but it still did not work.

我对一个项目有这个问题,但对其他人没有。因此,xdebug的配置是正确的,项目设置是可以的,但它仍然不起作用。

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

因此,我刚刚删除了nbproject子目录,其中包含项目设置,并与现有源创建了一个新项目。这解决了我的问题。

#18


0  

Select a specific browser for debugging:

选择一个特定的浏览器进行调试:

  1. Right Click on project -> select Properties
  2. 右击项目->选择属性。
  3. Select categories: Browser then selected a specific browser for debugging
  4. 选择类别:浏览器然后选择一个特定的浏览器进行调试。

#19


0  

If your xdebug is not working correctly, check your server log:

如果您的xdebug不能正常工作,请检查您的服务器日志:

$ sudo less /var/log/httpd/error_log

To check connections, use this command:

要检查连接,请使用以下命令:

$ sudo netstat -an

After starting debug on netbeans, if you use the netstat command, you can see the port of xdebug (probably it's 80):

在netbeans启动调试之后,如果您使用netstat命令,您可以看到xdebug端口(可能是80):

tcp6       0      0 192.168.33.10:80       192.168.33.2:49901      ESTABLISHED

The port of netbeans is 9000:

netbeans的端口是9000:

tcp        0      0 192.168.33.10:52024    192.168.33.2:9000       ESTABLISHED

You can change the xdebug's port from here (From the top menu, Tools -> Options -> PHP): netbeans显示“等待连接(netbeans-xdebug)”

您可以从这里更改xdebug的端口(从顶部菜单,工具->选项-> PHP):

If the connection is not established, it is highly possible that your connection is blocked by your anti-virus program or firewall. You can check it in your anti-virus program or firewall and remove the block as it is a safe connection.

如果连接没有建立,很可能您的连接被您的反病毒程序或防火墙阻止。您可以在您的反病毒程序或防火墙中检查它,并删除该块,因为它是安全的连接。

#20


0  

After you make changes to your php.ini or xdebug.ini files, regardless of how you're running your web server, make sure to restart that web server (for example: service httpd restart on CentOS) or Apache will not pick up the changes you've made to that .ini file.

在对php进行更改之后。ini或xdebug。ini文件,不管您是如何运行web服务器的,请确保重新启动web服务器(例如,CentOS上的服务httpd重启)或Apache将不会接受您对该.ini文件所做的更改。

The xdebug package on CentOS is "phpXXu-pecl-xdebug".

CentOS的xdebug包是“phpxxul -pecl-xdebug”。

Defaults on most recent Xdebugs are usually fine. It's only strictly necessary to get these two values right, somewhere in an Apache .ini file:

在最近的Xdebugs上,默认值通常都很好。只需要在Apache .ini文件中找到这两个值。

xdebug.remote_enable=on
xdebug.remote_host=[DNS entry that resolves to the IP4 of your debugger]

#21


0  

I had the same problem and tried to solve it for hours. I finally found out that the chrome extension ipflood which changes the headers to make it look like you are using a proxy, was the cause.

我遇到了同样的问题,并试图解决它几个小时。我终于发现了chrome扩展ipflood,它改变了头,使它看起来像你在使用代理,是原因。

It works perfectly fine after I disabled it!

在我禁用它之后,它可以正常工作!

#1


102  

Have you rectified the issue ? If not then please try this.

你纠正这个问题了吗?如果没有,请尝试一下。

1.) php.ini file content

1 . php)。ini文件内容

[xDebug]
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 couldn't debug with localhost and 127.0.0.1.

xdebug.remote_host=192.168.1.5 -这是我的系统的IPv4地址,我改变了这一点,因为我无法与localhost和127.0.0.1进行调试。

in NetBeans IDE, open Tools-> Options -> PHP -> Debugging. The values of debugger port and Session Id should match with the port and idekey specified in php.ini.

在NetBeans IDE中,打开工具->选项-> PHP ->调试。调试器端口和会话Id的值应该与php.ini中指定的端口和idekey匹配。

Now save php.ini, restart Apache and try to debug.

现在保存php。ini,重启Apache并尝试调试。

Thanks Johnson

由于约翰逊

#2


8  

When Netbeans starts a Debugging session, it starts two Listeners, one on 0.0.0.0:9000 (all IPv4 IPs the system has), and the other on the IPv6 interface.

当Netbeans启动一个调试会话时,它将启动两个侦听器,一个在0.0.0.0:9000(所有的IPv4 IPs系统都有),另一个在IPv6接口上。

If Netbeans and the Web Server are on the same system, ideally XDebug would be configured to send the data back to 127.0.0.1:9000, on which NetBeans would be listening on (and only per session)...

如果Netbeans和Web服务器在同一系统上,最好将XDebug配置为将数据发送回127.0.0.1 . 9000,其中Netbeans会监听(并且仅在每个会话中)……

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 whatever reason XDebug is not able to report back to 127.0.0.1, or Netbeans is not listening on 127.0.0.1, you can configure XDebug to send the data back to the $_SERVER['REMOTE_ADDR'] of the original request...

如果出于某种原因,XDebug无法返回127.0.0.1,或者Netbeans没有监听127.0.0.1,您可以配置XDebug将数据发送回原始请求的$_SERVER['REMOTE_ADDR']…

xdebug.remote_connect_back=1

This way you don't have to specify the exact IP (i.e., as in the above answer the LAN IP: 192.168.1.5). The downside here is that any source can connect.

这样您就不必指定确切的IP(即:,如上所述,局域网IP: 192.168.1.5。这里的缺点是任何源都可以连接。

If you have further trouble, this...

如果你有进一步的麻烦,这…

xdebug.remote_autostart=1

... will also start the debugging process for all requests, and not just for the ones with the proper session start query or cookie. The downside here is that all requests will initiate debug data collection and reporting back (making everything slower, and generating more data).

…还将启动所有请求的调试过程,而不只是针对具有适当会话启动查询或cookie的请求。这里的缺点是,所有请求都将启动调试数据收集和报告(使所有事情变得更慢,并生成更多数据)。

Though from what I've gathered, the majority of these "Waiting For Connection (netbeans-xdebug)" issues on Windows (with XAMPP, Wamp-Server, etc) are usually a result of Windows Firewall and McAfee (or other firewall and anti-virus software) blocking the connection...

尽管从我收集的内容来看,大多数“等待连接(netbeans-xdebug)”的问题(使用XAMPP、Wamp-Server等)通常都是Windows防火墙和McAfee(或其他防火墙和杀毒软件)阻止连接的结果。

Source: Netbeans "Waiting For Connection (netbeans-xdebug)" Issue

来源:Netbeans“等待连接(Netbeans -xdebug)”问题

#3


5  

I am a .Net programmer and very new to PHP. Recently I was trying to host an open source PHP application on my machine(Windows). After the Struggle for 5-6 days I will list the steps which worked for me.

我是一个。net程序员,非常熟悉PHP。最近,我尝试在我的机器上(Windows)上托管一个开源PHP应用程序。在奋斗了5-6天之后,我将列出为我工作的步骤。

I uninstalled every previous installations of XAMPP and NetBeans and proceeded with fresh installations.

我卸载了XAMPP和NetBeans之前的所有安装,并进行了新的安装。

This might not be the solution for everyone but it worked for me and I hope it helps someone.

这可能不是每个人都能解决的问题,但对我来说是有效的,我希望它能帮助别人。

  1. install XAMPP

    安装XAMPP

  2. install netbeans for PHP.

    安装netbeans PHP。

  3. Open IIS and stop it. It is running on port 80 by default.(I am running XAMPP on port 80 i.e. default, Running on other port might need additional configuration settings)

    打开IIS并停止它。默认情况下,它在端口80上运行。(我在端口80上运行XAMPP,即默认情况下,在其他端口上运行可能需要额外的配置设置)

  4. Open XAMPP control panel and start Apache. If port 80 is free no problem should arise.

    打开XAMPP控制面板并启动Apache。如果端口80是免费的,就不会出现问题。

  5. Open localhost in browser in should display XAMPP home page.

    在浏览器中打开localhost应该显示XAMPP主页。

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

    在左窗格上打开phpinfo()链接,并将所有内容复制到页面上。访问:http://xdebug.org/wizard.php,并将所有内容粘贴到文本框中,然后单击分析我的phpinfo输出。它将为您提供适合您的配置的Xdebug文件。

  7. Download the given Xdebug dll and copy it in C:\xampp\php\ext (Xampp being the default Xampp installation directory)

    下载给定的Xdebug dll并将其复制到C:\xampp\php\ext (xampp是默认的xampp安装目录)

  8. Goto XAMPP control panel, click on Config button in front of Apache and select php.in,

    Goto XAMPP控制面板,点击Apache前面的Config按钮,选择php.in,

  9. Find line similar or exacly like,

    找到类似或完全一样的线,

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

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

(Semicolon means it is commented)

(分号表示注释)

Remove the semicolon and replace the path with the path of dll you just copied like:

删除分号,用你刚才复制的dll路径替换路径:

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

    同样找到线

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

    xdebug。xdebug remote_enable = 0。remote_handler = " dbgp "

remove semicolons in front of both lines and make remote_enable = 1

在两行前面删除分号,并使remote_enable = 1。

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

    重新启动Apache服务器。

  2. Copy your website code under C:/XAMPP/htdocs/(your_website)/ that means your index.php should be at C:/XAMPP/htdocs/(your_website)/index.php

    复制你的网站代码在C:/XAMPP/htdocs/(your_website)/这意味着你的索引。php应该在C:/XAMPP/htdocs/(your_website)/index.php中。

  3. Open Netbeans select New project -> PHP -> PHP project from existing source and select the folder you just copied in htdocs folder. Set it to run on Local web server.

    打开Netbeans选择新项目-> PHP -> PHP项目从现有的源代码,并选择你刚才拷贝在htdocs文件夹中的文件夹。将其设置为在本地web服务器上运行。

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

    在索引的第一行设置断点。php和调试。

That's it.

就是这样。

Additional settings were suggested on various different posts but above mentioned steps worked perfectly for me.

在各种不同的岗位上都有额外的设置,但是上面提到的步骤对我来说是完美的。

#4


3  

I just spent hours reading so many answers on this page and others like it, and nobody mentioned what ended up being the solution for me:

我花了几个小时在这一页上读了这么多的答案,还有一些人喜欢它,没人提到我的解决方案是什么:

Make Sure Your Chosen Port Settings Match in All 3 Locations

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

我的问题是,选择的端口需要匹配三个位置。我的两个说9001,一个说9000。我把它们都改成了9000。

That was the problem and why Netbeans would only say “Waiting For Connection (netbeans-xdebug)”.

这就是问题所在,为什么Netbeans只说“等待连接(Netbeans -xdebug)”。

The 3 port setting locations are:

3个港口设置地点为:

  • php.ini (xdebug.remote_port=9000)
  • php。ini(xdebug.remote_port = 9000)
  • project properties > Run Configuration > Advanced
  • 项目属性>运行配置>高级。
  • Netbeans > Tools > Options > PHP > Debugging
  • Netbeans >工具>选项> PHP >调试。

#5


3  

I want to mention something here about xdebug.remote_host

我想在这里提到xdebug.remote_host。

xdebug.remote_host="127.0.0.1"

Is Not valid. It may work in some cases, but the quotes can also cause issues. Most people don't have issues when using IP addresses in quotes, but this sets a bad precedent. It makes people think that if you want to use a hostname or URL you need to put it in quotes. This is incorrect, urls in quotes will not work.

不是有效的。它可能在某些情况下起作用,但是引号也会引起问题。大多数人在使用IP地址时没有问题,但这是一个不好的先例。它使人们认为,如果您想要使用主机名或URL,您需要将其放入引号中。这是错误的,引号中的url将不起作用。

If you want to debug using a url, you can do this by just putting the url after the equals like this:

如果想要使用url进行调试,可以通过将url放在等号后面来实现:

xdebug.remote_host=subdomain.mydomain.com

I also want to mention that if you have a port number, don't add it. This doesn't 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 caution you make sure remote_connect_back is disabled. Like this:

如果您这样做,我还警告您确保remote_connect_back是禁用的。是这样的:

xdebug.remote_connect_back=0

or you can ommit it entirely, like this:

或者你也可以完全忽略它,像这样:

;xdebug.remote_connect_back=1

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

如果启用remote_connect_back,它将尝试从传入的连接中提取您的IP地址,并忽略remote_host和端口设置。

Xdebug uses plain old TCP to make connections. This is not HTTP. This means tools like Fiddler will not show any packets or information on debugging. If you need to debug, and see if the server is making a call to your IDE there are a few ways you can go about checking.

Xdebug使用普通的TCP来连接。这不是HTTP。这意味着像Fiddler这样的工具不会显示任何数据包或关于调试的信息。如果您需要调试,并查看服务器是否正在对您的IDE进行调用,您可以进行一些检查。

Wireshark will allow you to see TCP traffic. Also if you are on Windows, Microsoft Message Analyzer can also monitor TCP.

Wireshark将允许您查看TCP流量。同样,如果你在Windows上,微软的消息分析器也可以监控TCP。

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

但是,如果您所要做的只是移除您的IDE,这可能是远程调试问题的原因,我建议您启动一个本地TCP服务器。

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

这是一个启动TCP服务器的很棒的免费java程序:http://sockettest.sourceforge.net/。

netbeans显示“等待连接(netbeans-xdebug)”

In the IP Address section, just list 127.0.0.1 or leave it at 0.0.0.0. Then list the port number, which is usually defaulted to 9000 for xdebug.

在IP地址部分,只需列出127.0.0.1或将其保留为0.0.0.0。然后列出端口号,它通常默认为9000,用于xdebug。

Once the TCP server is running, open your remote webpage with an xdebug_break(); function call in it. This will tell xdebug on the remote server to start debugging on whatever server and port you listed in your php.ini.

一旦TCP服务器运行,打开您的远程页面,并使用xdebug_break();函数调用。这将告诉远程服务器上的xdebug启动在php.ini中列出的任何服务器和端口上的调试。

Watch the socket server and see if you get 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 is working! Just stop the server and setup your IDE to listen on that port!

如果您已经做到了这一点,那么远程调试正在工作!停止服务器并设置您的IDE监听那个端口!


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

如果您和我们大多数人一样,您的开发人员机器在NAT之后,这意味着您办公室的每个人都有相同的公共IP地址。这是一个问题,因为当xdebug接触到IP地址开始调试时,它会击中路由器,而不是你的计算机。可以将路由器配置为将某些端口号传递给单个计算机,但您可能不希望这样做,因为端口将打开,直到您更改路由器设置。

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

另一种选择是使用SSH。这里有一个很好的例子来说明如何做到这一点:http://stuporglue.org/settingxdebug -with-netbeans-on-window -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. In order to use the TCP redirect function you need to sign up for a free account.

我的首选是使用Ngrok。Ngrok是一个用于重定向http、https和TCP流量的好工具。为了使用TCP重定向功能,您需要注册一个免费帐户。

Once you have signed up for an account, and added your API key to your computer run this command on the computer that your IDE is on:

一旦您注册了一个帐户,并将您的API密钥添加到您的计算机上,在计算机上运行这个命令,您的IDE就在上面:

ngrok tcp 9000

This will open a tcp (not http) tunnel from the ngrok server to whatever machine you ran the command on. I am using port 9000, you can change this port if your IDE is configured for a different Xdebug port.

这将打开一个tcp(不是http)隧道从ngrok服务器到任何你运行命令的机器。我正在使用端口9000,如果您的IDE配置了一个不同的Xdebug端口,您可以更改这个端口。

This is what you should see:

这是你应该看到的:

netbeans显示“等待连接(netbeans-xdebug)”

You will need to see what the url is for the TCP tunnel that was opened. In this example it is:

您需要查看打开的TCP通道的url。在这个例子中,它是:

0.tcp.ngrok.io:14904

For this session, the Xdebug setting on your server should be this:

对于这个会话,服务器上的Xdebug设置应该是这样的:

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

The URL and port will change each time ngrok is launched. If you want to have the same url and port, you have to upgrade to a paid account. Make sure to restart apache after you make changes to your php.ini.

每次启动ngrok时,URL和端口都会发生变化。如果你想拥有相同的url和端口,你必须升级到付费帐户。在对php.ini进行更改之后,确保重新启动apache。

#6


2  

Check also the "windows" firewall settings.

检查“windows”防火墙设置。

For me it doesn't worked because my LAN network was declared as "Public network". After i switched it to "Work network" it worked fine.

对我来说,它不起作用,因为我的局域网被宣布为“公共网络”。当我把它转换成“工作网络”后,它运行得很好。

#7


1  

In my case the Apache log showed a PHP warning about not having set date.timezone. Xdebug/netbeans began working as soon as I set it in php.ini and restarted apache.

在我的例子中,Apache日志显示了一个关于没有设置日期的PHP警告。Xdebug/netbeans在我用php设置的时候就开始工作了。ini并重新启动apache。

date.timezone = America/Los_Angeles

This is PHP 5.5.

这是PHP 5.5。

#8


1  

I'm on Windows with xampp and changed the [XDebug] section of my php.ini (at the bottom) to the following to get it working:

我使用xampp在Windows上,并更改了php的[XDebug]部分。ini(在底部)到下面来让它工作:

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

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

来自Netbeans wiki: http://wiki.netbeans.org/HowToConfigureXDebug。

If you have Apache running, remember to restart it after configuring XDebug and saving php.ini.

如果您有Apache运行,请记住在配置了XDebug并保存php.ini之后重新启动它。

#9


1  

Adding this did work for me:

他补充道:

xdebug.idekey=netbeans-xdebug   

#10


1  

I my case if I add following in php ini it did not work

如果我在php ini中添加以下内容,我的情况就不一样了。

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

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"

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

It is working fine.

它工作正常。

#11


1  

Having correctly set up the php.ini file, netbeans, port forwarding on the router, I was still getting the wretched "waiting for connection (netbeans-xdebug). I eventually noticed on the netbeans page "Do not forget to set output_buffering = Off in your php.ini file".

正确设置了php。在路由器上的ini文件、netbeans、端口转发,我还在等待“等待连接”(netbeainxdebug)。我最终在netbeans页面上注意到“不要忘记在php中设置output_buffering = Off”。ini文件”。

So I checked the /etc/php/7.x/apache2/php.ini file and sure enough it's value was 4096. So I reset output_buffering=Off and lo it worked !!!

所以我检查了/etc/php/7.x/apache2/php。ini文件,它的值是4096。所以我重置了output_buffering=Off,并且它成功了!!!

Hope this helps someone, as the message implies it is a connection error rather than a configuration error.

希望这有助于某人,因为消息暗示它是一个连接错误,而不是一个配置错误。

#12


0  

check this out: Launch XDebug in Netbeans on an external request

检查这个:在Netbeans中对外部请求启动XDebug。


another way is to open a new window:

另一种方法是打开一个新窗口:

try to go on Project > run configuration > advance

试着继续>运行配置>。

and switch to default, check if it opens another window in the browser

然后切换到默认值,检查它是否在浏览器中打开了另一个窗口。

#13


0  

A try could be to start php -i in command window. When redirecting the output an error was

可以尝试在命令窗口中启动php -i。当重定向输出时,错误是。

For me it was the FINAL solution because I had a wrong version of Xdebug downloaded

对我来说,这是最终的解决方案,因为我下载了错误的Xdebug版本。

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

对我来说,它应该是: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

但我有:php_xdebug vc9.dll——2.2.4 - 5.3。所以php -i出现了一个错误。

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

yields following ERROR

产量跟踪误差

Cannot load Xdebug - it was built with configuration API220090626,TS,VC9, whereas running engine is API220090626,TS,VC6

不能加载Xdebug -它是通过配置API220090626,TS,VC9构建的,而运行的引擎是API220090626,TS,VC6。

#14


0  

I had the same problem. why? First I installed WAMP, thank Netbeans and they work together as a charm. Later I installed XAMPP and Localhost sites were run smoothly but NetBeans could never connect to XAMPP (netbeans-xdebug). At the same time NetBeans were working good with Wamp.

我遇到了同样的问题。为什么?首先,我安装了WAMP,感谢Netbeans,它们协同工作,作为一种魅力。后来,我安装了XAMPP和Localhost站点,但是NetBeans无法连接XAMPP (NetBeans -xdebug)。与此同时,NetBeans也在使用Wamp。

My solution was to go back to Wamp. It is better than nothing.

我的解决办法是回到Wamp。总比没有好。

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

我的电脑:Win-7-32 NetBeans-8.0.2,

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

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

xampp-win32-5.6.8-0-VC11

xampp-win32-5.6.8-0-VC11

#15


0  

For Ubuntu users:

对于Ubuntu用户:

  1. sudo su
  2. sudo苏
  3. apt-get install php5-dev php-pear
  4. apt-get安装php5-dev php-pear
  5. pecl install xdebug
  6. pecl安装xdebug
  7. find / -name 'xdebug.so' 2> /dev/null
  8. 找到/ - name ' xdebug。所以“2 > / dev / null
  9. it will return something like: /usr/lib/php5/20121212/xdebug.so
  10. 它将返回如下内容:/usr/lib/php5/20121212/xdebug.so。
  11. vi /etc/php5/apache2/php.ini
  12. vi /etc/php5/apache2/php.ini
  13. add this line: zend_extension="/usr/lib/php5/20121212/xdebug.so"
  14. 添加这一行:zend_extension = " / usr / lib / php5/20121212 / xdebug.so”
  15. service apache2 restart
  16. 服务输入重启
  17. restart IDE
  18. 重新启动IDE

#16


0  

I spent a lot of time trying to get the optimal set up and thing this deserves its own reply, even though @Johnson T A's one it's almost correct.

我花了很多时间试图得到最优的设置,这值得它自己的回复,尽管@Johnson T a的答案几乎是正确的。

He says

他说

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

xdebug.remote_host=192.168.1.5 -这是我的系统的IPv4地址,我改变了这一点,因为我无法与localhost和127.0.0.1进行调试。

Well, not everybody can use a private address, or it may be dynamic, or other things. Also, in my case I was suffering from very long wait times before debugging actually started - 30 s or so every time. That was unpractical.

不是每个人都可以使用私人地址,或者是动态的,或者其他的。而且,在我的情况下,我在调试实际上开始前的等待时间非常长,每次30秒左右。这是不现实的。

I'm sure everyone having these problems are at least on Windows 7 or so. The problem is related to a mix between name resolution and xdebug. To overcome them make sure that:

我相信每个人至少在Windows 7上都有这些问题。这个问题与名称解析和xdebug的混合有关。要克服它们,请确保:

  • Port 9000 is not in use. If that's the case, change it to a unused one, both in php.ini and in netbeans.
  • 端口9000没有使用。如果是这样的话,将它改为一个未使用的,都用php。ini netbeans。
  • Make sure that xdebug.remote_enableis on.
  • 确保xdebug。remote_enableis。
  • If you want to be able to debug using both localhost and 127.0.0.1 addresses, open \Windows\System32\drivers\etc and make sure that there you have the following lines:

    如果您希望能够使用localhost和127.0.0.1地址进行调试,请打开\Windows\System32\驱动器\等,并确保您有以下几行:

    127.0.0.1 localhost

    127.0.0.1 localhost

    ::1 localhost

Make sure that the first line doesnt have a # before it and the second one does have it.

确保第一行没有前面的#,第二行有。

My working php.ini section (I don't need profiler so I disabled it):

我的工作php。ini部分(我不需要profiler,所以我禁用它):

[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

Stop netbeans debugger. Restart Apache.

停止netbeans调试器。重新启动Apache。

I bet you won't suffer from long waiting times anymore nor strange behaviour with debugger.

我打赌你再也不会忍受长时间的等待了,也不会因为调试器而出现奇怪的行为。

Explanation: Althought in etc/hosts they say "localhost name resolution is handled within DNS itself", for whatever reason it doesn't work well with xdebug if you don't have it explicitely stated in that file. Explicitly putting it seems to do no harm overall, and solves this problem with xdebug. But also you need to explicitly disable the sIPv6 short notation for localhost (::1) in order for all this to work. Don't know the internal reasons but triead all the combinations and this one works for me like a charm.

说明:在etc/hosts中,他们说“localhost名称解析是在DNS本身中处理的”,因为无论什么原因,如果在该文件中没有明确说明,它就不能很好地使用xdebug。显式地放置它似乎不影响全局,并通过xdebug解决了这个问题。但是,您还需要显式地禁用localhost(::1)的sIPv6简短标记,以使所有这些都能工作。不知道内部原因,但把所有的组合都读出来,这个对我来说就像一个咒语。

#17


0  

I had this issue for one project, but not for others. So xdebug was correctly configured, the project settings were ok, but it still did not work.

我对一个项目有这个问题,但对其他人没有。因此,xdebug的配置是正确的,项目设置是可以的,但它仍然不起作用。

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

因此,我刚刚删除了nbproject子目录,其中包含项目设置,并与现有源创建了一个新项目。这解决了我的问题。

#18


0  

Select a specific browser for debugging:

选择一个特定的浏览器进行调试:

  1. Right Click on project -> select Properties
  2. 右击项目->选择属性。
  3. Select categories: Browser then selected a specific browser for debugging
  4. 选择类别:浏览器然后选择一个特定的浏览器进行调试。

#19


0  

If your xdebug is not working correctly, check your server log:

如果您的xdebug不能正常工作,请检查您的服务器日志:

$ sudo less /var/log/httpd/error_log

To check connections, use this command:

要检查连接,请使用以下命令:

$ sudo netstat -an

After starting debug on netbeans, if you use the netstat command, you can see the port of xdebug (probably it's 80):

在netbeans启动调试之后,如果您使用netstat命令,您可以看到xdebug端口(可能是80):

tcp6       0      0 192.168.33.10:80       192.168.33.2:49901      ESTABLISHED

The port of netbeans is 9000:

netbeans的端口是9000:

tcp        0      0 192.168.33.10:52024    192.168.33.2:9000       ESTABLISHED

You can change the xdebug's port from here (From the top menu, Tools -> Options -> PHP): netbeans显示“等待连接(netbeans-xdebug)”

您可以从这里更改xdebug的端口(从顶部菜单,工具->选项-> PHP):

If the connection is not established, it is highly possible that your connection is blocked by your anti-virus program or firewall. You can check it in your anti-virus program or firewall and remove the block as it is a safe connection.

如果连接没有建立,很可能您的连接被您的反病毒程序或防火墙阻止。您可以在您的反病毒程序或防火墙中检查它,并删除该块,因为它是安全的连接。

#20


0  

After you make changes to your php.ini or xdebug.ini files, regardless of how you're running your web server, make sure to restart that web server (for example: service httpd restart on CentOS) or Apache will not pick up the changes you've made to that .ini file.

在对php进行更改之后。ini或xdebug。ini文件,不管您是如何运行web服务器的,请确保重新启动web服务器(例如,CentOS上的服务httpd重启)或Apache将不会接受您对该.ini文件所做的更改。

The xdebug package on CentOS is "phpXXu-pecl-xdebug".

CentOS的xdebug包是“phpxxul -pecl-xdebug”。

Defaults on most recent Xdebugs are usually fine. It's only strictly necessary to get these two values right, somewhere in an Apache .ini file:

在最近的Xdebugs上,默认值通常都很好。只需要在Apache .ini文件中找到这两个值。

xdebug.remote_enable=on
xdebug.remote_host=[DNS entry that resolves to the IP4 of your debugger]

#21


0  

I had the same problem and tried to solve it for hours. I finally found out that the chrome extension ipflood which changes the headers to make it look like you are using a proxy, was the cause.

我遇到了同样的问题,并试图解决它几个小时。我终于发现了chrome扩展ipflood,它改变了头,使它看起来像你在使用代理,是原因。

It works perfectly fine after I disabled it!

在我禁用它之后,它可以正常工作!