时间戳转换工具

安装扩展

该 xhprof扩展版本是从 https://github.com/longxinH/xhprof 获取的(第三方的一个库,官方版本不支持php7)

下载并编译xhprof扩展
在web的html目录下操作:
git clone https://github.com/longxinH/xhprof

当git 拉取报错时:

正克隆到 'xhprof'...
fatal: unable to access 'https://github.com/longxinH/xhprof/': Encountered end of file https改成git即可


编译扩展

cd xhprof/extension/
phpize
./configure --with-php-config=/usr/local/php/bin/php-config
make
make install


修改php.ini配置

[xhprof]
extension=xhprof.so;
xhprof.output_dir=/tmp/xhprof

其中 xhprof.output_dir 是 xhprof 的输出目录,每次执行 xhprof 的 save_run 方法时都会生成一个 run_id.project_name.xhprof 文件。这个目录在哪里并不重要。注意此路径的权限要可读写!!否则文件无法生成成功,一般php的操作权限是www,有设置php可以操作文件夹的范围,xhprof保存目录可以设置项目文件夹内。

重启 php-fpm : service php-fpm restart 

php -m 即可看到xhprof扩展

xhprof扩展就安装成功了 !!!


联系我们 - 首页 - 关于我们
Copyright © 2017-2022 iteam. All Rights Reserved. Current version is 2.50.0.
粤ICP备17021424号
VV:33218 UV:106206 PV:340158