ubuntu 添加xhprof

sudo wget http://pecl.php.net/get/xhprof
chmod 777 xhprof
tar zxf xhprof
cd xhprof-0.9.2

sudo su
#安装php5-dev
apt-get install php5-dev
如果上面的有错误则用这个:
apt-get update
apt-get install php5-dev --fix-missing

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=/var/log/xhprof/

创建目录
sudo mkdir /var/log/xhprof
更改目录权限
sudo chown www-data:www-data /var/log/xhprof


安装graphviz ,以图形形式查看结果
apt-get install graphviz

重起apache2,查看phpinfo,出现xhprof的配置

你可能感兴趣的:(ubuntu 添加xhprof)