微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

ngx_php7_tracker 环境安装 追踪 PHP7 运行的 Nginx 模块

程序名称:ngx_php7_tracker 环境安装

授权协议: BSD

操作系统: Linux

开发语言: C/C++

ngx_php7_tracker 环境安装 介绍

ngx_PHP7_tracker

ngx_PHP7 的分支,追踪PHP7脚本运行的opcode、函数调用Nginx模块。

环境

- PHP 7.0.*
- Nginx-1.6.3

安装

$ wget http://PHP.net/distributions/PHP-7.0.14.tar.gz
$ tar xf PHP-7.0.14.tar.gz
$ cd PHP-7.0.14

$ ./configure --prefix=/path/to/PHP \
              --enable-embed

$ make && make install


$ git clone https://github.com/rryqszq4/ngx_PHP7_tracker.git

$ wget 'http://Nginx.org/download/Nginx-1.6.3.tar.gz'
$ tar -zxvf Nginx-1.6.3.tar.gz
$ cd Nginx-1.6.3

$ export PHP_BIN=/path/to/PHP/bin
$ export PHP_INC=/path/to/PHP/include/PHP
$ export PHP_LIB=/path/to/PHP/lib

$ ./configure --user=www --group=www \
              --prefix=/path/to/Nginx \
              --with-ld-opt="-Wl,-rpath,$PHP_LIB" \
              --add-module=/path/to/ngx_PHP7_tracker

$ make
$ make install

概要


user www www;
worker_processes  4;

events {
    worker_connections  1024;
}

http {
    include       mime.types;
    default_type  application/octet-stream;

    keepalive_timeout  65;
    
    client_max_body_size 10m;   
    client_body_buffer_size 4096k;

    PHP_ini_path /usr/local/PHP/etc/PHP.ini;

    server {
        listen       80;
        server_name  localhost;
    
        location /content_by_PHP {
            content_by_PHP '
                header("Content-Type: text/html;charset=UTF-8");
                require_once("/home/www/yaf/cg/output/Sample/index.PHP");
            ';
        }

        location /opcode_by_PHP {
            opcode_by_PHP '
                header("Content-Type: text/html;charset=UTF-8");
                require_once("/home/www/yaf/cg/output/Sample/index.PHP");
            ';
        }

        location /stack_by_PHP {
            stack_by_PHP '
                header("Content-Type: text/html;charset=UTF-8");
                require_once("/home/www/yaf/cg/output/Sample/index.PHP");
            ';
        }
    }
}

指令

opcode_by_PHP

stack_by_PHP

ngx_php7_tracker 环境安装 官网

https://github.com/rryqszq4/ngx_php7_tracker

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。

相关推荐