chrisdowson / xhprof
XHProf: A Hierarchical Profiler for PHP
Installs: 4
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 916
pkg:composer/chrisdowson/xhprof
README
Install
Compile in Linux
$ cd extension/
$ phpize
$ ./configure [--with-php-config=/path/to/php-config]
$ make && make install
edit php.ini, add a new line:
extension=xhprof.so
make sure it works:
php -m |grep xhprof
Profile your page
Add the following, as early as possible, to your initial PHP script:
xhprof_enable(); register_shutdown_function( function () { file_put_contents("/tmp/" . uniqid() . ".ApplicationName.xhprof", serialize(xhprof_disable())); } );
Look at the results:
Make sure xhprof_html directory is reachable from your web application and reach the page xhprof_html/index.php to see a list of profiles.