This article mainly introduces Xhprof, a PHP performance testing tool, which has a certain reference value. Now I share it with everyone. Friends in need can refer to it
Xhprof is a PHP performance testing tool. The extension can only be installed under Linux environment.
First installation steps
Download the source code package of xhprof from the official website http://pecl.php.net/package/xhprof
tar -zxvf xhprof-0.9.4.tgz
cd xhprof-0.9.4
cd extensions
./configure --with-php-config=/usr/local/data/php/bin/php-config //Note here is your own php path
make
sudo make install
Modify php.ini
extension=xhprof.so
xhprof.output_dir="/vagrant_data/xhprof"
#Restart php-fpm
ps aux | grep php-fpm
Find the master process
kill -USR2 process number
Check whether phpinfo is successful
OK , after seeing it, it means that the installation has been successful. Next, do a test to see the effect.
The decompressed compressed package contains two folders, xhprof_html and xhprof_lib, which are used to display test results:
Then visit Just sample.php under the examples folder: 127.0.0.1/examples/sample.php.
Then visit 127.0.0.1/xhprof_html/index.php
Detailed explanation of the installation and use of the PHP performance testing tool xhprof
The above is the detailed content of PHP performance testing tool Xhprof. For more information, please follow other related articles on the PHP Chinese website!