1. Download and install and configure XAMPP
I downloaded the XAMPP lite (Lite version) Zip package,
Http://www.apachefriends.org/zh_cn/xampp-windows.html
According to the description in XAMPP, decompressing the package to the root directory means you can use it directly without running "setup_xampp.bat" for configuration.
(See: http://www.apachefriends.org/zh_cn/xampp-windows.html#1721)
So my decompression path is C:/xampplite.
Run xampp-control.exe to start Apache
Access http: // localhost/XAMPP/phpinfo. php
The PHP configuration file used by Apache is: C: \ xampplite \ apache \ bin \ PHP. ini.
Open PHP. ini and add the following configuration information to enable xdebug.
PHP. ini configuration code
- ; Load xdebug
- Zend_extension_ts = "C:/xampplite/PHP/EXT/php_xdebug.dll"
- ; Xdebug Configuration
- [Xdebug]
- ; Enable Automatic Tracking
- Xdebug. auto_trace = on
- ; Enable exception tracking
- Xdebug. show_exception_trace = on
- ; Enable Automatic Start of remote debugging
- Xdebug. remote_autostart = on
- ; Enable remote debugging
- Xdebug. remote_enable = on
- ; Collect Variables
- Xdebug. collect_vars = on
- ; Collect return values
- Xdebug. collect_return = on
- ; Collect Parameters
- Xdebug. collect_params = on
Restart Apache and refresh the phpinfo. PHP page. If you can see the xdebug information, the configuration is successful.
2. install and configure eclipse PDT
Download and install JRE from http://www.java.com
Download PDT all in ones from http://www.eclipse.org/pdt/downloads/
After decompression, run the double-hitting eclipse.exe command to run PDT and select workspace (my options are E:/PDT-ws)
Open Window> perference> php> PHP executables
Add an executable:
Name: xampplite-PHP
Executable path: C: \ xampplite \ PHP \ php.exe
Php ini file: C: \ xampplite \ apache \ bin \ PHP. ini
PHP Debugger: xdebug
Open Window-> perference-> PHP-> debug and set:
PHP debuger: xdegug
Server: Default
PHP executable: xampplite-PHP
Uncheck "break at first line"
3. debug the PHP Project
Create Project proj1, create an index. php, enter the appropriate PHP code, and set a breakpoint
Open the Apache configuration file httpd. conf and add:
Httpd. conf code
- Alias/proj1 E:/PDT-WS/proj1/
- Alias/proj1/E:/PDT-WS/proj1/
- <Directory "E:/PDT-WS/proj1/">
- Options indexes followsymlinks between des execcgi
- AllowOverride all
- Order allow, deny
- Allow from all
- </Directory>
Restart Apache
Return to eclipse PDT, right-click index. php,
Select debug as --> php web page to perform breakpoint debugging.