php---> xhprof installation and use

xhprof

Introduction
  • xhprof is a website performance tool
install(lnmp)
php --ri xhprof #检查php是否有这个扩展
cd xhprof-0.9.4/xhprof-0.9.4/extension/
phpize
./configure
make
sudo make install
//在php.ini中加入此扩展:
extension = xhprof.so
//设置缓存文件存放位置
xhprof.output_dir=/www/logs/xhprof
//最后要重启php-fpm
  • If you want to display the view, also install the graphviz tool, the installation method is not long-winded

    use
  • Two key points to use:
    • The first is whether the runid is correctly generated
    • Visit http://localhost/ddd/xhprof/xhprof_html/index.php
      to see the log generated by each request in the form of a list, click on it to see the relevant performance analysis data
problems encountered
  • Because some html files and php files in xhprof are to be called by the project, and xhprof is also quite a small framework, so to run it, you need to put it in the www root directory, or you can customize the configuration
  • When setting the storage location of the cache file, pay attention to the permission of the file, otherwise it will cause the xhprof to not be stored and an error will be reported

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325087511&siteId=291194637