国产一级a片免费看高清,亚洲熟女中文字幕在线视频,黄三级高清在线播放,免费黄色视频在线看

打開APP
userphoto
未登錄

開通VIP,暢享免費電子書等14項超值服

開通VIP
How to Setup BDGp debugger in Notepad to De...

How to Setup BDGp debugger in Notepad++ to Debug PHP

March 27th, 2010 | Category: Computer, PHP, Program Language

Introduction

This article only covers the processes to install Notepad++ and Notepad++ DBGp plugin debugger for debugging PHP scripts.

How does the DBGp Plugin work

The web browser requests url through the http port (80) to the Apache server.
XDebug is an Apache extension (dll), like GD2 graphic library or so…
XDebug is an interface betweeen the server (Apache) and a remote debugging client (DBGp Plugin), they communicate through another port (9000).

Web browser <==> Port 80 <==> Apache + PHP + Xdebug extension <==> Port 9000 <==> DBGp Plugin-notepad++

  1. Notepad++ is started, DBGpplugin opens socket 9000
  2. Web browser requests a PHP page from Apache server. This request includes in the url a specific parameter to start remote debugging (XDEBUG_SESSION_START).
  3. Web server (Apache) fires up the PHP interpreter
  4. PHP interpreter loads XDebug module.
  5. XDebug module detects the specific parameter and starts remote debugging…
  6. XDebug connects to the “remote” debugging client (depending on xdebug configuration)
  7. XDebug and debug client are connected, with user interaction, commands and data are sent over the debugging port (9000)
  8. When debug client instructs XDebug to execute one or more php statements, PHP code is executed and possible output is sent over http Port (80) to web browser.
  9. When all instruction of php are executed, XDdebug disconnects from client.
  10. Apache closes connection to browser.

Installation steps

You should install Apache and PHP on your own (WinLamp is a good package for Windows, but there others like Xampp, you can also install Apache + PHP without a ‘package’…). For reference purpose, my PHP module is in the C:\WebServer\Apache2\modules\php directory (it may be different with others Apache + PHP packages).

1. Download the npp.X.Y.Installer.exe (V4.3 or higher) to your hard drive.

2. Double click the npp.X.Y.Installer.exe on your hard drive to install Notepad++ onto your computer. The default installation directory is C:\Program Files\Notepad++\.

3. Download DBGP plugin to your computer. It is a zipped file.

6.Unzip the file and move the dbgpPlugin.dll and README.txt to C:\Program Files\Notepad++\plugins. Be sure to read the Readme.txt for the latest information.

7. Create a php file name phpinfo.php with the following lines in it:

<?php    phpinfo();?>

8. Load the phpinfo.php in your server. For me, that is: http://localhost/supplier/phpinfo.php. Check the php version number at the top of the page. My PHP is version 5.1.4 Also pay attention to your php.ini location. My php.ini is at: C:\WebServer\Apache2\modules\php\. Also look for your php extension directory under the Configuration – PHP Core section (you can search extension_dir). For my php, it is: C:\WebServer\Apache2\modules\php\ext\.

9. Go to http://www.xdebug.org/ to download the Xdebug Windows module for your PHP version. For me, that is PHP 5.1.2 – 5.1.6. The file is php_xdebug-2.0.0-5.1.6.dll.


10. Move the php_xdebug-2.0.0-5.1.6.dll to your php extensions directory (C:\WebServer\Apache2\modules\php\ext\ or anything else according to your extension_dir parameter in your

php.ini configuration file)

11. Open your php.ini file in any text editor and add the following lines to, just below the Windows extensions section (you can put it anywhere in the file)

zend_extension_ts="C:/WebServer/Apache2/modules/php/ext/php_xdebug-2.0.0-5.1.6.dll"xdebug.remote_enable=1xdebug.remote_handler=dbgpxdebug.remote_host=127.0.0.1xdebug.remote_mode=reqxdebug.idekey=defaultxdebug.remote_log="D:/www/ourcommunity.dev/log/xdebug.log"xdebug.remote_port=9000xdebug.show_exception_trace=0xdebug.show_local_vars=9xdebug.show_mem_delta=0xdebug.trace_format=0

10. Change “C:/WebServer/Apache2/modules/php/ext/php_xdebug-2.0.0-5.1.6.dll” to your extension folder and filename. Change “D:/www/ourcommunity.dev” to your application directory.

11. Reboot your computer (the easiest way to restart apache and other programs).

Nota Bene : If your Apache Server doesn’t restart, perhaps you’ll have to comment the line of the Zend Optimizer (I had to do this)

;zend_extension_manager.optimizer_ts = "C:\xampp\php\zendOptimizer\lib\Optimizer"

12. Load the phpinfo.php file again (http://localhost/supplier/phpinfo.php). You should see the Xdebug section in the phpinfo page.


13. You should see the DBGp menu shows up in the Notepad++ plugin menu.

14. Click the “Config…” item and configure the DBGp debugger as shown (the Remote Path and Local Path is the folder where your php files resides.

15. Create a test file, debugTest.php with the following lines in it :

<?php    for ( $i=1; $i<10; $i++) {        echo "<br>Line $i";    }?>

Click Debugger under the Plugin -> DBGp menu to open the Debugger window at the lower section. Add a breakpoint on line 2 (click on the 2nd line and on the BreakPoint button, the one with a red point).

16. Make sure that you can load the debugTest.php with http://localhost/supplier/debugTest.php and it should show as below.

17. Add “?XDEBUG_SESSION_START=session_name” to the end of the url in the browser. Now the browser request is: http://localhost/supplier/debugTest.php?XDEBUG_SESSION_START=session_name (you can specify whatever session_name you want : test, dummy…)

You should see the Notepad++ icon on the taskbar blinking. If you open it up, the DBGp debug window comes to live. You can use the DBGp toolbar to step into, step over and step out and run the code.

BDGP Plugin Break Point

18. To see the global and local variables, select “Refresh local context on every step” and “Refresh global context on every step” in the DBGp configuration (Plugins/DBGp/Config… Np++ menu). It should be similar as the picture shown below.

19. Now you can see the global variables at the lower left hand corner. To access local variable in the program, select the variable then hit CTRL-F7. This put the selected variable into the Eval window. Click OK will show the current value of the variable, as shown below.
That is it. Good luck with your PHP project.

Special thanks to Damjan Cvetko (zobo) for answering my questions on setting up the DBGp on SourceForge.net. See the SourceForge.net Forumfor detail discussion:

Reference

本站僅提供存儲服務(wù),所有內(nèi)容均由用戶發(fā)布,如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請點擊舉報。
打開APP,閱讀全文并永久保存 查看更多類似文章
猜你喜歡
類似文章
使用NetBeans調(diào)試PHP?
[史上最佳 Mac+PhpStorm+XAMPP+Xdebug 集成開發(fā)和斷點調(diào)試環(huán)境的配置]
zend10.6 調(diào)試總彈出 zend debugger extension is not installed!
mac安裝xdebug調(diào)試php
phpstorm配置Xdebug進(jìn)行調(diào)試PHP教程
PHPStorm+XDebug進(jìn)行調(diào)試圖文教程
更多類似文章 >>
生活服務(wù)
分享 收藏 導(dǎo)長圖 關(guān)注 下載文章
綁定賬號成功
后續(xù)可登錄賬號暢享VIP特權(quán)!
如果VIP功能使用有故障,
可點擊這里聯(lián)系客服!

聯(lián)系客服