Systems Engineering

Debug CakePHP in Eclipse – Bake Cakes Not Brownies

June 5, 2008

  • Guest Blogger

Having developed several CakePHP projects in Eclipse, I’ve always been on the lookout for things to make my life easier. Not too long ago I stumbled across an addition to Eclipse’s PHP Development Tools (PDT), which integrates the Zend/Xdebug debuggers into the Eclipse environment. The ZendDebugger binaries are available for OS X, Linux and Windows platforms at Zend’s website http://www.zend.com/en/community/pdt.

Also on this page, you may also find an all-in-one bundle for Eclipse that has everything you need to get started. Once the debugger is loaded in PHP and your web server has been restarted, you can open Eclipses debug dialog and create a new PHP Web Page profile.

First configure the “PHP Server” section to point to the development server your project exists on. Then set /<project name>/app/webroot/index.php for the “File” section of the PHP server debug dialog as well as http://<host name>/, index.php respectively for the two entry boxes of the “URL” section. On the advanced tab select “Debug All Pages” and the debugger will now recognize any breakpoints in all .php files in your project!