pear upgrade PEAR
pecl install xhprof-0.9.2
wget http://pecl.php.net/get/xhprof-0.9.2.tgz
tar -xzf xhprof-0.9.2.tgz && cd xhprof-0.9.2
phpize
make
cp modules/xhprof.so $(php-config --extension-dir)/
<?php
xhprof_enable(XHPROF_FLAGS_CPU + XHPROF_FLAGS_MEMORY);
register_shutdown_function(function() {
$xhprof_data = xhprof_disable();
$namespace = 'sitename';
$filename = '/tmp/' . uniqid() . '.' . $namespace . '.xhprof';
file_put_contents($filename, serialize($xhprof_data));
});
Load the site, and you should now see some .xhprof files in /tmp. These can be viewed with a single page version of the original UI found here: