Linux, FreeBSD, MacOSX:
pear install http://pecl.php.net/get/xdebug
Add to php.ini:
zend_extension="/usr/local/php/modules/xdebug.so"
Windows:
Download Xdebug from http://xdebug.org
Add to php.ini:
zend_extension_ts="c:/usr/local/php/modules/xdebug.so"