xhprof 安装使用及相关问题

一、安装查看是否是否安装xhprof扩展

php --ri xhprof #检查php是否有这个扩展

二、xhprof扩展的安装

$ wget http://pecl.php.net/get/xhprof-0.9.4.tgz  
$ tar -zxvf xhprof-0.9.4.tgz 
$ cd xhprof-0.9.4
$ cd extension/
$ phpize  -----------》phpize: command not found 解决 :yum install php-devel(注意:phpize 生成configure文件的)
$./configure --with-php-config=/usr/local/php/bin/php-config
$ make
$ make install

三、配置 php.ini


  1. [xhprof]
  2. extension=xhprof.so;
  3. ; directory used by default implementation of the iXHProfRuns
  4. ; interface (namely, the XHProfRuns_Default class) for storing
  5. ; XHProf runs.
  6. ;
  7. ;xhprof.output_dir=<directory_for_storing_xhprof_runs>
  8. xhprof.output_dir=/tmp/xhprof

四、重启php-fpm或httpd服务

五、测试以及访问方式


把安装目录的文件夹拷贝到测试目录下

cp -Rf ./xhprof-0.9.4 /var/www/htm/

mv xhprof-0.9.4 xhprof #重命名文件


例子:


第一种方式:复制上面到运行的结果(http路径),再次放入浏览器,填好前面对应的域名:

http://192.168.0.109/xhprof/xhprof_html/index.php?run=5af543f2115f8&source=xhprof_foo



如果查看图形化展示 : yum install graphviz




  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值