Eclipse PDT+XDebug

By phpandtips
  1. install eclipse http://www.eclipse.org/downloads/
  2. install apache+php or xampp;
  3. install xdebug version http://www.xdebug.org/
    1. download xdebug that matches the PHP
    2. copy the .dll file to the php ext directory, e.g. c:\xampp\php\ext\
    3. edit php.ini e.g. c:\xampp\apache\bin\php.ini
      1. comment everything in “[zend]“
      2. add
        [xdebug]
        xdebug.remote_enable=1
        xdebug.remote_host=”localhost”
        xdebug.remote_port=9000
        xdebug.remote_handler=”dbgp”
        zend_extension_ts=”C:\xampp\php\ext\php_xdebug-2.0.0-5.2.2.dll”
    4. restart apache
    5. test Xdebug by checking phpinfo()
  4. install Eclipse PDT
    1. Help > Software Updates… > Available Software > Manage Sites…
    2. Add… > add the DLTK 1.0 interim site: http://download.eclipse.org/technology/dltk/updates-dev/1.0/
    3. Add… > add the PDT 2.0 interim site: http://download.eclipse.org/tools/pdt/updates/2.0/
    4. Enable the Ganymede Update site (if not already enabled): download.eclipse.org/releases/ganymede/
    5. Expand the DLTK site and select the Dynamic Languages Toolkit – Core Frameworks or Dynamic Languages Toolkit – Core Frameworks SDK Feature
    6. Expand the PDT Update Site and select the PDT or PDT SDK Feature
    7. Install…
  5. Run debug in eclipse
    1. Change to PHP Debug Perspective: Window->Open Perspective->PHP Debug
    2. Run ->Debug Configurations-> select PHP Web Page or PHP Script -> click “New” button -> give a name and select a start file -> click “Debug”
    3. Ctrl-Shift-B: set breakpoint; F5: step in; F6: step out; F8: run;
  6. Window->Preferences
    • General->Web Browser: select the browser you’d like to use
    • PHP->Debug: select XDebug as your PHP Debugger

Tags: , , , ,

2 Responses to “Eclipse PDT+XDebug”

  1. Eftikasa Blog Says:

    thanks

    very good

    :)

  2. Augie Marcello Says:

    Thank You this works great!
    I’m using WAMP and the one mistake I made was editing the wrong php.ini file in the php folder.

    If your using WAMP use this path:
    C:\wamp\bin\apache\Apache2.2.11\bin\php.ini

    You now its installed when you the Zend engine 2 text on your phpinfo page has the third line which reads:

    This program makes use of the Zend Scripting Language Engine:
    Zend Engine v2.2.0, Copyright (c) 1998-2008 Zend Technologies
    with Xdebug v2.0.4, Copyright (c) 2002-2008, by Derick Rethans

    Thanks!
    -Augie Marcello

Leave a Reply