1. 安装XHProf
wget http://pecl.php.net/get/xhprof-0.9.2.tgz
tar zxf xhprof-0.9.2.tgz
cd xhprof-0.9.2
sudo su
#安装php5-dev
apt-get install php5-dev
cd extension/
phpize
#下一步非常重要:
./configure –with-php-config=/usr/bin/php-config
make&&make install
make test
然后找到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=/opt/xhprof/
创建/opt/xhprof文件,更改文件权限
安装graphviz ,以图形形式查看结果
apt-get install graphviz
重起apache2,查看phpinfo,出现xhprof的配置