I am sure all of you have used ‘echo’ and ‘print_r’ to debug PHP.
We all know that this way debugging is hard and you need to remember to remove them from production server.
Well, thanks to xdebug you can now debug, and you don’t need expensive or blotted IDE for that, just plain and simple Notepad++ can do the job.
In this post we will setup xdebug and DBGp plugin with Notepad++.
Let’s start by installing xdebug.
- Download the latest release of xdebug for PHP version you are using.
- Copy xdebug dll file into php’s extension directory, in my case, as I use wamp, it is c:\wamp\php\ext .
- Now we need to configure xdebug so that it get recognized by PHP, so open php.ini
- Add following at the end of your php.ini file
[xdebug]
zend_extension_ts="c:/wamp/php/ext/php_xdebug-2.0.3-5.2.5.dll"
xdebug.profiler_output_dir = "c:/wamp/tmp/xdebug"
xdebug.profiler_output_name = "cachegrind.out.%p"
xdebug.profiler_enable = 0
xdebug.profiler_append=0
xdebug.extended_info=1
xdebug.remote_enable=1
xdebug.remote_handler=dbgp
xdebug.remote_mode=req
xdebug.remote_host=127.0.0.1
xdebug.remote_port=9000
xdebug.idekey=xdebug
xdebug.remote_log="c:/wamp/tmp/xdebug/xdebug_remot.log"
xdebug.show_exception_trace=0
xdebug.show_local_vars=9
xdebug.show_mem_delta=0
xdebug.trace_format=0
- Just create a folder ‘xdebug’ in ‘c:\wamp\tmp’ folder.
- Finally restart Apache service .
With these steps you have, finished xdebug installation, it is configured for profiling application and remote debugging. Check documentation to know what all these configuration do, and tweak according to your preference.
We will now install DBGP plugin for Notepad++. Make sure you have latest version of Notepad++ is installed.
- Download the latest release of DBGp Plugin.
- Unzip and move dbgpPlugin.dll file to plugins folder of your notepad++ installation folder, in my case the path is “C:\Program Files\Notepad++\plugins”.
- Check out the readme.txt file, that is bundled with plugin, to make sure we don’t miss anything.
- Now open Notepad++, and you should see DBGp option in plugins menu.
Well we are now almost finished with setup, only ting remaining is to configure DBGP to listen to right port and we are done.
Goto “Plugins->DBGp->Config” to open the configuration screen of DBGp plugin.
Fill the details as shown in the image above. IDE KEY should be same to the one you specified in php.ini settings above. Click Ok and you are done.
To start debugging just add “?XDEBUG_SESSION_START=session_name” at end of you url. ‘session_name’ could be anything you want to keep.
分享到:
相关推荐
Debugging是用 VisualC++ 语言开发的
Debugging Tools for Windows (x64)和Debugging Tools for Windows (x86) 微软Debugging Tools for Windows工具,简称windbg,查看dmp文件,调试驱动程序、应用程序等。
高清彩版 Advanced+Apple+Debugging+&+Reverse+Engineering,+2nd+Edition_Explore+code+through+LLDB,+Python+and+DTrace-Derek+Selander
全面升级 Xcode 10, Swift 4.2,是一本关于iOS调试和反编译不可多得的资料!
Linux_Debugging_and_Performance_Tuning_Tips_and_Techniques.rar
This extension is very useful for PHP developers that are using PHP tools with Xdebug support like PHPStorm, Eclipse with PDT, Netbeans and MacGDBp or any other Xdebug compatible profiling tool like ...
用来学习如何利用LLDB提升自己的debug能力。自制epub,便于用iBook查看
I mean, if the developer had a complete understanding of the program, there wouldn’t be any bugs and they wouldn’t be debugging in the first place, right? Don’t think like that. There are always ...
Linux Debugging and Performance Tuning Tips and Techniques
Inside Windows Debugging - Practical Debugging and Tracing Strategies 英文无水印pdf pdf所有页面使用FoxitReader和PDF-XChangeViewer测试都可以打开 本资源转载自网络,如有侵权,请联系上传者或csdn删除 ...
Linux Debugging and Performance Tuning Tips and Techniques.rar
Debugging+With+Gdb,+9Th+Ed.pdf Learning_GNU_Emacs_Third_Edition.chm Linux.Commands.Editors.and.Shell.Programming.chm Managing+Projects+with+GNU+Make.pdf O'Reilly.Bash.Cookbook.May.2007.pdf ...
Debugging+With+Gdb,+9Th+Ed.pdf Learning_GNU_Emacs_Third_Edition.chm Linux.Commands.Editors.and.Shell.Programming.chm Managing+Projects+with+GNU+Make.pdf O'Reilly.Bash.Cookbook.May.2007.pdf Prentice....
Debugging+With+Gdb,+9Th+Ed.pdf Learning_GNU_Emacs_Third_Edition.chm Linux.Commands.Editors.and.Shell.Programming.chm Managing+Projects+with+GNU+Make.pdf O'Reilly.Bash.Cookbook.May.2007.pdf Prentice....
Debugging+With+Gdb,+9Th+Ed.pdf Learning_GNU_Emacs_Third_Edition.chm Linux.Commands.Editors.and.Shell.Programming.chm Managing+Projects+with+GNU+Make.pdf O'Reilly.Bash.Cookbook.May.2007.pdf Prentice....
Developing and Debugging CICS Programs Using Rational Developer for System z(RDz)
Linux Debugging and Performance Tuning (Prentice, 2005)
Debugging+With+Gdb,+9Th+Ed.pdf Learning_GNU_Emacs_Third_Edition.chm Linux.Commands.Editors.and.Shell.Programming.chm Managing+Projects+with+GNU+Make.pdf O'Reilly.Bash.Cookbook.May.2007.pdf Prentice....
Debugging+With+Gdb,+9Th+Ed.pdf Learning_GNU_Emacs_Third_Edition.chm Linux.Commands.Editors.and.Shell.Programming.chm Managing+Projects+with+GNU+Make.pdf O'Reilly.Bash.Cookbook.May.2007.pdf Prentice....