Xhprof is a PHP performance analysis tool. The xhprof version I used was 0.9.4,:http://pan.baidu.com/s/1jgggymi
Here are the steps to install, configure, and test xhprof in a redhat 4.4.7 environment. The installation was also adopted on some redhat versions. The choice here is a non-root installation, so the steps may be a little cumbersome.
1. You need to install Apache and PHP two tools first. This is the basis for installing the xhprof.
2. However, there are two "parts" that need to be installed. One is M4, one is autoconf, and these two are what I don't know. But it is needed. The installation method is as follows:
# cd file Download Catalog # wget http://ftp.gnu.org/gnu/m4/m4-1.4.9.tar.gz# tar-zxvf m4-1.4.9.tar.gz# cd m4-1.4.9/#./configure--prefi X=M4 installation directory && make && make install# cd file download Catalog # wget http://ftp.gnu.org/gnu/autoconf/autoconf-2.62.tar.gz# TAR-ZXVF autoconf-2.62.tar.gz# cd autoconf-2.62/#./configure--prefix=autoconf installation directory && make && make Inst All
After installation, the full path to the bin directory of the two parts is appended to the path= in. Bash_profile, and then. The. Bash_profile makes it effective, so that the executable program inside the bin can be accessed directly.
The full path to the bin directory under the 3.php installation directory is appended to the path= in. Bash_profile, and then. . bash_profile make it effective.
4. Then download the xhprof and install. Here's how:
# CD XHPROF installation package directory # tar xhprof-0.9.4.tgz# cd xhprof-0.9.4/extension/# phpize#./configure--with-php-config=php installation directory/bin /php-config# make && make install
This completes the installation. Next is the configuration.
5. Open the php.ini file. This file should be copied from the PHP installation package to the Lib directory in the PHP installation directory. The PHP version I used is php-5.6.10 and the copy method is as follows:
# cd PHP installation package directory # CP php.ini-development PHP installation directory/lib/php.ini
6. Add code at the end of the php.ini file:
[xhprof]extension=xhprof.soxhprof.output_dir= Log storage Directory
Because I am using a normal user installation, the log storage directory needs to be set to a normal user writable directory.
7. Copy the xhprof_html and Xhprof_lib folders in the Xhprof installation package to the default file directory of the Apache server, where I am the Htdocs directory and then reboot the Apache server, thus completing the xhprof configuration. Next is the test.
8. Test using the test file that comes with Xhprof. This file is in: Xhprof Install package directory/examples/sample.php, copy the examples folder directly to the Apache server default file directory, I here is the Htdocs directory. Change the last echo code of the sample.php file to:
9. In the browser, enter: http://server IP-port number/examples/sample.php to execute the file. Results
10. Click Count to get the results of xhprof analysis. Part of the content
This completes the installation, configuration, and testing of the xhprof.
Install Xhprof under Redhat 4 using a non-root user