How to install and setup Eclipse for PHP debug
The PHP Development Tools (PDT) plug-in, when installed with Eclipse Europa, gives you that ability to quickly write and debug PHP scripts and pages.PDT supports two debugging tools:
- XDebug and
- Zend Debugger
This post contains a brief description (along with links to various tools and S/W used) of how to go about setting up a complete PHP development & debug environment alongside a WAMP (Windows Apache, MySQL, PHP).
What you will need:
- WAMP (assuming you are using Windows) – http://www.wampserver.com/en/download.php Version 2.0i as on 6th July 2010. Includes
- Apache 2.2.11
- PHP 5.3.0
- MySQL 5.1.36
- Phpmyadmin 18.104.22.168
- Eclipse Helios for PHP – http://www.eclipse.org
- Xdebug – http://xdebug.org/
- Install WAMP. Before you dive in, make sure you do not have a previous version of WAMP installed. If IIS or Skype are installed, please stop/close these as they may be using port 80 that WAMP needs!!
- When ready, double click WAMP installer executable and follow instructions on screen to install. Default install location is C:\wamp.
- Once installed, an icon in the right hand side of the windows task bar allows managing the WAMP Server.
- Change default port 80 that Apache listens on, to say 8080 if you have other applications that need to use the port 80. This can be done by editing C:\wamp\bin\apache\Apache2.2.11\conf\httpd.conf file and replacing 80 with 8080 (or any other free port that you can/wish to use). Restart Apache after you have saved the changed httpd.conf file.
- Install Eclipse – extract the downloaded ZIP file to a location of your choice and you are done. To launch the Eclipse application, double click the eclipse.exe. This file is located in the folder where the ZIP file has been extracted to.
- Copy the “php_xdebug-2.1.0-5.3-vc6.dll” file (downloaded from xdebug.org) to C:\wamp\bin\php\php5.3.0\ext. Replace “C:\wamp” with the folder path if you installed WAMP in a non-default location. Now edit the C:\wamp\bin\php\php5.3.0\php.ini file and append the following to it.