统计php脚本执行时间的php扩展

发布时间:2019-08-07 发布网站:脚本宝典
脚本宝典收集整理的这篇文章主要介绍了统计php脚本执行时间的php扩展脚本宝典觉得挺不错的,现在分享给大家,也给大家做个参考。

zqfHB

Php Page execution statistics extension
由于依赖hiredis的c的api调用redis,所以首先需要安装hiredis
wget https://github.com/redis/hire...
tar zxvf v0.13.3.tar.gz
cd hiredis-0.13.3
make
或者直接make install,建议手动按下面配置
mkdir -p /usr/local/include/hiredis /usr/local/lib
cp -a hiredis.h async.h read.h sds.h adapters /usr/local/include/hiredis
cp -a libhiredis.so /usr/local/lib/libhiredis.so.0.13
cd /usr/local/lib && ln -sf libhiredis.so.0.13 libhiredis.so
切换到cd hiredis-0.13.3目录下
cp -a libhiredis.a /usr/local/lib
mkdir -p /usr/local/lib/pkgconfig
cp -a hiredis.pc /usr/local/lib/pkgconfig
如果出现libhiredis.so.0.13: cannot oPEn shared object file: No such file or directory in Unknown on line 0
vi /etc/ld.so.conf
文件末尾添加 /usr/local/lib
然后执行ldconfig
下面安装本扩展
./phpize
./configure --wITh-php-config=/usr/local/php/bin/php-config
make
make install
add zqfHB.so to php.ini
extension=zqfHB.so
[zqfHB]
zqfHB.slow_maxtime=10000(单位微妙1s=1000000us,改参数是页面加载超过这个时间会统计)
zqfHB.type=1(1代表redis 2代表memcache,由于memcache性能处理有点低,暂时不开放)
zqfHB.auth=123456(如果redis没有密码,此项不必配置,如果有密码,必须配置此项)
zqfHB.host=192.168.102.163
zqfHB.port=6379
use:

需要把web里的所有文件复制到网站目录下,网站统计可以不在一起
直接执行http://localhost/web/

效果图

统计php脚本执行时间的php扩展


统计php脚本执行时间的php扩展

项目地址:https://github.com/qieangel20...

脚本宝典总结

以上是脚本宝典为你收集整理的统计php脚本执行时间的php扩展全部内容,希望文章能够帮你解决统计php脚本执行时间的php扩展所遇到的问题。

如果觉得脚本宝典网站内容还不错,欢迎将脚本宝典推荐好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。