1 Star 2 Fork 1

inhere / alphp

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
install-xhprof.md 1.23 KB
一键复制 编辑 原始数据 按行查看 历史
inhere 提交于 2018-04-17 23:02 . up: docker-compose.yml readme. some modify

安装xhprof

from http://www.open-open.com/lib/view/open1453899928714.html

##下载编译安装的命令如下:

$ wget https://github.com/phacility/xhprof/archive/master.zip
$ unzip ./xhprof_master.zip
$ cd ./xhprof_master/extension
$ /usr/local/php/bin/phpize
$ ./configure --with-php-config=/usr/local/php/bin/php-config
$ make
$ make install

启用 xhprof 扩展, 检查安装 php -m

拷贝xhprof相关程序到指定目录:

$ mkdir -p /www/sites/xhprof
$ cp -r ./xhprof_master/xhprof_html /www/sites/xhprof
$ cp -r ./xhprof_master/xhprof_lib /www/sites/xhprof

修改nginx配置,以便通过url访问性能数据:

在nginx中增加如下代码:

server {
    listen  8999;
    root    /opt/sites/xhprof/;
    index  index.php index.html;
    location ~ .*\.php$ {
        add_header  Cache-Control "no-cache, no-store, max-age=0, must-revalidate";
        add_header  Pragma  no-cache;
        add_header Access-Control-Allow-Origin *;
        add_header      Via "1.0 xgs-150";
        fastcgi_pass   127.0.0.1:9000;
        fastcgi_index  index.php;
        include fastcgi.conf;
        fastcgi_connect_timeout 300;
        fastcgi_send_timeout 300;
        fastcgi_read_timeout 300;
    }
}
1
https://gitee.com/inhere/alphp.git
git@gitee.com:inhere/alphp.git
inhere
alphp
alphp
master

搜索帮助