Installation of PHP performance test tool--xhprof
Xhprof is an open source PHP performance testing tool for Facebook, and is widely used in the Facebook development process.
?
First, the installation of Xhprof
?
1. Download address:http://pecl.php.net/get/xhprof-0.9.2.tgz
?
?? Under Linux, execute the command:wget?http://pecl.php.net/get/xhprof-0.9.2.tgz
?
2. Since xpprof comes with a Web analytics page, it can be placed in the Web server directory
?
?? MV xhprof-0.9.2.tgz/www/webroot/
?
?? cd/www/webroot/
?
3. Unzip: Tar xzf xhprof-0.9.2.tgz, get the extracted file xhprof-0.9.2
?
?? CD xhprof-0.9.2
?? Into the file, you can see the XHPROF directory structure? :
?
?
?????? CHANGELOG
?????? CREDITS
?????? Examples
?????? Extension
?????? LICENSE
?????? Readme
?????? Xhprof_html
?????? Xhprof_lib
?
? For a software is not very understanding, the best way is to open the Readme file, to see exactly.
?
? VI README
?
? Cha! For installation and usage notes refer to:
??????? Xhprof_html/docs/index.html
?
?? Then we have to open xhprof_html/docs/index.html this file (I just put the entire xhprof in the Web server directory, so it can be opened directly under the browser). There is a detailed introduction to XHPROF under this document, the following highlights the installation steps:
The Stepsbelow should work for Linux/unix environments.
% CD
/extension/% phpize%./configure--with-php-config=
% make% make install% make test
?
4. Follow the instructions above to install
?
?? A.??? CD extension/?????????????????? Go to Catalog
?? B.??? ~/web/php/bin/phpize???? Phpize is used to extend the PHP extension module, under the PHP installation directory of the bin
?? C.??? ./configure? --enable-xhprof? --with-php-config=~/web/php/bin/php-config
?? D.??? Make&make Install
?
? The above steps are completed and a. So file is generated
?
?
5. Configure PHP.ini
?
? Configure the Xhprof extension in php.ini, open the php.ini, and add it at the end of the file:
?
[xhprof]extension=xhprof.soxhprof.output_dir=
//can define its own output file
directory
Note: The directory that the Xhprofy stores is consistent with the directory Extension_dir in PHP.ini.
?
6. Restart PHP
??? ~/WEB/PHP/SBIN/PHP-FPM Reload
?? You can see the xhprof extension installed successfully in the Phpinfo information.
?
?
?
Specific to the use of xhprof, you can refer to the XHPROF installation directory under the/xhprof_html/docs/index.html, there are detailed instructions for use
?