Recent Posts
Archive
- [ 3 posts ] January 2010
- [ 2 posts ] September 2009
- [ 3 posts ] June 2009
- [ 3 posts ] May 2009
- [ 3 posts ] April 2009
- [ 6 posts ] March 2009
- [ 1 post ] February 2009
- [ 1 post ] January 2009
- [ 8 posts ] November 2008
- [ 7 posts ] October 2008
Compiling Xdebug on OSX (v2.1.0beta1)
Monday, 11 January 2010
Tagged: Website, General
Xdebug is essential. If I was a superhero, and had a utility belt, Xdebug would have a spot on there for sure.
In developing for CakePHP, and any PHP applications in general, Xdebug allows me to extend the basic error reporting of PHP to provide much more helpful information, as well as a host of other features that I'll explain briefly here.
I've just compiled and enabled the latest Xdebug 2.1.0beta1 available from the Xdebug website and it couldn't have been simpler:
- Download source
- Extract source compressed file
- Run: phpize
- Run: configure --enable-xdebug
- Run: make
- Copy modules/xdebug.so to somewhere useful for PHP to access it
- Change/Add the 'zend_extension' directive in php.ini to point to the copied file location
- Restart Apache
- Profit! .. or more precisely, Debug!
Okay, so after writing that list, it seems like a long process, but seriously, this took under 2 minutes, and I was up and running with the latest Xdebug version, and subsequently, able to flawlessly check code coverage on the upcoming CakePHP 1.3 core test cases without Segfaulting all over the shop.
So what is Xdebug?
You can read all about its features on their website, but here is a rundown. It enables better stack traces in the event there is an error with your application. It is capable of monitoring memory allocation to enable memory profiling and performance tuning of your app. Protection against infinite loops and recursion (trust me, a godsend!).
Most importantly for me is the remote debugging capabilities, the memory profiling (facilitated by Webgrind, and the code coverage analysis. These tools allow me to successfully deploy working, tested, checked and stable code with confidence.
Thanks Xdebug! 2.1.0 beta is looking very promising!
0 Comments
There are currently no comments for this post. Why not be the first to have your say?
