为 PHP 配置 Notepad++ DBGP 插件和 XDebug

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/5139469/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-25 16:54:07  来源:igfitidea点击:

Configure Notepad++ DBGP plugin and XDebug for PHP

phppluginsnotepad++xdebug

提问by Wasim A.

I followed these steps:

我按照以下步骤操作:

  1. download x-debug*.dll to D:\Program Files\webserver\php\ext\php_xdebug.dll
  2. modify php.ini and insert following

    zend_extension_ts="D:\Program Files\webserver\php\ext\php_xdebug.dll"
    xdebug.remote_enable=1
    xdebug.remote_handler=dbgp
    xdebug.remote_mode=req
    xdebug.idekey=default
    xdebug.remote_autostart=1
    
  3. restart apache and XDebug is successfully installed.

  4. DBGP is installed successfully and configured with 127.0.0.1

  1. 将 x-debug*.dll 下载到 D:\Program Files\webserver\php\ext\php_xdebug.dll
  2. 修改php.ini并插入以下内容

    zend_extension_ts="D:\Program Files\webserver\php\ext\php_xdebug.dll"
    xdebug.remote_enable=1
    xdebug.remote_handler=dbgp
    xdebug.remote_mode=req
    xdebug.idekey=default
    xdebug.remote_autostart=1
    
  3. 重启apache,XDebug安装成功。

  4. DBGP安装成功并配置了127.0.0.1

but XDebugger is still not connecting/working with notepad++.

但 XDebugger 仍然没有连接/使用记事本++。

回答by Wasim A.

i found the answer here

我在这里找到了答案

http://thecancerus.com/debugging-php-using-xdebug-and-notepad-part-i/

http://thecancerus.com/debugging-php-using-xdebug-and-notepad-part-i/

Make sure you have latest version of Notepad++ is installed.

确保您安装了最新版本的 Notepad++。

  1. Download the latest release of DBGp Plugin.
  2. Unzip and move dbgpPlugin.dll file to plugins folder of your notepad++ installation folder, in my case the path is “C:Program FilesNotepad++plugins”.
  3. Check out the readme.txt file, that is bundled with plugin, to make sure we don't miss anything.
  4. Now open Notepad++, and you should see DBGp option in plugins menu.
  5. We are now almost finished with setup, only thing remaining is to configure DBGP to listen to right port and we are done.
  6. Goto “Plugins->DBGp->Config” to open the configuration screen of DBGp plugin. enter image description here
  7. IDE KEY should be same to the one you specified in php.ini settings above. Click Ok and you are done.
  8. To start debugging just add “?XDEBUG_SESSION_START=session_name” at end of you url. ‘session_name' could be anything you want to keep.
  1. 下载最新版本的DBGp 插件
  2. 将 dbgpPlugin.dll 文件解压并移动到 notepad++ 安装文件夹的 plugins 文件夹中,在我的情况下,路径是“C:Program FilesNotepad++plugins”。
  3. 查看与插件捆绑在一起的 readme.txt 文件,以确保我们不会遗漏任何内容。
  4. 现在打开 Notepad++,你应该在插件菜单中看到 DBGp 选项。
  5. 我们现在几乎完成了设置,剩下的就是配置 DBGP 以侦听正确的端口,我们就完成了。
  6. 进入“Plugins->DBGp->Config”打开DBGp插件配置界面。 enter image description here
  7. IDE KEY 应该与您在上面的 php.ini 设置中指定的相同。单击确定,您就完成了。
  8. 要开始调试,只需在 url 末尾添加“?XDEBUG_SESSION_START=session_name”。'session_name' 可以是您想要保留的任何内容。

回答by Rob Forrest

XDebug now have their very own wizard.

XDebug 现在有自己的向导。

http://xdebug.org/wizard.php

http://xdebug.org/wizard.php

All you have to do is copy and paste the contents of your phpinfo output into it. It'll provide you with the correct library and the details that you need to add to your php.ini.

您所要做的就是将 phpinfo 输出的内容复制并粘贴到其中。它将为您提供正确的库以及您需要添加到 php.ini 的详细信息。

Dont forget that you have to append your URL with ?XDEBUG_SESSION_START=nameto kick things off.

不要忘记您必须附加您的 URL?XDEBUG_SESSION_START=name才能开始。