您的位置:首页 > 编程语言 > PHP开发

php 性能分析工具xhprof使用手册

2011-07-14 15:34 561 查看
xhprof 是fb搞的一个用来分析php程序性能的工具,使用轻巧方便。官方地址:http://mirror.facebook.net/facebook/xhprof/doc.html#installation

1,安装使用:

wget http://pecl.php.net/get/xhprof-0.9.2.tgz
tar zxf xhprof-0.9.2.tgz

cd xhprof-0.9.2

cp -r xhprof_html xhprof_lib <directory_for_htdocs>

cd extension

phpize

./configure –with-php-config=/usr/local/php/bin/php-confg

make

make install

编辑php.ini:

[xhprof]

extension=xhprof.so

;

; directory used by default implementation of the iXHProfRuns

; interface (namely, the XHProfRuns_Default class) for storing

; XHProf runs.

;

xhprof.output_dir=<directory_for_storing_xhprof_runs>

注意设置xhprof.output_dir的目录权限

重启服务让修改生效,现在就可以使用XHProf了,不过为了显示效果更炫,最好继续安装Graphviz。

使用phpinfo()确认是否正确安装

安装 libiconv-1.13.1.tar.gz

安装 graphviz

wget http://www.graphviz.org/pub/graphviz/stable/SOURCES/graphviz-2.24.0.tar.gz
tar zxf graphviz-2.24.0.tar.gz

cd graphviz-2.24.0

./configure

make

make install
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: