分步:如何对与客户端 IDE 的连接进行 Xdebug 故障排除

发布于 2025-01-07 04:39:38 字数 894 浏览 1 评论 0 原文

背景

将 Xdebug 与 PHP 和 Komodo IDE 以及 Eclipse PDT 结合使用。

Xdebug已安装在服务器上并正常工作。这是确认的,因为 Xdebug 代码命令在插入到服务器上的 PHP 文件中时会按预期工作。

问题

连接到客户端工作站不起作用,并且很难确定原因,因为它在多个 IDE 上失败。

问题

如果您知道 Xdebug 已安装并在服务器上运行,但客户端无法连接,那么最好有一个分步检查表来解决这种情况。

任何人都可以帮助添加此内容以制作全面的故障排除清单吗?

具体来说,是否有任何基本方法可以确保网络流量到达客户端,并且按照 IDE 期望查看数据的方式正确格式化?

  • 通过 SSH 连接到 Web 主机并尝试访问客户端:

    • 主机可以联系到客户端吗? (ping -c 5 xxx.xxx.xxx.xxx)
    • 主机可以访问端口 9000 吗? (nmap -p 9000 xxx.xxx.xxx.xxx)
    • 如果以上两者成功,输出应该是什么?
    • 如果上述两种方法均失败,下一步的故障排除步骤是什么?
  • 验证客户端上基于软件的防火墙设置

  • 验证 Linux 主机上的 iptables 设置
  • 验证客户端和主机上的硬件防火墙

目标

目标是找到某种解决方案,使客户端计算机上的人员至少可以确认某些东西正在到达客户端,而不必确定 IDE 是否是问题所在,因为 IDE 是另一种复杂程度,可能会导致问题的发生。会引入问题。

BACKGROUND

Using Xdebug with PHP and Komodo IDE, and Eclipse PDT.

Xdebug is installed on the server and working properly. This is confirmed because the Xdebug code commands work as expected when inserted into PHP files on the server.

PROBLEM

Connecting to the client workstation is not working, and it is difficult to determine why because it fails with multiple IDEs.

QUESTION

It would be nice to have a step-by-step checklist to troubleshoot the case where you know Xdebug is installed and working on the server, but the client does not connect.

Can anyone help add to this to make a comprehensive troubleshooting checklist?

Specifically, is there any bare-bones way to make sure the network traffic is reaching the client, and is correctly formatted in the way the IDE expects to see the data?

  • SSH into web host and try to reach the client:

    • can host reach client at all? (ping -c 5 xxx.xxx.xxx.xxx )
    • can host reach port 9000? (nmap -p 9000 xxx.xxx.xxx.xxx)
    • if the above two succeed, what should the output be?
    • if the above two fail, what is the next troubleshooting step?
  • Verify settings of software-based firewall on client

  • Verify settings of iptables on linux host
  • Verify hardware firewall b/t client and host

GOAL

The goal is to find some solution where the person on the client machine can at least confirm that something is reaching the client without having to determine whether the IDE is the problem, since IDE is another level of complexity that may be introducing problems.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

沙与沫 2025-01-14 04:39:38

这是我绝对希望包含在 Xdebug 文档中的内容。我认为最好让很多人对此进行协作,因此我在 xdebug.org github 存储库中创建了一个文件(https://github.com/derickr/xdebug.org/blob/master/html/docs/tutorials/troubleshooting.rest)收集提示。请随意分叉和扩展!

在 Xdebug 方面,在即将发布的版本 (2.2) 中,它已经在其 xdebug.remote_log 文件中转储了一些额外的诊断信息,例如是否尝试连接以及连接是否被接受或拒绝。

This is something I would definitely want to include in the Xdebug documentation. I think it would work best to have many people collaborate on this, so I've created a file in the xdebug.org github repository (https://github.com/derickr/xdebug.org/blob/master/html/docs/tutorials/troubleshooting.rest) to collect tips. Feel free to fork and extend!

On the Xdebug side, in the upcoming version (2.2) it already dumps in its xdebug.remote_log file a couple of extra diagnostics such as whether it tried to connect and whether the connection was accepted or denied.

青衫负雪 2025-01-14 04:39:38

您可以使用 debugclient 实用程序来确定客户端是否可以接收 Xdebug 连接,如您所读Xdebug 文档

在开始脚本之前,您需要告诉您的客户,它
可以接收调试连接,请参阅文档
具体客户如何执行此操作。使用捆绑客户端
编译并安装后启动即可。你可以通过以下方式启动它
运行“调试客户端”。如果你想使用GDB命令集来调试
您的脚本,请确保使用与 Xdebug 捆绑在一起的调试客户端
1.3 与 Xdebug 2 捆绑在一起,仅适用于 DBGp 命令集。
当debugclient启动时会显示以下信息
然后等待,直到调试服务器发起连接:

Xdebug Simple DBGp client (0.10.0)
Copyright 2002-2007 by Derick Rethans.
- libedit support: enabled
Waiting for debug server to connect.

建立连接后,将显示调试服务器的输出:

Connect
<?xml version="1.0" encoding="iso-8859-1"?>
<init xmlns="urn:debugger_protocol_v1"
      xmlns:xdebug="http://xdebug.org/dbgp/xdebug"
      fileuri="file:///home/httpd/www.xdebug.org/html/docs/index.php"
      language="PHP"
      protocol_version="1.0"
      appid="13202"
      idekey="derick">
  <engine version="2.0.0RC4-dev"><![CDATA[Xdebug]]></engine>
  <author><![CDATA[Derick Rethans]]></author>
  <url><![CDATA[http://xdebug.org]]></url>
  <copyright><![CDATA[Copyright (c) 2002-2007 by Derick Rethans]]></copyright>
</init>
(cmd)

您可以找到有关 Xdebug 2 初始化协议的更多信息 此处
进一步参考:如何检查 xdebug 安装
不幸的是,debugclient 实用程序仅以源代码形式提供,因此您必须自己构建可执行文件;这可以在 Linux(请参阅 INSTALL)和 Windows(使用Visual Studio - 请参阅 debugclient.dsp)。
XAMPP 在 xampp/php/debugclient.exe 中包含编译版本。

You can use the debugclient utility to determine if the client can receive Xdebug connections, as you can read in the Xdebug documentation:

Before you start your script you will need to tell your client that it
can receive debug connections, please refer to the documentation of
the specific client on how to do this. To use the bundled client
simply start it after compiling and installing it. You can start it by
running "debugclient". If you want to use the GDB commandset to debug
your scripts, make sure you use a debugclient as bundled with Xdebug
1.3 as the one bundled with Xdebug 2 only works with the DBGp commandset.
When the debugclient starts it will show the following information and
then waits until a connection is initiated by the debug server:

Xdebug Simple DBGp client (0.10.0)
Copyright 2002-2007 by Derick Rethans.
- libedit support: enabled
Waiting for debug server to connect.

After a connection is made the output of the debug server is shown:

Connect
<?xml version="1.0" encoding="iso-8859-1"?>
<init xmlns="urn:debugger_protocol_v1"
      xmlns:xdebug="http://xdebug.org/dbgp/xdebug"
      fileuri="file:///home/httpd/www.xdebug.org/html/docs/index.php"
      language="PHP"
      protocol_version="1.0"
      appid="13202"
      idekey="derick">
  <engine version="2.0.0RC4-dev"><![CDATA[Xdebug]]></engine>
  <author><![CDATA[Derick Rethans]]></author>
  <url><![CDATA[http://xdebug.org]]></url>
  <copyright><![CDATA[Copyright (c) 2002-2007 by Derick Rethans]]></copyright>
</init>
(cmd)

You can find more information about the Xdebug 2 initialization protocol here.
A further reference: Howto check xdebug installation.
Unfortunately the debugclient utility is provided only in source form, so you have to build the executable by yourself; this can be done either on Linux (see INSTALL) and Windows (with Visual Studio - see debugclient.dsp).
XAMPP includes a compiled version in xampp/php/debugclient.exe.

画骨成沙 2025-01-14 04:39:38

Netbeans 有一个非常详尽的文档,其中还介绍了如何解决此类问题:

http://wiki.netbeans.org/HowToConfigureXDebug< /a>

Netbeans has a very thorough documentation that also covers how to troubleshoot such problems:

http://wiki.netbeans.org/HowToConfigureXDebug

欲拥i 2025-01-14 04:39:38

Windows 用户禁用您的防火墙,然后重试。
如果有效,请允许 Java(TM) Platform SE 二进制文件通过防火墙,然后再次启用它。
它会工作得很好!

感谢您提供的命令,它们对于调试非常有用。

Windows users disable your firewall and then try again.
If it works, allow Java(TM) Platform SE binary through firewall then enable it again.
It will work just fine!

Thank you for the commands, they were very useful on debugging.

往昔成烟 2025-01-14 04:39:38

请注意远程调试会话的防火墙。我通过使用 telnet 检查 9000 端口状态来诊断我的问题,并发现防火墙的阻止。

be careful about firewalls for remote debug sessions. I diagnosed my problem by using telnet to checkout 9000 port status and found that preventations by firewall.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文