Install XHProf in Ubuntu 14.04

XHProf is a function-level hierarchical profiler for PHP and has a simple HTML based user interface. This article will show you the way to install and test XHProf in Ubuntu 14.04


When you talk, you are only repeating what you know; but when you listen, you learn something new


Install Graphviz:

Install XHProf from pecl:

Adding XHProf to PHP5:


Install XHProf report view:

Create a test script:

And view the report:

In the better way, you should create header.php, and footer.php and change apache2 configuration so that you can track your request automatically


  • Install XHProf from pecl:
    sudo pecl install xhprof-0.9.4

    $ php -i|grep xhprof
    xhprof => 0.9.2

    Anyone else notice the version number difference? Also when testing
    xhprof returns xhprof: command not found

    Otherwise the article was very helpful and to the point, keep up the good work.