How To Install xhprof on CentOS 7
Introduction
In this tutorial we learn how to install xhprof on CentOS 7.
What is xhprof
XHProf is a function-level hierarchical profiler for PHP and has a simple HTML based navigational interface. The raw data collection component, implemented in C (as a PHP extension, provided by the “php-pecl-xhprof” package). The reporting/UI layer is all in PHP. It is capable of reporting function-level inclusive and exclusive wall times, memory usage, CPU times and number of calls for each function. Additionally, it supports ability to compare two runs (hierarchical DIFF reports), or aggregate results from multiple runs. Documentation /usr/share/doc/pear/xhprof/xhprof_html/docs/index.html
We can use yum or dnf to install xhprof on CentOS 7. In this tutorial we discuss both methods but you only need to choose one of method to install xhprof.
Install xhprof on CentOS 7 Using yum
Update yum database with yum using the following command.
sudo yum makecache
After updating yum database, We can install xhprof using yum by running the following command:
sudo yum -y install xhprof
Install xhprof on CentOS 7 Using dnf
If you don’t have dnf installed you can install DNF on CentOS 7 first.
Update yum database with dnf using the following command.
sudo dnf makecache
After updating yum database, We can install xhprof using dnf by running the following command:
sudo dnf -y install xhprof
How To Uninstall xhprof on CentOS 7
To uninstall only the xhprof package we can use the following command:
sudo dnf remove xhprof
References
Summary
In this tutorial we learn how to install xhprof on CentOS 7 using yum and dnf.