Eclipse PDT+XDebug
By phpandtips
- install eclipse http://www.eclipse.org/downloads/
- install apache+php or xampp;
- install xdebug version http://www.xdebug.org/
- download xdebug that matches the PHP
- copy the .dll file to the php ext directory, e.g. c:\xampp\php\ext\
- edit php.ini e.g. c:\xampp\apache\bin\php.ini
- comment everything in “[zend]“
- 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”
- restart apache
- test Xdebug by checking phpinfo()
- install Eclipse PDT
- Help > Software Updates… > Available Software > Manage Sites…
- Add… > add the DLTK 1.0 interim site: http://download.eclipse.org/technology/dltk/updates-dev/1.0/
- Add… > add the PDT 2.0 interim site: http://download.eclipse.org/tools/pdt/updates/2.0/
- Enable the Ganymede Update site (if not already enabled): download.eclipse.org/releases/ganymede/
- Expand the DLTK site and select the Dynamic Languages Toolkit – Core Frameworks or Dynamic Languages Toolkit – Core Frameworks SDK Feature
- Expand the PDT Update Site and select the PDT or PDT SDK Feature
- Install…
- Run debug in eclipse
- Change to PHP Debug Perspective: Window->Open Perspective->PHP Debug
- Run ->Debug Configurations-> select PHP Web Page or PHP Script -> click “New” button -> give a name and select a start file -> click “Debug”
- Ctrl-Shift-B: set breakpoint; F5: step in; F6: step out; F8: run;
- Window->Preferences
- General->Web Browser: select the browser you’d like to use
- PHP->Debug: select XDebug as your PHP Debugger
Tags: eclipse, pdt, php, php debug, xdebug
This entry was posted on February 15, 2009 at 6:55 pm and is filed under eclipse, php. You can follow any responses to this entry through the RSS 2.0 feed.
You can leave a response, or trackback from your own site.
February 20, 2009 at 2:12 am
thanks
very good
March 2, 2009 at 5:13 pm
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