14.6. Profiling with Xdebug

Xdebug is just like APD an extension that is used to collect data while executing a script, though the philosophy behind this extension is different. Where APD mainly focuses on profiling, Xdebug also focuses on debugging of scripts, including breakpoints and stepping through code. Profiling with Xdebug can be accomplished in two ways:

  • By tracing executed scripts to a file

  • By generating profiling data in the cachegrind format to a file

cachegrind is a profiler for programs written in C, and comes with a very nice front-end for KDE: KCachegrind.

14.6.1. Installing Xdebug

Just like APD, you can install Xdebug (http://xdebug.org) from PECL by running pear install xdebug. After installation, you must load Xdebug into Zend ...

Get PHP 5 Power Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.