BenArticleCovers notepad ++
Installation, xdebug
Dbgp plug-in Installation
Installation and simple debugging of PHP
.
How does dbgp plug-in (plugin) work?
1. Web browser (for example, Firefox
) Access Apache through the http port (80) request URL
Server.
2. xdebug
Is an extension of Apache (DLL in Windows), similar to the GD library.
3. xdebug
Is a web server (APACHE) and remote debugging client (for example, the dbgp plug-in of notepad ++ ).
Communication between them through port 9000.
Wire flow:
Web Browser
<=>Port 80
<=>Apache
+ PHP
+ Xdebug
Extension
<=>Port 9000
<=>Dbgp Plugin-Notepad ++
1. Enable notepad ++ and the bdgp plug-in opens port 9000.
2. Web browser requests to Apache
Request a PHP page. The request URL contains a specified parameter.
(Xdebug_session_start) to activate remote debugging.
3. Apache
Call PHP
Interpreter (Interpreter ).
4. PHP interpreter loading xdebug
Module.
5. xdebug
The module detects the xdebug_session_start parameter sent in step 1 and enables remote debugging.
6. xdebug
Connect to the remote debugging client (depending on xdebug
In PHP. INI ).
7. xdebug
After establishing a connection with the debugging client, you can use port 9000 to perform a conversation.
8. When the debugging client sends
PHP
The interpreter executes the PHP statement and sends the corresponding output to the Web browser through port 80 of Apache.
9. When all PHPCodeXdebug
Disconnect from the debugging client.
10. Apache
Disconnect the HTTP connection from the web browser.
Installation Steps
First, install the Apache and PHP runtime environments. I won't talk about this. If it won't be installed, check it here.
You can also use XAMPP
And winlamp
We also recommend that you use a development environment instead of a production environment.
The XAMPP and PHP modules I use are installed in the C:/XAMPP/PHP Directory (this varies from person to person ).
1. Install notepad ++. Do not select the EXE installation package and select zip.
Package, use the ANSI version in the package (create a folder notepad ++ to C:/program files, copy all files under ANSI ), otherwise, an error will be reported when you install the dbgp plug-in.
(This ANSI plugin is not compatible with your Unicode
Notepad ++ ).
2. Download notepad ++
Chinese XML file
, Rename it nativelang. xml and put it in the root directory of notepad ++ (C:/program files/notepad ++ ).
3. Download The dbgp plug-in
Copy the dbgpplugin.dlland readme.txt files to the Plugins directory of notepad ++ (C:/program files/notepad ++/plugins ).
4. Create a PHP file phpinfo. php and print the configuration information of PHP.
<? PHP
Phpinfo ();
?>
5,
Create a supplier folder in the htdocs directory of Apache and run phpinfo. php, that is, http: // localhost.
/Supplier/phpinfo. php
Check your PHP version. My PHP version is 5.1.4. Check the location of your php. ini file and the path of the PHP extension library extensions folder. For example:
The figure shows:
The PHP. ini file is inC:/webserver/apache2/modules/PHP/
Folder
The path of the extension library isC:/webserver/apache2/modules/PHP/EXT/
6. Go to the xdebug official website.
Download the xdebug for PHP module. Make sure that it matches your PHP version. For me, it isPHP 5.1.2-5.1.6
, The corresponding extension library isPhp_xdebug-2.0.0-5.1.6.dll
7. CopyPhp_xdebug-2.0.0-5.1.6.dll
File to your PHP extension library folder, such:C:/webserver/apache2/modules/PHP/EXT/
(In PHP. iniExtension_dir
Item)
8. Open PHP. ini in Windows notepad and add the following lines to the end of PHP. ini.
[Xdebug]
Zend_extension_ts = "C:/webserver/apache2/modules/PHP/EXT/php_xdebug-2.0.0-5.1.6.dll"
Xdebug. remote_enable = 1
Xdebug. remote_handler = dbgp
Xdebug. remote_host = 127.0.0.1
Xdebug. remote_mode = req
Xdebug. idekey = default
Xdebug. remote_log = "D:/www/ourcommunity. Dev/log/xdebug. log"
Xdebug. remote_port = 9000
Xdebug. show_exception_trace = 0
Xdebug. show_local_vars = 9
Xdebug. show_mem_delta = 0
Xdebug. trace_format = 0
Set zend_extension_ts and xdebug. remote_log based on your own situation.
9. Restart Apache. If Apache fails to be started, try to comment out the Zend configuration item in PHP. ini.
For example:
; Zend_extension_manager.optimizer_ts = "C:/XAMPP/PHP/zendoptimizer/lib/optimizer"
10. Run the phpinfo. php file again. Do you see the xdebug area in the file?
Configure notepad ++
1. Open notepad ++ and enter the plug-in menu. The dbgp drop-down menu list is displayed.
2. Click"Config..."Menu item, configure the dbgp debugger like this (remote path and local path are the folders where your php file is located)
Simple Example
To be continued ......