使用 Xdebug 和 Zend Framework 进行交互式调试和断点

发布于 2024-08-11 15:58:46 字数 1263 浏览 2 评论 0原文

我正在尝试使用 Zend Framework 应用程序和 Xdebug 进行交互式调试,使用 MacGDPp 作为客户端调试器。我在设置断点时遇到了一些问题,希望

  1. 有人可以解决我的具体问题

  2. 有人可以给我一个关于它应该如何工作的高级概述,以便我可以自己追踪问题

MacGDPp 可以选择在发出请求时立即启动调试器。这有效。我加载 Zend 应用程序的页面,并在 Zend index.php 文件的第一行处停止执行。

但是,如果我尝试在 MacGDPp 控制器或 phtml 模板文件中设置断点,则执行不会在这些断点处停止。

在 Zend 之外,如果我设置一个带有单个 require 的简单页面,我可以成功在所需文件中设置断点。

File: test.php
<?php
    echo "One <br>";
    echo "Two <br>";
    echo "Three <br>";
    echo "Four <br>";
    echo "Five <br>";
    echo "Six <br>";
    echo "Seven <br>";
    echo "Eight <br>";
    echo "Nine <br>";
    echo "Ten <br>";

    require_once('test2.php');  

File: test2.php
<?php       
    echo "Eight <br>";
    echo "Five <br>";
    echo "Four <br>";
    echo "Nine <br>";
    echo "One <br>";
    echo "Seven <br>";
    echo "Six <br>";
    echo "Ten <br>";
    echo "Three <br>";
    echo "Two <br>";    

所以,我有点不知道如何继续。我不知道我的客户端是否设置了错误的断点,或者 Zend 的自动加载/实例化模式是否存在某种阻止任何交互式调试器知道如何使用“连接我从文件系统中选择的文件”的情况。我已执行的远程”(localhost) URL。

如果有人有关于远程 PHP 调试器如何工作的解决方案和/或一些指示,我将不胜感激。

I'm trying to get interactive debugging working with a Zend Framework application and Xdebug, using MacGDPp as the client debugger. I'm running to some problems setting breakpoints and was hoping

  1. Someone could solve my specific problem

  2. Someone could give me a high level overview of how this is supposed to work so I can track down the problem myself

MacGDPp has an option to start the debugger immediately whenever a request is made. This works. I load a page of the Zend Application and execution stops at the first line of the Zend index.php file.

However, if I attempt to set a break point in MacGDPp either a Controller or phtml template file, execution does NOT halt at those breakpoints.

Outside of Zend, if I setup a simple page with a single require, I can sucsefully set break points in the required file.

File: test.php
<?php
    echo "One <br>";
    echo "Two <br>";
    echo "Three <br>";
    echo "Four <br>";
    echo "Five <br>";
    echo "Six <br>";
    echo "Seven <br>";
    echo "Eight <br>";
    echo "Nine <br>";
    echo "Ten <br>";

    require_once('test2.php');  

File: test2.php
<?php       
    echo "Eight <br>";
    echo "Five <br>";
    echo "Four <br>";
    echo "Nine <br>";
    echo "One <br>";
    echo "Seven <br>";
    echo "Six <br>";
    echo "Ten <br>";
    echo "Three <br>";
    echo "Two <br>";    

So, I'm a bit at a loss on how to proceed. I don't know if my client is setting breakpoints wrong, or if there's something about Zend's autoloadng/instantiation patterns that prevents any interactive debugger from knowing how to hookup a files I select from the filesystem with a "remote" (localhost) URL I've executed.

If anyone has a solution and/or some pointers on how remote PHP debuggers work I'd appreciate it.

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

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

发布评论

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

评论(2

撑一把青伞 2024-08-18 15:58:46

天哪 - 我真是抓狂了 - XAMPP 1.7.1 (php 5.2.9) 与 notepad++ 和 Xdebug 没有在断点处停止(仅在 xdebug_break() 行)。这是因为如果您将断点放在空行上,愚蠢的调试器不会中断!伙计,我希望在手册的某个地方这么说。哦,是的,我忘了;没有说明书...

Holy crap - I was pulling my hair out - XAMPP 1.7.1 (php 5.2.9) with notepad++ and Xdebug was not stopping at breakpoints (only at the xdebug_break() lines). This was because the dumb debugger won't break if you place your breakpoint on a blank line! Man, I wish it said that somewhere in the manual. Oh yeah, I forgot; there is no manual...

杀お生予夺 2024-08-18 15:58:46

结果我在空白行上设置了断点,而 MacGDPp 会跳过这些断点。

Turns out I was setting break points on blank lines and MacGDPp skips over those.

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