Thursday, April 24, 2014

Debugging PHP using WAMP and Aptana Studio

What you need :

  1. Latest Version of Aptana Studio.
    if you don't have aptana studio you can download aptana studio from here
  2. WAMP.
    if you don't have WAMP , you can download WAMP from here
  3. Xdebug.
    if you have Xdebug you can download Xdebug from here
    ** You can check whether Xdebug is already installed inside your WAMP server by searching for "[XDebug]" section  on your php.ini file.
Configuration


  • Install and Setup Aptana Studio

  • Install and Setup WAMP

  • Configure Xdebug in WAMPTo enable XDebug, locate the [XDebug] section in the php.ini file and update it as follows:

    [XDebug]
    zend_extension="[Path To WAMP]\php\ext\php_xdebug.dll"
    xdebug.remote_enable = 1
    xdebug.remote_handler = "dbgp"
    xdebug.remote_host = "127.0.0.1"
    xdebug.remote_port = 9000
Configure debug in Aptana Studio
  1. Open Window->Preferences.
  2. In the Preferences dialog navigate to Aptana Studio >> Editors >> PHP >> PHP Interpreters.
  3. Add Xdebug( PHP interpreter ) by giving the php information. Select the php.exe from WAMP.

  4.  In the Preferences dialog, open Aptana Studio -> Web Servers and Create a new Web Sever using "New".
  5. Choose Simple Web Server. Enter the data for the localhost server .

  6. Open Run ->Debug Configurations from the menu options.
  7.  Select the "PHP Web Page" Choose New Launch Configuration.
    Enter the field values and Apply.



  • Now Debug your PHP Project by  Debug As -> PHP Server. 

    Aptana Studio will automatically open the Debug Perspective and continue to debug. You can now debug your php web project just like you debug java applications in eclips.