Php development environment setup (eclipse pdt xampp xdebug)

Source: Internet
Author: User
Tags php debugger php development environment

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  
  1. ; Load xdebug
  2. Zend_extension_ts = "C:/xampplite/PHP/EXT/php_xdebug.dll"
  3. ; Xdebug Configuration
  4. [Xdebug]
  5. ; Enable Automatic Tracking
  6. Xdebug. auto_trace = on
  7. ; Enable exception tracking
  8. Xdebug. show_exception_trace = on
  9. ; Enable Automatic Start of remote debugging
  10. Xdebug. remote_autostart = on
  11. ; Enable remote debugging
  12. Xdebug. remote_enable = on
  13. ; Collect Variables
  14. Xdebug. collect_vars = on
  15. ; Collect return values
  16. Xdebug. collect_return = on
  17. ; Collect Parameters
  18. 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  
  1. Alias/proj1 E:/PDT-WS/proj1/
  2. Alias/proj1/E:/PDT-WS/proj1/
  3. <Directory "E:/PDT-WS/proj1/">
  4. Options indexes followsymlinks between des execcgi
  5. AllowOverride all
  6. Order allow, deny
  7. Allow from all
  8. </Directory>

Restart Apache

 

Return to eclipse PDT, right-click index. php,

Select debug as --> php web page to perform breakpoint debugging.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.