【问题标题】:How to debug PHP in Notepad++ with DBGp plugin如何使用 DBGp 插件在 Notepad++ 中调试 PHP
【发布时间】:2015-04-01 14:13:27
【问题描述】:

我正在使用 chrome 和 mozilla。我的编辑器是记事本++。我只是尝试为 php 设置一个调试器。我关注了this linkthis link

我是从 SO 答案中找到的。我的步骤是

Downloaded `php_xdebug-2.3.2-5.6-vc11-x86_64.dll` and placed inside `php\ext`.

Added the following lines in `php.ini`
 zend_extension=php_xdebug-2.3.2-5.5-vc11-x86_64.dll
 xdebug.remote_enable=1
 xdebug.remote_handler=dbgp
 xdebug.remote_host=127.0.0.1
 xdebug.remote_port=9000
 xdebug.remote_mode=req
 xdebug.idekey=default
 xdebug.remote_log="c:\temp\xdebug\xdebug.log"
 xdebug.show_exception_trace=0
 xdebug.show_local_vars=9
 xdebug.show_mem_delta=0
 xdebug.trace_format=0
 xdebug.profiler_enable  = 1
 xdebug.profiler_output_dir ="c:\temp\xdebug"

temp 中创建了xdebug 文件夹。我的系统是windows 64位。 PHP版本是5.6.2。 [重新启动 Apache - 没有错误]

Then downloaded DBGp plugin and placed dll file inside plugins directory of Notepad++;
[Restarted Npp]
plugins->DBGp -> Config

  127.0.0.1    EMPTY    htdocspath     htdocs path

htdocs 路径是 c:\Users\me\Server\Apache24\htdocs

设置断点并使用参数?XDEBUG_SESSION_START=debugMe开始我的页面

但它并没有在我的断点处停止。

我该如何解决这个问题或我的最终目标是逐步调试 PHP。其他选项是什么。

【问题讨论】:

    标签: php debugging notepad++


    【解决方案1】:

    我不太确定记事本,但我已经在 netbeans 上尝试过,并且工作正常。

    提示:我尝试在实际项目中将此调试器与 netbeans 一起使用,但真诚地最好一步一步进行。

    我也在控制台中使用 FirebugPHP 这个选项对我来说是最好的,因为它不会干扰视图

    以下链接可能对您有所帮助:

    https://netbeans.org/kb/docs/php/debugging.html

    http://wiki.netbeans.org/HowToConfigureXDebug

    http://www.firephp.org/

    https://enboliviacom.wordpress.com/2013/03/25/analizar-el-rendimiento-de-las-consultas-sql-en-aplicaciones-php-con-firephp/

    【讨论】:

      【解决方案2】:

      当我在 php.ini 中给出 dll 的完整路径时,我发现它起作用了

      zend_extension="C:\Program Files (x86)\PHP\ext\php_xdebug-2.2.6-5.3-vc9.dll"

      我认为您也在使用记事本中的 DBGp 插件设置断点 - 在边距中显示红点。我还发现,当调试停止在该行时,显示当前行的绿色箭头在红点下方,并不那么明显。

      编辑: session.save_path 设置的使用也会影响 DBGp,它仅适用于提到的最后一个站点。因此,请确保最后提及 localhost 根目录:

      ;Application xyz must keep session variables separate
      [PATH=C:\inetpub\wwwroot\xyz]
      session.save_path = "C:\temp\xyz"
      ;...etc
      
      ;Must have this for DBGp to function on all localhost sites
      [PATH=C:\inetpub\wwwroot]
      session.save_path = "C:\temp"
      

      【讨论】:

      • 让我试试这个:) 谢谢
      • 它工作了一段时间,然后更新了记事本,它不再工作了。将 PHP 从 5.3 升级到 5.6,因为 XDebug 向导说不支持低于 5.4。没区别。我放弃。现在尝试 5.6 phpdbg 交互式调试器。
      • 其实最简单的就是用CodeLobster做调试。即使你不把它当做 IDE 使用,它的调试效果也很好,不像 DBGp 那样脆弱。
      猜你喜欢
      • 2020-07-16
      • 1970-01-01
      • 2011-07-05
      • 2012-03-31
      • 1970-01-01
      • 2020-07-31
      • 1970-01-01
      • 2021-12-03
      • 2014-08-03
      相关资源
      最近更新 更多