作者:AngryFox 分类: Uncategorized October 30th, 2012 暂无评论

环境:CentOS 5.5 x32

安装:
cd /root/tools
wget http://pecl.php.net/get/xhprof-0.9.2.tgz
tar zxf xhprof-0.9.2.tgz
cd xhprof-0.9.2
cd extension
/usr/local/php/bin/phpize
./configure –with-php-config=/usr/local/php/bin/php-config
make && make install
cd ../../

#2.安装Graphviz

wget http://www.graphviz.org/pub/graphviz/stable/SOURCES/graphviz-2.28.0.tar.gz
tar zxf graphviz-2.28.0.tar.gz
cd graphviz-2.28.0
./configure –prefix=/usr/local/graphviz
make && make install
cd ..
ln -s /usr/local/graphviz/bin/* /bin/

#3.安装libpng
wget http://cdnetworks-kr-2.dl.sourceforge.net/project/libpng/libpng15/1.5.2/libpng-1.5.2.tar.gz
tar zxf libpng-1.5.2.tar.gz
cd libpng-1.5.2
./configure –prefix=/usr/local/libpng
make && make install
cd ..

编辑php.ini
vi /usr/local/php/etc/php.ini

extension = “xhprof.so”

[xhprof]
xhprof.output_dir=”/usr/local/xhprof/log”

重启php即可