简体   繁体   English

Xdebug和Zend框架的交互式调试和断点

[英]Interactive Debugging and Breakpoints with Xdebug and the Zend Framework

I'm trying to get interactive debugging working with a Zend Framework application and Xdebug, using MacGDPp as the client debugger. 我正在尝试使用MacGDPp作为客户端调试器,使用Zend Framework应用程序和Xdebug进行交互式调试。 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. MacGDPp可以选择在发出请求时立即启动调试器。 This works. 这可行。 I load a page of the Zend Application and execution stops at the first line of the Zend index.php file. 我加载Zend应用程序的页面,并且执行在Zend index.php文件的第一行处停止。

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. 但是,如果我试图在Controller或phtml模板文件的MacGDPp中设置断点,则执行不会在这些断点处停止。

Outside of Zend, if I setup a simple page with a single require, I can sucsefully set break points in the required file. 在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>";    

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. 我不知道我的客户端是否将断点设置为错误,或者Zend的autoloadng / instantiation模式是否存在某些问题,从而阻止了任何交互式调试器知道如何使用“远程”(本地主机)URL连接我从文件系统中选择的文件已经执行了。

If anyone has a solution and/or some pointers on how remote PHP debuggers work I'd appreciate it. 如果有人对远程PHP调试器的工作方式有解决方案和/或有一些建议,我将不胜感激。

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). 糟糕-我正在拔头发-使用记事本++的XAMPP 1.7.1(php 5.2.9)和Xdebug并没有在断点处停止(仅在xdebug_break()行上)。 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... 没有手册...

原来我在空白行上设置了断点,而MacGDPp跳过了这些断点。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM