PHP性能追踪及分析工具xhprof的安装与使用
PHP性能追踪及分析工具xhprof的安装与使用
对于本地开发环境来说,进行性能分析xdebug是够用了,但如果是线上环境的话,xdebug消耗较大,配置也不够灵活,因此线上环境建议使用xhprof进行PHP性能追踪及分析。
我们今天就简单介绍一下xhprof的简单安装与使用
xhprof的安装
下载xhprof,我们这里选择的是通过git clone的方式,当然你也可以从 http://pecl.php.net/package/xhprof 这里下载。
cd /usr/local/src # 我自己汉化的版本 git clone https://github.com/maxincai/xhgui.git # 你可以clone原版 git clone https://github.com/phacility/xhprof.git
注意:
php5.4及以上版本不能在pecl中下载,不支持。需要在github上下载hhttps://github.com/phacility/xhprof.git。
另外xhprof已经很久没有更新过了,截至目前还不支持php7,php7可以试使用https://github.com/tideways/php-profiler-extension。
安装xhporof
cd xhprof/extension /usr/local/php5.6/bin/phpize
./configure --with-php-config=/usr/local/php5.6/bin/
网友评论

