XHProf profiler is developed by Facebook and open sourced in March 2009 under the Apache 2.0 license. XHProf is a function-level hierarchical profiler, with a PHP extension (written in C) to collect the raw data, and a few PHP scripts for the reporting/UI layer.
The easiest way to get it is via the PEAR installer (package home):
install php5-common pear channel-update pear.php.net pecl install xhprof
Once you have XHProf installed, you should enable it. Open your /etc/php5/conf.d/xhprof.ini and add
[xhprof] extension=xhprof.so xhprof.output_dir="/var/tmp/xhprof"
Where /var/tmp/xhprof is the directory that will collect the profile data for each run.
Restart apache, and the XHProf extension should be enabled (check with "php -m" that this is the case).
Comments
Post new comment