├── .editorconfig ├── .gitattributes ├── .github ├── FUNDING.yml └── ISSUE_TEMPLATE │ ├── bug_report.md │ └── feature_request.md ├── .gitignore ├── .gitmodules ├── .travis.yml ├── Dockerfile ├── LICENSE ├── README-EN.md ├── README.md ├── _config.yml ├── conf ├── conf.d │ ├── .gitignore │ ├── certs │ │ └── localhost │ │ │ ├── gencert.sh │ │ │ ├── localhost.crt │ │ │ ├── localhost.csr │ │ │ ├── localhost.key │ │ │ └── localhost.origin.key │ ├── laravel.conf.sample │ ├── localhost.conf │ ├── localhost_https.conf │ └── xhgui.conf ├── mysql.cnf ├── nginx.conf ├── php-fpm.conf ├── php.ini └── redis.conf ├── docker-compose-sample.yml ├── docs ├── dnmp-plus.png ├── localhost.png ├── xhgui1.png ├── xhgui2.png └── xhgui3.png ├── env.sample ├── extensions ├── install.sh ├── php56.sh ├── php72.sh ├── redis-4.1.1.tgz ├── swoole-2.0.11.tgz ├── swoole-4.2.1.tgz ├── tideways-4.1.7.tar.gz ├── xdebug-2.5.5.tgz └── xdebug-2.6.1.tgz ├── log ├── nginx │ └── .gitignore ├── php │ └── .gitignore └── xhprof │ └── .gitignore ├── mongo └── .gitignore ├── mysql └── .gitignore ├── travis-build.sh └── www └── localhost └── index.php /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | end_of_line = lf 5 | insert_final_newline = true 6 | 7 | [*] 8 | charset = utf-8 9 | 10 | [{Dockerfile,docker-compose.yml}] 11 | indent_style = space 12 | indent_size = 2 13 | 14 | [*.md] 15 | trim_trailing_whitespace = false 16 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | * text eol=lf 2 | 3 | *.png binary 4 | *.jpg binary 5 | *.tgz binary -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | patreon: guanguans 4 | custom: https://github.com/guanguans/guanguans.github.io/blob/master/images/wechat.jpeg 5 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | title: '' 5 | labels: bug 6 | assignees: guanguans 7 | 8 | --- 9 | 10 | **Describe the bug** 11 | A clear and concise description of what the bug is. 12 | 13 | **To Reproduce** 14 | Steps to reproduce the behavior: 15 | 1. Go to '...' 16 | 2. Click on '....' 17 | 3. Scroll down to '....' 18 | 4. See error 19 | 20 | **Expected behavior** 21 | A clear and concise description of what you expected to happen. 22 | 23 | **Screenshots** 24 | If applicable, add screenshots to help explain your problem. 25 | 26 | **Additional context** 27 | Add any other context about the problem here. 28 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | title: '' 5 | labels: good idea 6 | assignees: guanguans 7 | 8 | --- 9 | 10 | **Is your feature request related to a problem? Please describe.** 11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 12 | 13 | **Describe the solution you'd like** 14 | A clear and concise description of what you want to happen. 15 | 16 | **Describe alternatives you've considered** 17 | A clear and concise description of any alternative solutions or features you've considered. 18 | 19 | **Additional context** 20 | Add any other context or screenshots about the feature request here. 21 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .idea 2 | .DS_Store 3 | .env 4 | docker-compose.yml 5 | www/* 6 | !www/localhost/ 7 | .php_cs.cache 8 | .history/ 9 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "www/xhgui-branch"] 2 | path = www/xhgui-branch 3 | url = https://github.com/laynefyc/xhgui-branch.git 4 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: bash 2 | sudo: required 3 | services: 4 | - docker 5 | 6 | # Installing a newer Docker version 7 | before_install: 8 | - curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - 9 | - sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" 10 | - sudo apt-get update 11 | - sudo apt-get -y install docker-ce 12 | - docker version 13 | 14 | script: ./travis-build.sh 15 | 16 | after_failure: 17 | - curl "https://api.day.app/${API_DAY_TOKEN}/dnmp-plus 构建失败 https://travis-ci.org/guanguans/dnmp-plus/builds" 18 | 19 | after_success: 20 | - curl "https://api.day.app/${API_DAY_TOKEN}/dnmp-plus 构建成功" 21 | 22 | notifications: 23 | email: false 24 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | ARG PHP_VERSION 2 | FROM php:${PHP_VERSION}-fpm-alpine 3 | 4 | ARG PHP_EXTENSIONS 5 | ARG MORE_EXTENSION_INSTALLER 6 | ARG ALPINE_REPOSITORIES 7 | 8 | COPY ./extensions /tmp/extensions 9 | WORKDIR /tmp/extensions 10 | 11 | ENV EXTENSIONS=",${PHP_EXTENSIONS}," 12 | ENV MC="-j$(nproc)" 13 | 14 | RUN export MC="-j$(nproc)" \ 15 | && chmod +x install.sh \ 16 | && chmod +x "${MORE_EXTENSION_INSTALLER}" \ 17 | && sh install.sh \ 18 | && sh "${MORE_EXTENSION_INSTALLER}" \ 19 | && rm -rf /tmp/extensions 20 | 21 | WORKDIR /var/www/html -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 琯琯 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README-EN.md: -------------------------------------------------------------------------------- 1 | # DNMP PLUS 2 | 3 | **dnmp** = `Docker` + `Nginx` + `MySQL` + `PHP` + `Redis` + `MongDB` 4 | 5 | **plus** = `xhgui` + `xhprof` + `tideways` 6 | 7 | **dnmp-plus** = `PHPer's one-click installation development environment` + `PHP non-intrusive monitoring platform(optimizing system performance, positioning artifacts of Bug)` 8 | 9 | --- 10 | 11 | [![Build Status](https://app.travis-ci.com/guanguans/dnmp-plus.svg?branch=master)](https://app.travis-ci.com/guanguans/dnmp-plus) 12 | 13 | [简体中文](README.md) | English 14 | 15 | **[dnmp-plus](https://github.com/guanguans/dnmp-plus)** is added on the basis of dnmp: 16 | 17 | * [PHP xhprof extension](https://github.com/phacility/xhprof) - PHP performance tracking and analysis tool developed by Facebook 18 | * [PHP tideways extension](https://github.com/tideways/php-xhprof-extension) - branch of xhprof with support for PHP7 19 | * PHP mongodb extension 20 | * MongoDB service 21 | * Mongo Express - MongoDB Service Management System 22 | * [Xhgui](https://github.com/perftools/xhgui) - xhprof GUI system for analyzing data data 23 | 24 | ![](docs/dnmp-plus.png) 25 | 26 | --- 27 | 28 | ## Directory Structure 29 | 30 | ``` bash 31 | ├── .github Github 配置目录 32 | ├── conf 配置文件目录 33 | │   ├── conf.d Nginx 用户站点配置目录 34 | │   ├── mysql.cnf MySQL 用户配置文件 35 | │   ├── nginx.conf Nginx 默认配置文件 36 | │   ├── php-fpm.conf PHP-FPM 配置文件 37 | │   ├── php.ini PHP 配置文件 38 | │   ├── redis.conf Redis 配置文件 39 | ├── docs 文档目录 40 | ├── extensions PHP 扩展源码包 41 | ├── log 日志目录 42 | ├── mongo MongoDB 数据目录 43 | ├── mysql MySQL 数据目录 44 | ├── www PHP 代码目录 45 | ├── Dockerfile PHP 镜像构建文件 46 | ├── docker-compose-sample.yml Docker 服务配置示例文件 47 | ├── env.smaple 环境配置示例文件 48 | └── travis-build.sh Travis CI 构建脚本 49 | ``` 50 | 51 | ## Environmental requirements 52 | 53 | * Docker 54 | * Docker-compose 55 | * Git 56 | 57 | ## Quick use 58 | 59 | ``` bash 60 | $ git clone https://github.com/guanguans/dnmp-plus.git --recursive 61 | $ cd dnmp-plus 62 | $ cp env.sample .env 63 | $ cp docker-compose-sample.yml docker-compose.yml 64 | # Service option:nginx、php72、php56、mysql、mongo、redis、phpmyadmin、phpredisadmin、mongo-express 65 | $ docker-compose up -d php72 nginx mysql mongo 66 | ``` 67 | 68 | OK, you now have a dnmp-plus development environment, the default web root directory `www/localhost/`, the browser accesses http://localhost 69 | 70 | ![](docs/localhost.png) 71 | 72 | ## Basic use 73 | 74 | ``` bash 75 | # Service option:nginx、php72、php56、mysql、mongo、redis、phpmyadmin、phpredisadmin、mongo-express 76 | 77 | # Create and start containers 78 | $ docker-compose up 服务1 服务2 ... 79 | # Create and start all containers 80 | $ docker-compose up 81 | # Create and start deamon containers 82 | $ docker-compose up -d 服务1 服务2 ... 83 | 84 | # Start services 85 | $ docker-compose start 服务1 服务2 ... 86 | 87 | # Stop services 88 | $ docker-compose stop 服务1 服务2 ... 89 | 90 | # Restart services 91 | $ docker-compose restart 服务1 服务2 ... 92 | 93 | # Build or rebuild services 94 | $ docker-compose build 服务1 服务2 ... 95 | 96 | # Execute a command in a running container 97 | $ docker-compose exec 服务 bash 98 | 99 | # Remove stopped containers 100 | $ docker-compose rm 服务1 服务2 ... 101 | 102 | # Stop and remove containers, networks, images, and volumes 103 | $ docker-compose down 服务1 服务2 ... 104 | ``` 105 | 106 | ## For xhgui use, you can refer to https://github.com/guanguans/guanguans.github.io/issues/9 107 | installation 108 | 109 | ### Installation 110 | 111 | ``` bash 112 | $ cd www/xhgui-branch 113 | $ composer install 114 | ``` 115 | 116 | ### Modify the xhgui-branch configuration file `www/xhgui-branch/config/config.default.php` 117 | 118 | ``` php 119 | true, // changed to true for easy debugging 123 | 'mode' => 'development', 124 | ... 125 | 'extension' => 'tideways', // changed to support tideways for PHP7 126 | ... 127 | 'save.handler' => 'mongodb', 128 | 'db.host' => 'mongodb://mongo:27017', // 127.0.0.1 changed to mongo 129 | ... 130 | ); 131 | ``` 132 | 133 | ### Added in the hosts file 134 | 135 | ``` bash 136 | 127.0.0.1 xhgui.test 137 | ``` 138 | 139 | ### Browser access http://xhgui.test 140 | 141 | ![](docs/xhgui1.png) 142 | 143 | ### Modify in the nginx configuration file to analyze the project, with the default localhost configuration `conf/conf.d/localhost.conf` as an example 144 | 145 | ``` conf 146 | ... 147 | location ~ \.php$ { 148 | fastcgi_pass php72:9000; 149 | fastcgi_index index.php; 150 | include fastcgi_params; 151 | fastcgi_param PATH_INFO $fastcgi_path_info; 152 | fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; 153 | # 在执行主程序之前运行我们指定的PHP脚本 154 | fastcgi_param PHP_VALUE "auto_prepend_file=/var/www/html/xhgui-branch/external/header.php"; 155 | } 156 | ... 157 | ``` 158 | 159 | ### Restart nginx 160 | 161 | ``` bash 162 | $ docker-compose restart nginx 163 | ``` 164 | 165 | ### The browser visits http://localhost](http://localhost) and then visits [http://xhgui.test](http://xhgui.test). Now that you have the content, you can enjoy the performance tracking and analysis of the project 166 | 167 | ![](docs/xhgui2.png) 168 | 169 | ![](docs/xhgui3.png) 170 | 171 | ## PHP and extensions 172 | 173 | ### Switch the PHP version used by Nginx 174 | 175 | By default, both PHP5.6 and PHP7.2 2 PHP versions of the container are created. Switching PHP only needs to modify the `fastcgi_pass` option of the corresponding site Nginx configuration. For example, the example [http://localhost](http://localhost) uses PHP7.2, Nginx configuration: 176 | 177 | ``` conf 178 | fastcgi_pass php72:9000; 179 | ``` 180 | 181 | To use PHP 5.6 instead, change it to: 182 | 183 | ``` conf 184 | fastcgi_pass php56:9000; 185 | ``` 186 | 187 | Restart Nginx to take effect 188 | 189 | ``` bash 190 | $ docker-compose restart nginx 191 | ``` 192 | 193 | ### Install PHP extensions 194 | 195 | Many of PHP's features are implemented through extensions, and installing extensions is a slightly time-consuming process, so in addition to the PHP built-in extensions, we only install a few extensions by default in the `env.sample` file. If you want to install more extensions, please Open your `.env` file and modify the PHP configuration as follows to add the required PHP extensions: 196 | 197 | ``` bash 198 | PHP72_EXTENSIONS=pdo_mysql,opcache,redis,xdebug,mongodb,tideways 199 | PHP56_EXTENSIONS=opcache,redis,xdebug,mongodb,xhprof 200 | ``` 201 | 202 | Then rebuild the PHP image 203 | 204 | ``` bash 205 | docker-compose build php72 206 | docker-compose up -d 207 | ``` 208 | 209 | ## Use Log 210 | 211 | The location where the Log file is generated depends on the value of each log configuration under conf. 212 | 213 | ### Nginx Log 214 | 215 | The Nginx log is the one we use the most, so we put it under the root directory `log`. The `log` directory maps the /var/log/nginx directory of the Nginx container, so in the Nginx configuration file, you need to output the location of the log. We need to configure it to the `/var/log/nginx` directory, such as: 216 | 217 | ``` conf 218 | error_log /var/log/nginx/nginx.localhost.error.log warn; 219 | ``` 220 | 221 | ### MySQL log 222 | 223 | Because MySQL in the MySQL container uses the `mysql` user to start, it cannot add log files by itself under `/var/log`. So, we put the MySQL log in the same directory as data, the `mysql` directory of the project, corresponding to the `/var/lib/mysql/` directory in the container. 224 | 225 | Configuration of the log file in mysql.conf: 226 | 227 | ``` conf 228 | slow-query-log-file = /var/lib/mysql/mysql.slow.log 229 | log-error = /var/lib/mysql/mysql.error.log 230 | ``` 231 | 232 | ## Database management 233 | 234 | * Default phpMyAdmin address: http://localhost:8080 235 | * Default phpRedisAdmin address: http://localhost:8081 236 | * Default Mongo Express address: http://localhost:8082 237 | 238 | ## Reference link 239 | 240 | * [https://github.com/yeszao/dnmp](https://github.com/yeszao/dnmp),yeszao 241 | 242 | ## License 243 | 244 | [MIT](LICENSE) 245 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # DNMP PLUS 2 | 3 | **dnmp** = `Docker` + `Nginx` + `MySQL` + `PHP` + `Redis` + `MongDB` 4 | 5 | **plus** = `xhgui` + `xhprof` + `tideways` 6 | 7 | **dnmp-plus** = `PHPer 的一键安装开发环境` + `PHP 非侵入式监控平台(优化系统性能、定位 Bug 的神器)` 8 | 9 | --- 10 | 11 | [![Build Status](https://app.travis-ci.com/guanguans/dnmp-plus.svg?branch=master)](https://app.travis-ci.com/guanguans/dnmp-plus) 12 | 13 | 简体中文 | [English](README-EN.md) 14 | 15 | **[dnmp-plus](https://github.com/guanguans/dnmp-plus)** 在 [yeszao](https://github.com/yeszao) 的 [DNMP](https://github.com/yeszao/dnmp) 基础上新增: 16 | 17 | * [PHP xhprof 扩展](https://github.com/phacility/xhprof) - Facebook 开发的 PHP 性能追踪及分析工具 18 | * [PHP tideways 扩展](https://github.com/tideways/php-xhprof-extension) - xhprof 的分支,支持 PHP7 19 | * PHP mongodb 扩展 20 | * MongoDB 服务 21 | * Mongo Express - MongoDB 服务管理系统 22 | * [xhgui](https://github.com/laynefyc/xhgui-branch) - xhprof 分析数据数据的 GUI 系统 23 | 24 | ![](docs/dnmp-plus.png) 25 | 26 | --- 27 | 28 | ## 目录结构 29 | 30 | ``` bash 31 | ├── .github Github 配置目录 32 | ├── conf 配置文件目录 33 | │   ├── conf.d Nginx 用户站点配置目录 34 | │   ├── mysql.cnf MySQL 用户配置文件 35 | │   ├── nginx.conf Nginx 默认配置文件 36 | │   ├── php-fpm.conf PHP-FPM 配置文件 37 | │   ├── php.ini PHP 配置文件 38 | │   ├── redis.conf Redis 配置文件 39 | ├── docs 文档目录 40 | ├── extensions PHP 扩展源码包 41 | ├── log 日志目录 42 | ├── mongo MongoDB 数据目录 43 | ├── mysql MySQL 数据目录 44 | ├── www PHP 代码目录 45 | ├── Dockerfile PHP 镜像构建文件 46 | ├── docker-compose-sample.yml Docker 服务配置示例文件 47 | ├── env.smaple 环境配置示例文件 48 | └── travis-build.sh Travis CI 构建脚本 49 | ``` 50 | 51 | ## 环境要求 52 | 53 | * Docker 54 | * Docker-compose 55 | * Git 56 | 57 | ## 快速使用 58 | 59 | ``` bash 60 | $ git clone https://github.com/guanguans/dnmp-plus.git --recursive 61 | $ cd dnmp-plus 62 | $ cp env.sample .env 63 | $ cp docker-compose-sample.yml docker-compose.yml 64 | # 服务选项:nginx、php72、php56、mysql、mongo、redis、phpmyadmin、phpredisadmin、mongo-express 65 | $ docker-compose up -d php72 nginx mysql mongo 66 | ``` 67 | 68 | OK,你现在已经拥有了一个 dnmp-plus 开发环境,默认 web 根目录 `www/localhost/`,浏览器访问 [http://localhost](http://localhost) 69 | 70 | ![](docs/localhost.png) 71 | 72 | ## 基本使用 73 | 74 | ``` bash 75 | # 服务选项:nginx、php72、php56、mysql、mongo、redis、phpmyadmin、phpredisadmin、mongo-express 76 | 77 | # 创建并且启动容器 78 | $ docker-compose up 服务1 服务2 ... 79 | # 创建并且启动所有容器 80 | $ docker-compose up 81 | 82 | # 创建并且已后台运行的方式启动容器 83 | $ docker-compose up -d 服务1 服务2 ... 84 | 85 | # 启动服务 86 | $ docker-compose start 服务1 服务2 ... 87 | 88 | # 停止服务 89 | $ docker-compose stop 服务1 服务2 ... 90 | 91 | # 重启服务 92 | $ docker-compose restart 服务1 服务2 ... 93 | 94 | # 构建或者重新构建服务 95 | $ docker-compose build 服务1 服务2 ... 96 | 97 | # 进入命令行容器 98 | $ docker-compose exec 服务 bash 99 | 100 | # 删除并且停止容器 101 | $ docker-compose rm 服务1 服务2 ... 102 | 103 | # 停止并删除容器,网络,图像和挂载卷 104 | $ docker-compose down 服务1 服务2 ... 105 | ``` 106 | 107 | ## xhgui 使用,可以参考 https://github.com/guanguans/guanguans.github.io/issues/9 108 | 109 | ### 安装 110 | 111 | ``` bash 112 | $ cd www/xhgui-branch 113 | # 注意如果宿主机 php 没有安 mogodb 扩展会报错 114 | $ composer install 115 | ``` 116 | 117 | ### 修改 xhgui-branch 配置文件 `www/xhgui-branch/config/config.default.php` 118 | 119 | ``` php 120 | true, // 改为true,便于调试 124 | 'mode' => 'development', 125 | ... 126 | 'extension' => 'tideways', // 改为支持 PHP7 的 tideways 127 | ... 128 | 'save.handler' => 'mongodb', 129 | 'db.host' => 'mongodb://mongo:27017', // 127.0.0.1 改为 mongo 130 | ... 131 | ); 132 | ``` 133 | 134 | ### hosts 文件中增加 135 | 136 | ``` bash 137 | 127.0.0.1 xhgui.test 138 | ``` 139 | 140 | ### 浏览器访问 http://xhgui.test 141 | 142 | ![](docs/xhgui1.png) 143 | 144 | ### 在要分析项目 nginx 配置文件中修改,以默认的 localhost 配置 `conf/conf.d/localhost.conf` 为例 145 | 146 | ``` conf 147 | ... 148 | location ~ \.php$ { 149 | fastcgi_pass php72:9000; 150 | fastcgi_index index.php; 151 | include fastcgi_params; 152 | fastcgi_param PATH_INFO $fastcgi_path_info; 153 | fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; 154 | # 在执行主程序之前运行我们指定的PHP脚本 155 | fastcgi_param PHP_VALUE "auto_prepend_file=/var/www/html/xhgui-branch/external/header.php"; 156 | } 157 | ... 158 | ``` 159 | 160 | ### 重启 nginx 161 | 162 | ``` bash 163 | $ docker-compose restart nginx 164 | ``` 165 | 166 | ### 浏览器访问 [http://localhost](http://localhost),再访问 [http://xhgui.test](http://xhgui.test),此时已经有了内容,愉快的查看项目的性能追踪及分析吧 167 | 168 | ![](docs/xhgui2.png) 169 | 170 | ![](docs/xhgui3.png) 171 | 172 | ## PHP 和扩展 173 | 174 | ### 切换 Nginx 使用的 PHP 版本 175 | 176 | 默认同时创建 `PHP5.6` 和 `PHP7.2` 2 个 PHP 版本的容器,切换 PHP 仅需修改相应站点 Nginx 配置的 `fastcgi_pass` 选项,例如,示例的 [http://localhost](http://localhost) 用的是 PHP7.2,Nginx 配置: 177 | 178 | ``` conf 179 | fastcgi_pass php72:9000; 180 | ``` 181 | 182 | 要改用 PHP5.6,修改为: 183 | 184 | ``` conf 185 | fastcgi_pass php56:9000; 186 | ``` 187 | 188 | 重启 Nginx 生效 189 | 190 | ``` bash 191 | $ docker-compose restart nginx 192 | ``` 193 | 194 | ### 安装 PHP 扩展 195 | 196 | PHP 的很多功能都是通过扩展实现,而安装扩展是一个略费时间的过程, 197 | 所以,除 PHP 内置扩展外,在 `env.sample` 文件中我们仅默认安装少量扩展, 198 | 如果要安装更多扩展,请打开你的 `.env` 文件修改如下的 PHP 配置, 199 | 增加需要的 PHP 扩展: 200 | 201 | ``` bash 202 | PHP72_EXTENSIONS=pdo_mysql,opcache,redis,xdebug,mongodb,tideways 203 | PHP56_EXTENSIONS=opcache,redis,xdebug,mongodb,xhprof 204 | ``` 205 | 206 | 然后重新构建 PHP 镜像 207 | 208 | ``` bash 209 | docker-compose build php72 210 | docker-compose up -d 211 | ``` 212 | 213 | ## 使用 Log 214 | 215 | Log 文件生成的位置依赖于 conf 下各 log 配置的值。 216 | 217 | ### Nginx 日志 218 | 219 | Nginx 日志是我们用得最多的日志,所以我们单独放在根目录 `log` 下。`log` 会目录映射 Nginx 容器的 `/var/log/nginx` 目录,所以在 Nginx 配置文件中,需要输出 log 的位置,我们需要配置到 `/var/log/nginx` 目录,如: 220 | 221 | ``` conf 222 | error_log /var/log/nginx/nginx.localhost.error.log warn; 223 | ``` 224 | 225 | ### MySQL 日志 226 | 227 | 因为 MySQL 容器中的 MySQL 使用的是 `mysql` 用户启动,它无法自行在 `/var/log` 下的增加日志文件。所以,我们把 MySQL 的日志放在与 data 一样的目录,即项目的`mysql`目录下,对应容器中的 `/var/lib/mysql/` 目录。 228 | 229 | mysql.conf 中的日志文件的配置: 230 | 231 | ``` conf 232 | slow-query-log-file = /var/lib/mysql/mysql.slow.log 233 | log-error = /var/lib/mysql/mysql.error.log 234 | ``` 235 | 236 | ## 数据库管理 237 | 238 | * 默认 phpMyAdmin 地址:http://localhost:8080 239 | * 默认 phpRedisAdmin 地址:http://localhost:8081 240 | * 默认 Mongo Express 地址:http://localhost:8082 241 | 242 | ## 参考链接 243 | 244 | * [https://github.com/yeszao/dnmp](https://github.com/yeszao/dnmp),yeszao 245 | 246 | ## License 247 | 248 | [MIT](LICENSE) 249 | -------------------------------------------------------------------------------- /_config.yml: -------------------------------------------------------------------------------- 1 | theme: jekyll-theme-cayman -------------------------------------------------------------------------------- /conf/conf.d/.gitignore: -------------------------------------------------------------------------------- 1 | !.gitignore 2 | !certs/localhost/ 3 | !localhost_php72.conf 4 | !localhost_https_php56.conf 5 | !laravel.conf.sample 6 | laravel.conf 7 | !xhgui.conf 8 | -------------------------------------------------------------------------------- /conf/conf.d/certs/localhost/gencert.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # create self-signed server certificate: 4 | 5 | read -p "Enter your domain [www.example.com]: " DOMAIN 6 | 7 | echo "Create server key..." 8 | 9 | openssl genrsa -des3 -out $DOMAIN.key 1024 10 | 11 | echo "Create server certificate signing request..." 12 | 13 | SUBJECT="/C=US/ST=Mars/L=iTranswarp/O=iTranswarp/OU=iTranswarp/CN=$DOMAIN" 14 | 15 | openssl req -new -subj $SUBJECT -key $DOMAIN.key -out $DOMAIN.csr 16 | 17 | echo "Remove password..." 18 | 19 | mv $DOMAIN.key $DOMAIN.origin.key 20 | openssl rsa -in $DOMAIN.origin.key -out $DOMAIN.key 21 | 22 | echo "Sign SSL certificate..." 23 | 24 | openssl x509 -req -days 3650 -in $DOMAIN.csr -signkey $DOMAIN.key -out $DOMAIN.crt 25 | 26 | echo "Done!" 27 | -------------------------------------------------------------------------------- /conf/conf.d/certs/localhost/localhost.crt: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIICVTCCAb4CCQDAjEyILRN30zANBgkqhkiG9w0BAQsFADBvMQswCQYDVQQGEwJV 3 | UzENMAsGA1UECAwETWFyczETMBEGA1UEBwwKaVRyYW5zd2FycDETMBEGA1UECgwK 4 | aVRyYW5zd2FycDETMBEGA1UECwwKaVRyYW5zd2FycDESMBAGA1UEAwwJbG9jYWxo 5 | b3N0MB4XDTE4MDkyNTAyMzAyNVoXDTI4MDkyMjAyMzAyNVowbzELMAkGA1UEBhMC 6 | VVMxDTALBgNVBAgMBE1hcnMxEzARBgNVBAcMCmlUcmFuc3dhcnAxEzARBgNVBAoM 7 | CmlUcmFuc3dhcnAxEzARBgNVBAsMCmlUcmFuc3dhcnAxEjAQBgNVBAMMCWxvY2Fs 8 | aG9zdDCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAvF1hXtpa26dj8qKq4rQ8 9 | DYHC36UcghZp7JF8Q9M1ga4+R+M37Tt7rbkVSCbPfBYN0lGJ12CqQUye8wfJ/skr 10 | ol7KJcyfj5Z/z3IZSLegCOkJfxF5vNKzArbb+R2+ek2WdKuTGfOdbj07y1Q52HsS 11 | iOcrl7kUzmkYvxMEA2bqkPsCAwEAATANBgkqhkiG9w0BAQsFAAOBgQAeuljNAc0b 12 | wNQCRRzJmfmW2I9kKGQVdHeJwzNE5D3jXlUbUXxBVpw5db548v6TSszicQV1nNav 13 | HiRQsQIbciSdRL7JFSFBbXURVD9LYu7SjtVb5sviZht1t47OpdT/GDYDkx40I3SK 14 | qtCcfeZ0GVupkCCZZM4C26hMZz+LVUaCmw== 15 | -----END CERTIFICATE----- 16 | -------------------------------------------------------------------------------- /conf/conf.d/certs/localhost/localhost.csr: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE REQUEST----- 2 | MIIBrzCCARgCAQAwbzELMAkGA1UEBhMCVVMxDTALBgNVBAgMBE1hcnMxEzARBgNV 3 | BAcMCmlUcmFuc3dhcnAxEzARBgNVBAoMCmlUcmFuc3dhcnAxEzARBgNVBAsMCmlU 4 | cmFuc3dhcnAxEjAQBgNVBAMMCWxvY2FsaG9zdDCBnzANBgkqhkiG9w0BAQEFAAOB 5 | jQAwgYkCgYEAvF1hXtpa26dj8qKq4rQ8DYHC36UcghZp7JF8Q9M1ga4+R+M37Tt7 6 | rbkVSCbPfBYN0lGJ12CqQUye8wfJ/skrol7KJcyfj5Z/z3IZSLegCOkJfxF5vNKz 7 | Arbb+R2+ek2WdKuTGfOdbj07y1Q52HsSiOcrl7kUzmkYvxMEA2bqkPsCAwEAAaAA 8 | MA0GCSqGSIb3DQEBCwUAA4GBAIzL+tQaKTt5CY6+jAH2DpOFAHBnuZY1K3wVC2jv 9 | WAfhP91rP6IyLomaWDR7wEtRNKRjU44Bp1W3IidKDQ8kHAHMuOtWcFqf6ZguHD9s 10 | XWJh3Mr+uEZneLDzofuq4Dfg9DEOlN3SRL0s8XdmlI9e8uiywmsDI1LS4t1FILBI 11 | 8jsV 12 | -----END CERTIFICATE REQUEST----- 13 | -------------------------------------------------------------------------------- /conf/conf.d/certs/localhost/localhost.key: -------------------------------------------------------------------------------- 1 | -----BEGIN RSA PRIVATE KEY----- 2 | MIICXwIBAAKBgQC8XWFe2lrbp2PyoqritDwNgcLfpRyCFmnskXxD0zWBrj5H4zft 3 | O3utuRVIJs98Fg3SUYnXYKpBTJ7zB8n+ySuiXsolzJ+Pln/PchlIt6AI6Ql/EXm8 4 | 0rMCttv5Hb56TZZ0q5MZ851uPTvLVDnYexKI5yuXuRTOaRi/EwQDZuqQ+wIDAQAB 5 | AoGBALIcFiMLk1gZen+GYtFEnXgkF7FDPaagLP59PqQfhXue19M/vbU7RqIo3T/B 6 | OvXZIK6bXRxjkfl2yuGAnvalH/Shz/YdDtwtItgyYr4rteU5wJnPijPa2ebYXxNV 7 | wxq+9iyZs2vhhbbRGhFxREVE8iu2RnLY12CRxykGmxlWcNDZAkEA9CjA14Ym9gN/ 8 | XwZ8PNe+a/2fe8U0O86VnanOK1G5k5dsZkOW0O/5u622rMlGJw/S+YCBJ+8sOhFL 9 | QTxlVGPCtQJBAMV/79lWoGBGnpoB+o9lc1nBUCCxGmVzywSOrTjIquwegTvjMUUM 10 | yoqEDWC4fNdoFtaFZ12tPk42NYC4BdbU4u8CQQCqOAdJurNK7GFOZH0VBewx6Z3Y 11 | ckHaOEpCovGjbdSNOxJNsW1huQxIdfFXQPNxpCyX2akxqCMTUJ9AmdSjIvHJAkEA 12 | qKajjpimwxALB8CA0krzwcWOQxx5SgEjcHTV/xN8wb0a5qUPwcM2gipZsipYkSlV 13 | t0KcDiaOegNYlN6QPe/1CQJBALtRggJf4bMgjG9vsz/zhe9egCtuUifKfo5LLvI+ 14 | Xua1SY6XGL0Bf8TOGaNXc6Ye9H5abp7q/bZlZ+dGgJ3SJCY= 15 | -----END RSA PRIVATE KEY----- 16 | -------------------------------------------------------------------------------- /conf/conf.d/certs/localhost/localhost.origin.key: -------------------------------------------------------------------------------- 1 | -----BEGIN RSA PRIVATE KEY----- 2 | Proc-Type: 4,ENCRYPTED 3 | DEK-Info: DES-EDE3-CBC,5000546EC66294E5 4 | 5 | Vz1dfuev0GrvcWFkUA3YIeNXKRiDqoiyCwzDHGRAAMifNJOTrktPO3+qVTvRiNYs 6 | Uy9OnddqsXaVc+BxTSjezth3rhuzlhW3H4UB+WqVfiu+Kcf43KyPG4GUoz51UEHu 7 | c13o6FJC5z6FMNBQO++JtOei4Ws0nj2WnN9llVFnmhJiUJmYiJcljfTQZk4YwKDD 8 | d/xOys6Mxgp60mjcjyvWjnHv6nT4JPaTHKaq9i+BYLT9aChh/5GR06TOFfwlYqSA 9 | ipikOIG5rGWO60NmNUinyeUY6R6yAoPdV38XH7Umkqf81/yh1tu2HsjetU/TlTU8 10 | 6Rl2jBzEf3RmC1zoiqIgZ9kohiI+TLC2yBs8sCQz4ubuyjvYO3xBMi72z02k86p+ 11 | fz36lS+ziQlrv4NiulUBLGGUbrslOfk1bQi0UG/pOi1Fl/rB2Ki55ZCQNRgs43eK 12 | VSPp9yLGc6Onite6gxYGm75rXZWe6cAQslqUoXEEf9QCPaX9NBOlKXjecoZ/9Mmy 13 | m/30k53Z8McIR9UEjsRO3yZKJzfCCaLZThqtskeXSRL2g/VMR9pSW+BYLLPbQPrC 14 | akSuFcdmWCcm3ONcD1VOPHLKPLD+QZuHzt3LMOec+aa4bT3CG1W6IQCebrTPKvAH 15 | 5Mh2OeD3WlXVAWDkzyNxZt9q0uwiTz8aWAjP7IJhpMmaoRZWua2TUgZbqYb0fGJK 16 | fh4B1r9DsIJONd9e67oGNcAdLVdxrSbZFWeLZ+1KT93U+QyEReReAVbCf+QgewDa 17 | FAWUQHHuCnJjMwKRMRF2NiSN8bt0Uvu7G6b/4YioYIftgHNxngvXBQ== 18 | -----END RSA PRIVATE KEY----- 19 | -------------------------------------------------------------------------------- /conf/conf.d/laravel.conf.sample: -------------------------------------------------------------------------------- 1 | server { 2 | listen 80; 3 | server_name laravel.test; 4 | root /var/www/html/laravel/public; 5 | index index.php index.html index.htm; 6 | 7 | location / { 8 | try_files $uri $uri/ /index.php$is_args$args; 9 | } 10 | 11 | #charset koi8-r; 12 | 13 | access_log /dev/null; 14 | #access_log /var/log/nginx/nginx.laravel.access.log main; 15 | error_log /var/log/nginx/nginx.laravel.error.log warn; 16 | 17 | #error_page 404 /404.html; 18 | 19 | # redirect server error pages to the static page /50x.html 20 | # 21 | error_page 500 502 503 504 /50x.html; 22 | location = /50x.html { 23 | root /usr/share/nginx/html; 24 | } 25 | 26 | # proxy the PHP scripts to Apache listening on 127.0.0.1:80 27 | # 28 | #location ~ \.php$ { 29 | # proxy_pass http://127.0.0.1; 30 | #} 31 | 32 | # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 33 | # 34 | location ~ \.php$ { 35 | fastcgi_pass php72:9000; 36 | fastcgi_index index.php; 37 | include fastcgi_params; 38 | fastcgi_param PATH_INFO $fastcgi_path_info; 39 | fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; 40 | # Run our specified PHP script before executing the main program 41 | # fastcgi_param PHP_VALUE "auto_prepend_file=/var/www/html/xhgui-branch/external/header.php"; 42 | } 43 | 44 | # deny access to .htaccess files, if Apache's document root 45 | # concurs with nginx's one 46 | # 47 | #location ~ /\.ht { 48 | # deny all; 49 | #} 50 | } 51 | -------------------------------------------------------------------------------- /conf/conf.d/localhost.conf: -------------------------------------------------------------------------------- 1 | server { 2 | listen 80; 3 | server_name localhost; 4 | root /var/www/html/localhost; 5 | index index.php index.html index.htm; 6 | #charset koi8-r; 7 | 8 | access_log /dev/null; 9 | #access_log /var/log/nginx/nginx.localhost.access.log main; 10 | error_log /var/log/nginx/nginx.localhost.error.log warn; 11 | 12 | #error_page 404 /404.html; 13 | 14 | # redirect server error pages to the static page /50x.html 15 | # 16 | error_page 500 502 503 504 /50x.html; 17 | location = /50x.html { 18 | root /usr/share/nginx/html; 19 | } 20 | 21 | # proxy the PHP scripts to Apache listening on 127.0.0.1:80 22 | # 23 | #location ~ \.php$ { 24 | # proxy_pass http://127.0.0.1; 25 | #} 26 | 27 | # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 28 | # 29 | location ~ \.php$ { 30 | fastcgi_pass php72:9000; 31 | fastcgi_index index.php; 32 | include fastcgi_params; 33 | fastcgi_param PATH_INFO $fastcgi_path_info; 34 | fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; 35 | # Run our specified PHP script before executing the main program 36 | # fastcgi_param PHP_VALUE "auto_prepend_file=/var/www/html/xhgui-branch/external/header.php"; 37 | } 38 | 39 | # deny access to .htaccess files, if Apache's document root 40 | # concurs with nginx's one 41 | # 42 | #location ~ /\.ht { 43 | # deny all; 44 | #} 45 | } 46 | 47 | -------------------------------------------------------------------------------- /conf/conf.d/localhost_https.conf: -------------------------------------------------------------------------------- 1 | server { 2 | listen 443 ssl http2; 3 | server_name localhost; 4 | root /var/www/html/localhost; 5 | index index.php index.html index.htm; 6 | #charset koi8-r; 7 | 8 | access_log /dev/null; 9 | #access_log /var/log/nginx/nginx.localhost.https.access.log main; 10 | error_log /var/log/nginx/nginx.localhost.https.error.log warn; 11 | 12 | #error_page 404 /404.html; 13 | 14 | ssl_certificate /etc/nginx/conf.d/certs/localhost/localhost.crt; 15 | ssl_certificate_key /etc/nginx/conf.d/certs/localhost/localhost.key; 16 | ssl_prefer_server_ciphers on; 17 | ssl_protocols TLSv1 TLSv1.1 TLSv1.2; 18 | ssl_ciphers "EECDH+ECDSA+AESGCM EECDH+aRSA+AESGCM EECDH+ECDSA+SHA384 EECDH+ECDSA+SHA256 EECDH+aRSA+SHA384 EECDH+aRSA+SHA256 EECDH+aRSA+RC4 EECDH EDH+aRSA !aNULL !eNULL !LOW !3DES !MD5 !EXP !PSK !SRP !DSS !RC4"; 19 | add_header Strict-Transport-Security max-age=31536000; 20 | 21 | # redirect server error pages to the static page /50x.html 22 | # 23 | error_page 500 502 503 504 /50x.html; 24 | location = /50x.html { 25 | root /usr/share/nginx/html; 26 | } 27 | 28 | # proxy the PHP scripts to Apache listening on 127.0.0.1:80 29 | # 30 | #location ~ \.php$ { 31 | # proxy_pass http://127.0.0.1; 32 | #} 33 | 34 | # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 35 | # 36 | location ~ \.php$ { 37 | fastcgi_pass php72:9000; 38 | fastcgi_index index.php; 39 | include fastcgi_params; 40 | fastcgi_param PATH_INFO $fastcgi_path_info; 41 | fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; 42 | # Run our specified PHP script before executing the main program 43 | # fastcgi_param PHP_VALUE "auto_prepend_file=/var/www/html/xhgui-branch/external/header.php"; 44 | } 45 | 46 | # deny access to .htaccess files, if Apache's document root 47 | # concurs with nginx's one 48 | # 49 | #location ~ /\.ht { 50 | # deny all; 51 | #} 52 | } 53 | 54 | -------------------------------------------------------------------------------- /conf/conf.d/xhgui.conf: -------------------------------------------------------------------------------- 1 | server { 2 | listen 80; 3 | server_name xhgui.test; 4 | root /var/www/html/xhgui-branch/webroot; 5 | index index.php index.html index.htm; 6 | #charset koi8-r; 7 | 8 | location / { 9 | try_files $uri $uri/ /index.php?$args; 10 | } 11 | 12 | access_log /dev/null; 13 | #access_log /var/log/nginx/nginx.xhgui-branch.access.log main; 14 | error_log /var/log/nginx/nginx.xhgui-branch.error.log warn; 15 | 16 | #error_page 404 /404.html; 17 | 18 | # redirect server error pages to the static page /50x.html 19 | # 20 | error_page 500 502 503 504 /50x.html; 21 | location = /50x.html { 22 | root /usr/share/nginx/html; 23 | } 24 | 25 | # proxy the PHP scripts to Apache listening on 127.0.0.1:80 26 | # 27 | #location ~ \.php$ { 28 | # proxy_pass http://127.0.0.1; 29 | #} 30 | 31 | # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 32 | # 33 | location ~ \.php$ { 34 | fastcgi_pass php72:9000; 35 | fastcgi_index index.php; 36 | include fastcgi_params; 37 | fastcgi_param PATH_INFO $fastcgi_path_info; 38 | fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; 39 | } 40 | 41 | # deny access to .htaccess files, if Apache's document root 42 | # concurs with nginx's one 43 | # 44 | #location ~ /\.ht { 45 | # deny all; 46 | #} 47 | } 48 | -------------------------------------------------------------------------------- /conf/mysql.cnf: -------------------------------------------------------------------------------- 1 | [client] 2 | port = 3306 3 | default-character-set = utf8mb4 4 | 5 | 6 | [mysqld] 7 | user = mysql 8 | port = 3306 9 | sql_mode = "" 10 | 11 | default-storage-engine = InnoDB 12 | default-authentication-plugin = mysql_native_password 13 | character-set-server = utf8mb4 14 | collation-server = utf8mb4_unicode_ci 15 | init_connect = 'SET NAMES utf8mb4' 16 | 17 | disable-log-bin 18 | skip-character-set-client-handshake 19 | explicit_defaults_for_timestamp 20 | 21 | slow_query_log 22 | long_query_time = 3 23 | slow-query-log-file = /var/lib/mysql/mysql.slow.log 24 | log-error = /var/lib/mysql/mysql.error.log 25 | 26 | default-time-zone = '+8:00' 27 | 28 | [mysql] 29 | default-character-set = utf8mb4 30 | -------------------------------------------------------------------------------- /conf/nginx.conf: -------------------------------------------------------------------------------- 1 | 2 | user nginx; 3 | worker_processes 1; 4 | 5 | pid /var/run/nginx.pid; 6 | error_log /var/log/nginx/nginx.error.log warn; 7 | 8 | events { 9 | worker_connections 1024; 10 | } 11 | 12 | 13 | http { 14 | include /etc/nginx/mime.types; 15 | default_type application/octet-stream; 16 | 17 | log_format main '$remote_addr - $remote_user [$time_local] "$request" ' 18 | '$status $body_bytes_sent "$http_referer" ' 19 | '"$http_user_agent" "$http_x_forwarded_for"'; 20 | 21 | access_log /dev/null; 22 | #access_log /var/log/dnmp/nginx.access.log main; 23 | 24 | sendfile on; 25 | #tcp_nopush on; 26 | client_max_body_size 100M; 27 | 28 | keepalive_timeout 65; 29 | 30 | #gzip on; 31 | 32 | include /etc/nginx/conf.d/*.conf; 33 | } 34 | -------------------------------------------------------------------------------- /conf/php-fpm.conf: -------------------------------------------------------------------------------- 1 | ; Start a new pool named 'www'. 2 | ; the variable $pool can be used in any directive and will be replaced by the 3 | ; pool name ('www' here) 4 | [www] 5 | 6 | ; Per pool prefix 7 | ; It only applies on the following directives: 8 | ; - 'access.log' 9 | ; - 'slowlog' 10 | ; - 'listen' (unixsocket) 11 | ; - 'chroot' 12 | ; - 'chdir' 13 | ; - 'php_values' 14 | ; - 'php_admin_values' 15 | ; When not set, the global prefix (or NONE) applies instead. 16 | ; Note: This directive can also be relative to the global prefix. 17 | ; Default Value: none 18 | ;prefix = /path/to/pools/$pool 19 | 20 | ; Unix user/group of processes 21 | ; Note: The user is mandatory. If the group is not set, the default user's group 22 | ; will be used. 23 | user = www-data 24 | group = www-data 25 | 26 | ; The address on which to accept FastCGI requests. 27 | ; Valid syntaxes are: 28 | ; 'ip.add.re.ss:port' - to listen on a TCP socket to a specific IPv4 address on 29 | ; a specific port; 30 | ; '[ip:6:addr:ess]:port' - to listen on a TCP socket to a specific IPv6 address on 31 | ; a specific port; 32 | ; 'port' - to listen on a TCP socket to all addresses 33 | ; (IPv6 and IPv4-mapped) on a specific port; 34 | ; '/path/to/unix/socket' - to listen on a unix socket. 35 | ; Note: This value is mandatory. 36 | listen = 127.0.0.1:9000 37 | 38 | ; Set listen(2) backlog. 39 | ; Default Value: 511 (-1 on FreeBSD and OpenBSD) 40 | ;listen.backlog = 511 41 | 42 | ; Set permissions for unix socket, if one is used. In Linux, read/write 43 | ; permissions must be set in order to allow connections from a web server. Many 44 | ; BSD-derived systems allow connections regardless of permissions. 45 | ; Default Values: user and group are set as the running user 46 | ; mode is set to 0660 47 | ;listen.owner = www-data 48 | ;listen.group = www-data 49 | ;listen.mode = 0660 50 | ; When POSIX Access Control Lists are supported you can set them using 51 | ; these options, value is a comma separated list of user/group names. 52 | ; When set, listen.owner and listen.group are ignored 53 | ;listen.acl_users = 54 | ;listen.acl_groups = 55 | 56 | ; List of addresses (IPv4/IPv6) of FastCGI clients which are allowed to connect. 57 | ; Equivalent to the FCGI_WEB_SERVER_ADDRS environment variable in the original 58 | ; PHP FCGI (5.2.2+). Makes sense only with a tcp listening socket. Each address 59 | ; must be separated by a comma. If this value is left blank, connections will be 60 | ; accepted from any ip address. 61 | ; Default Value: any 62 | ;listen.allowed_clients = 127.0.0.1 63 | 64 | ; Specify the nice(2) priority to apply to the pool processes (only if set) 65 | ; The value can vary from -19 (highest priority) to 20 (lower priority) 66 | ; Note: - It will only work if the FPM master process is launched as root 67 | ; - The pool processes will inherit the master process priority 68 | ; unless it specified otherwise 69 | ; Default Value: no set 70 | ; process.priority = -19 71 | 72 | ; Set the process dumpable flag (PR_SET_DUMPABLE prctl) even if the process user 73 | ; or group is differrent than the master process user. It allows to create process 74 | ; core dump and ptrace the process for the pool user. 75 | ; Default Value: no 76 | ; process.dumpable = yes 77 | 78 | ; Choose how the process manager will control the number of child processes. 79 | ; Possible Values: 80 | ; static - a fixed number (pm.max_children) of child processes; 81 | ; dynamic - the number of child processes are set dynamically based on the 82 | ; following directives. With this process management, there will be 83 | ; always at least 1 children. 84 | ; pm.max_children - the maximum number of children that can 85 | ; be alive at the same time. 86 | ; pm.start_servers - the number of children created on startup. 87 | ; pm.min_spare_servers - the minimum number of children in 'idle' 88 | ; state (waiting to process). If the number 89 | ; of 'idle' processes is less than this 90 | ; number then some children will be created. 91 | ; pm.max_spare_servers - the maximum number of children in 'idle' 92 | ; state (waiting to process). If the number 93 | ; of 'idle' processes is greater than this 94 | ; number then some children will be killed. 95 | ; ondemand - no children are created at startup. Children will be forked when 96 | ; new requests will connect. The following parameter are used: 97 | ; pm.max_children - the maximum number of children that 98 | ; can be alive at the same time. 99 | ; pm.process_idle_timeout - The number of seconds after which 100 | ; an idle process will be killed. 101 | ; Note: This value is mandatory. 102 | pm = dynamic 103 | 104 | ; The number of child processes to be created when pm is set to 'static' and the 105 | ; maximum number of child processes when pm is set to 'dynamic' or 'ondemand'. 106 | ; This value sets the limit on the number of simultaneous requests that will be 107 | ; served. Equivalent to the ApacheMaxClients directive with mpm_prefork. 108 | ; Equivalent to the PHP_FCGI_CHILDREN environment variable in the original PHP 109 | ; CGI. The below defaults are based on a server without much resources. Don't 110 | ; forget to tweak pm.* to fit your needs. 111 | ; Note: Used when pm is set to 'static', 'dynamic' or 'ondemand' 112 | ; Note: This value is mandatory. 113 | pm.max_children = 10 114 | 115 | ; The number of child processes created on startup. 116 | ; Note: Used only when pm is set to 'dynamic' 117 | ; Default Value: min_spare_servers + (max_spare_servers - min_spare_servers) / 2 118 | pm.start_servers = 2 119 | 120 | ; The desired minimum number of idle server processes. 121 | ; Note: Used only when pm is set to 'dynamic' 122 | ; Note: Mandatory when pm is set to 'dynamic' 123 | pm.min_spare_servers = 1 124 | 125 | ; The desired maximum number of idle server processes. 126 | ; Note: Used only when pm is set to 'dynamic' 127 | ; Note: Mandatory when pm is set to 'dynamic' 128 | pm.max_spare_servers = 3 129 | 130 | ; The number of seconds after which an idle process will be killed. 131 | ; Note: Used only when pm is set to 'ondemand' 132 | ; Default Value: 10s 133 | ;pm.process_idle_timeout = 10s; 134 | 135 | ; The number of requests each child process should execute before respawning. 136 | ; This can be useful to work around memory leaks in 3rd party libraries. For 137 | ; endless request processing specify '0'. Equivalent to PHP_FCGI_MAX_REQUESTS. 138 | ; Default Value: 0 139 | ;pm.max_requests = 500 140 | 141 | ; The URI to view the FPM status page. If this value is not set, no URI will be 142 | ; recognized as a status page. It shows the following informations: 143 | ; pool - the name of the pool; 144 | ; process manager - static, dynamic or ondemand; 145 | ; start time - the date and time FPM has started; 146 | ; start since - number of seconds since FPM has started; 147 | ; accepted conn - the number of request accepted by the pool; 148 | ; listen queue - the number of request in the queue of pending 149 | ; connections (see backlog in listen(2)); 150 | ; max listen queue - the maximum number of requests in the queue 151 | ; of pending connections since FPM has started; 152 | ; listen queue len - the size of the socket queue of pending connections; 153 | ; idle processes - the number of idle processes; 154 | ; active processes - the number of active processes; 155 | ; total processes - the number of idle + active processes; 156 | ; max active processes - the maximum number of active processes since FPM 157 | ; has started; 158 | ; max children reached - number of times, the process limit has been reached, 159 | ; when pm tries to start more children (works only for 160 | ; pm 'dynamic' and 'ondemand'); 161 | ; Value are updated in real time. 162 | ; Example output: 163 | ; pool: www 164 | ; process manager: static 165 | ; start time: 01/Jul/2011:17:53:49 +0200 166 | ; start since: 62636 167 | ; accepted conn: 190460 168 | ; listen queue: 0 169 | ; max listen queue: 1 170 | ; listen queue len: 42 171 | ; idle processes: 4 172 | ; active processes: 11 173 | ; total processes: 15 174 | ; max active processes: 12 175 | ; max children reached: 0 176 | ; 177 | ; By default the status page output is formatted as text/plain. Passing either 178 | ; 'html', 'xml' or 'json' in the query string will return the corresponding 179 | ; output syntax. Example: 180 | ; http://www.foo.bar/status 181 | ; http://www.foo.bar/status?json 182 | ; http://www.foo.bar/status?html 183 | ; http://www.foo.bar/status?xml 184 | ; 185 | ; By default the status page only outputs short status. Passing 'full' in the 186 | ; query string will also return status for each pool process. 187 | ; Example: 188 | ; http://www.foo.bar/status?full 189 | ; http://www.foo.bar/status?json&full 190 | ; http://www.foo.bar/status?html&full 191 | ; http://www.foo.bar/status?xml&full 192 | ; The Full status returns for each process: 193 | ; pid - the PID of the process; 194 | ; state - the state of the process (Idle, Running, ...); 195 | ; start time - the date and time the process has started; 196 | ; start since - the number of seconds since the process has started; 197 | ; requests - the number of requests the process has served; 198 | ; request duration - the duration in µs of the requests; 199 | ; request method - the request method (GET, POST, ...); 200 | ; request URI - the request URI with the query string; 201 | ; content length - the content length of the request (only with POST); 202 | ; user - the user (PHP_AUTH_USER) (or '-' if not set); 203 | ; script - the main script called (or '-' if not set); 204 | ; last request cpu - the %cpu the last request consumed 205 | ; it's always 0 if the process is not in Idle state 206 | ; because CPU calculation is done when the request 207 | ; processing has terminated; 208 | ; last request memory - the max amount of memory the last request consumed 209 | ; it's always 0 if the process is not in Idle state 210 | ; because memory calculation is done when the request 211 | ; processing has terminated; 212 | ; If the process is in Idle state, then informations are related to the 213 | ; last request the process has served. Otherwise informations are related to 214 | ; the current request being served. 215 | ; Example output: 216 | ; ************************ 217 | ; pid: 31330 218 | ; state: Running 219 | ; start time: 01/Jul/2011:17:53:49 +0200 220 | ; start since: 63087 221 | ; requests: 12808 222 | ; request duration: 1250261 223 | ; request method: GET 224 | ; request URI: /test_mem.php?N=10000 225 | ; content length: 0 226 | ; user: - 227 | ; script: /home/fat/web/docs/php/test_mem.php 228 | ; last request cpu: 0.00 229 | ; last request memory: 0 230 | ; 231 | ; Note: There is a real-time FPM status monitoring sample web page available 232 | ; It's available in: /usr/local/share/php/fpm/status.html 233 | ; 234 | ; Note: The value must start with a leading slash (/). The value can be 235 | ; anything, but it may not be a good idea to use the .php extension or it 236 | ; may conflict with a real PHP file. 237 | ; Default Value: not set 238 | ;pm.status_path = /status 239 | 240 | ; The ping URI to call the monitoring page of FPM. If this value is not set, no 241 | ; URI will be recognized as a ping page. This could be used to test from outside 242 | ; that FPM is alive and responding, or to 243 | ; - create a graph of FPM availability (rrd or such); 244 | ; - remove a server from a group if it is not responding (load balancing); 245 | ; - trigger alerts for the operating team (24/7). 246 | ; Note: The value must start with a leading slash (/). The value can be 247 | ; anything, but it may not be a good idea to use the .php extension or it 248 | ; may conflict with a real PHP file. 249 | ; Default Value: not set 250 | ;ping.path = /ping 251 | 252 | ; This directive may be used to customize the response of a ping request. The 253 | ; response is formatted as text/plain with a 200 response code. 254 | ; Default Value: pong 255 | ;ping.response = pong 256 | 257 | ; The access log file 258 | ; Default: not set 259 | ;access.log = log/$pool.access.log 260 | 261 | ; The access log format. 262 | ; The following syntax is allowed 263 | ; %%: the '%' character 264 | ; %C: %CPU used by the request 265 | ; it can accept the following format: 266 | ; - %{user}C for user CPU only 267 | ; - %{system}C for system CPU only 268 | ; - %{total}C for user + system CPU (default) 269 | ; %d: time taken to serve the request 270 | ; it can accept the following format: 271 | ; - %{seconds}d (default) 272 | ; - %{miliseconds}d 273 | ; - %{mili}d 274 | ; - %{microseconds}d 275 | ; - %{micro}d 276 | ; %e: an environment variable (same as $_ENV or $_SERVER) 277 | ; it must be associated with embraces to specify the name of the env 278 | ; variable. Some exemples: 279 | ; - server specifics like: %{REQUEST_METHOD}e or %{SERVER_PROTOCOL}e 280 | ; - HTTP headers like: %{HTTP_HOST}e or %{HTTP_USER_AGENT}e 281 | ; %f: script filename 282 | ; %l: content-length of the request (for POST request only) 283 | ; %m: request method 284 | ; %M: peak of memory allocated by PHP 285 | ; it can accept the following format: 286 | ; - %{bytes}M (default) 287 | ; - %{kilobytes}M 288 | ; - %{kilo}M 289 | ; - %{megabytes}M 290 | ; - %{mega}M 291 | ; %n: pool name 292 | ; %o: output header 293 | ; it must be associated with embraces to specify the name of the header: 294 | ; - %{Content-Type}o 295 | ; - %{X-Powered-By}o 296 | ; - %{Transfert-Encoding}o 297 | ; - .... 298 | ; %p: PID of the child that serviced the request 299 | ; %P: PID of the parent of the child that serviced the request 300 | ; %q: the query string 301 | ; %Q: the '?' character if query string exists 302 | ; %r: the request URI (without the query string, see %q and %Q) 303 | ; %R: remote IP address 304 | ; %s: status (response code) 305 | ; %t: server time the request was received 306 | ; it can accept a strftime(3) format: 307 | ; %d/%b/%Y:%H:%M:%S %z (default) 308 | ; The strftime(3) format must be encapsuled in a %{}t tag 309 | ; e.g. for a ISO8601 formatted timestring, use: %{%Y-%m-%dT%H:%M:%S%z}t 310 | ; %T: time the log has been written (the request has finished) 311 | ; it can accept a strftime(3) format: 312 | ; %d/%b/%Y:%H:%M:%S %z (default) 313 | ; The strftime(3) format must be encapsuled in a %{}t tag 314 | ; e.g. for a ISO8601 formatted timestring, use: %{%Y-%m-%dT%H:%M:%S%z}t 315 | ; %u: remote user 316 | ; 317 | ; Default: "%R - %u %t \"%m %r\" %s" 318 | ;access.format = "%R - %u %t \"%m %r%Q%q\" %s %f %{mili}d %{kilo}M %C%%" 319 | 320 | ; The log file for slow requests 321 | ; Default Value: not set 322 | ; Note: slowlog is mandatory if request_slowlog_timeout is set 323 | slowlog = /var/log/php/fpm.slow.log 324 | 325 | ; The timeout for serving a single request after which a PHP backtrace will be 326 | ; dumped to the 'slowlog' file. A value of '0s' means 'off'. 327 | ; Available units: s(econds)(default), m(inutes), h(ours), or d(ays) 328 | ; Default Value: 0 329 | request_slowlog_timeout = 3 330 | 331 | ; Depth of slow log stack trace. 332 | ; Default Value: 20 333 | ;request_slowlog_trace_depth = 20 334 | 335 | ; The timeout for serving a single request after which the worker process will 336 | ; be killed. This option should be used when the 'max_execution_time' ini option 337 | ; does not stop script execution for some reason. A value of '0' means 'off'. 338 | ; Available units: s(econds)(default), m(inutes), h(ours), or d(ays) 339 | ; Default Value: 0 340 | ;request_terminate_timeout = 0 341 | 342 | ; Set open file descriptor rlimit. 343 | ; Default Value: system defined value 344 | ;rlimit_files = 1024 345 | 346 | ; Set max core size rlimit. 347 | ; Possible Values: 'unlimited' or an integer greater or equal to 0 348 | ; Default Value: system defined value 349 | ;rlimit_core = 0 350 | 351 | ; Chroot to this directory at the start. This value must be defined as an 352 | ; absolute path. When this value is not set, chroot is not used. 353 | ; Note: you can prefix with '$prefix' to chroot to the pool prefix or one 354 | ; of its subdirectories. If the pool prefix is not set, the global prefix 355 | ; will be used instead. 356 | ; Note: chrooting is a great security feature and should be used whenever 357 | ; possible. However, all PHP paths will be relative to the chroot 358 | ; (error_log, sessions.save_path, ...). 359 | ; Default Value: not set 360 | ;chroot = 361 | 362 | ; Chdir to this directory at the start. 363 | ; Note: relative path can be used. 364 | ; Default Value: current directory or / when chroot 365 | ;chdir = /var/www 366 | 367 | ; Redirect worker stdout and stderr into main error log. If not set, stdout and 368 | ; stderr will be redirected to /dev/null according to FastCGI specs. 369 | ; Note: on highloaded environement, this can cause some delay in the page 370 | ; process time (several ms). 371 | ; Default Value: no 372 | catch_workers_output = yes 373 | 374 | ; Clear environment in FPM workers 375 | ; Prevents arbitrary environment variables from reaching FPM worker processes 376 | ; by clearing the environment in workers before env vars specified in this 377 | ; pool configuration are added. 378 | ; Setting to "no" will make all environment variables available to PHP code 379 | ; via getenv(), $_ENV and $_SERVER. 380 | ; Default Value: yes 381 | ;clear_env = no 382 | 383 | ; Limits the extensions of the main script FPM will allow to parse. This can 384 | ; prevent configuration mistakes on the web server side. You should only limit 385 | ; FPM to .php extensions to prevent malicious users to use other extensions to 386 | ; execute php code. 387 | ; Note: set an empty value to allow all extensions. 388 | ; Default Value: .php 389 | ;security.limit_extensions = .php .php3 .php4 .php5 .php7 390 | 391 | ; Pass environment variables like LD_LIBRARY_PATH. All $VARIABLEs are taken from 392 | ; the current environment. 393 | ; Default Value: clean env 394 | ;env[HOSTNAME] = $HOSTNAME 395 | ;env[PATH] = /usr/local/bin:/usr/bin:/bin 396 | ;env[TMP] = /tmp 397 | ;env[TMPDIR] = /tmp 398 | ;env[TEMP] = /tmp 399 | 400 | ; Additional php.ini defines, specific to this pool of workers. These settings 401 | ; overwrite the values previously defined in the php.ini. The directives are the 402 | ; same as the PHP SAPI: 403 | ; php_value/php_flag - you can set classic ini defines which can 404 | ; be overwritten from PHP call 'ini_set'. 405 | ; php_admin_value/php_admin_flag - these directives won't be overwritten by 406 | ; PHP call 'ini_set' 407 | ; For php_*flag, valid values are on, off, 1, 0, true, false, yes or no. 408 | 409 | ; Defining 'extension' will load the corresponding shared extension from 410 | ; extension_dir. Defining 'disable_functions' or 'disable_classes' will not 411 | ; overwrite previously defined php.ini values, but will append the new value 412 | ; instead. 413 | 414 | ; Note: path INI options can be relative and will be expanded with the prefix 415 | ; (pool, global or /usr/local) 416 | 417 | ; Default Value: nothing is defined by default except the values in php.ini and 418 | ; specified at startup with the -d argument 419 | ;php_admin_value[sendmail_path] = /usr/sbin/sendmail -t -i -f www@my.domain.com 420 | ;php_flag[display_errors] = off 421 | ;php_admin_value[error_log] = /var/log/fpm-php.www.log 422 | ;php_admin_flag[log_errors] = on 423 | ;php_admin_value[memory_limit] = 32M 424 | -------------------------------------------------------------------------------- /conf/php.ini: -------------------------------------------------------------------------------- 1 | [PHP] 2 | 3 | ;;;;;;;;;;;;;;;;;;; 4 | ; About php.ini ; 5 | ;;;;;;;;;;;;;;;;;;; 6 | ; PHP's initialization file, generally called php.ini, is responsible for 7 | ; configuring many of the aspects of PHP's behavior. 8 | 9 | ; PHP attempts to find and load this configuration from a number of locations. 10 | ; The following is a summary of its search order: 11 | ; 1. SAPI module specific location. 12 | ; 2. The PHPRC environment variable. (As of PHP 5.2.0) 13 | ; 3. A number of predefined registry keys on Windows (As of PHP 5.2.0) 14 | ; 4. Current working directory (except CLI) 15 | ; 5. The web server's directory (for SAPI modules), or directory of PHP 16 | ; (otherwise in Windows) 17 | ; 6. The directory from the --with-config-file-path compile time option, or the 18 | ; Windows directory (C:\windows or C:\winnt) 19 | ; See the PHP docs for more specific information. 20 | ; http://php.net/configuration.file 21 | 22 | ; The syntax of the file is extremely simple. Whitespace and lines 23 | ; beginning with a semicolon are silently ignored (as you probably guessed). 24 | ; Section headers (e.g. [Foo]) are also silently ignored, even though 25 | ; they might mean something in the future. 26 | 27 | ; Directives following the section heading [PATH=/www/mysite] only 28 | ; apply to PHP files in the /www/mysite directory. Directives 29 | ; following the section heading [HOST=www.example.com] only apply to 30 | ; PHP files served from www.example.com. Directives set in these 31 | ; special sections cannot be overridden by user-defined INI files or 32 | ; at runtime. Currently, [PATH=] and [HOST=] sections only work under 33 | ; CGI/FastCGI. 34 | ; http://php.net/ini.sections 35 | 36 | ; Directives are specified using the following syntax: 37 | ; directive = value 38 | ; Directive names are *case sensitive* - foo=bar is different from FOO=bar. 39 | ; Directives are variables used to configure PHP or PHP extensions. 40 | ; There is no name validation. If PHP can't find an expected 41 | ; directive because it is not set or is mistyped, a default value will be used. 42 | 43 | ; The value can be a string, a number, a PHP constant (e.g. E_ALL or M_PI), one 44 | ; of the INI constants (On, Off, True, False, Yes, No and None) or an expression 45 | ; (e.g. E_ALL & ~E_NOTICE), a quoted string ("bar"), or a reference to a 46 | ; previously set variable or directive (e.g. ${foo}) 47 | 48 | ; Expressions in the INI file are limited to bitwise operators and parentheses: 49 | ; | bitwise OR 50 | ; ^ bitwise XOR 51 | ; & bitwise AND 52 | ; ~ bitwise NOT 53 | ; ! boolean NOT 54 | 55 | ; Boolean flags can be turned on using the values 1, On, True or Yes. 56 | ; They can be turned off using the values 0, Off, False or No. 57 | 58 | ; An empty string can be denoted by simply not writing anything after the equal 59 | ; sign, or by using the None keyword: 60 | 61 | ; foo = ; sets foo to an empty string 62 | ; foo = None ; sets foo to an empty string 63 | ; foo = "None" ; sets foo to the string 'None' 64 | 65 | ; If you use constants in your value, and these constants belong to a 66 | ; dynamically loaded extension (either a PHP extension or a Zend extension), 67 | ; you may only use these constants *after* the line that loads the extension. 68 | 69 | ;;;;;;;;;;;;;;;;;;; 70 | ; About this file ; 71 | ;;;;;;;;;;;;;;;;;;; 72 | ; PHP comes packaged with two INI files. One that is recommended to be used 73 | ; in production environments and one that is recommended to be used in 74 | ; development environments. 75 | 76 | ; php.ini-production contains settings which hold security, performance and 77 | ; best practices at its core. But please be aware, these settings may break 78 | ; compatibility with older or less security conscience applications. We 79 | ; recommending using the production ini in production and testing environments. 80 | 81 | ; php.ini-development is very similar to its production variant, except it is 82 | ; much more verbose when it comes to errors. We recommend using the 83 | ; development version only in development environments, as errors shown to 84 | ; application users can inadvertently leak otherwise secure information. 85 | 86 | ; This is php.ini-production INI file. 87 | 88 | ;;;;;;;;;;;;;;;;;;; 89 | ; Quick Reference ; 90 | ;;;;;;;;;;;;;;;;;;; 91 | ; The following are all the settings which are different in either the production 92 | ; or development versions of the INIs with respect to PHP's default behavior. 93 | ; Please see the actual settings later in the document for more details as to why 94 | ; we recommend these changes in PHP's behavior. 95 | 96 | ; display_errors 97 | ; Default Value: On 98 | ; Development Value: On 99 | ; Production Value: Off 100 | 101 | ; display_startup_errors 102 | ; Default Value: Off 103 | ; Development Value: On 104 | ; Production Value: Off 105 | 106 | ; error_reporting 107 | ; Default Value: E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED 108 | ; Development Value: E_ALL 109 | ; Production Value: E_ALL & ~E_DEPRECATED & ~E_STRICT 110 | 111 | ; html_errors 112 | ; Default Value: On 113 | ; Development Value: On 114 | ; Production value: On 115 | 116 | ; log_errors 117 | ; Default Value: Off 118 | ; Development Value: On 119 | ; Production Value: On 120 | 121 | ; max_input_time 122 | ; Default Value: -1 (Unlimited) 123 | ; Development Value: 60 (60 seconds) 124 | ; Production Value: 60 (60 seconds) 125 | 126 | ; output_buffering 127 | ; Default Value: Off 128 | ; Development Value: 4096 129 | ; Production Value: 4096 130 | 131 | ; register_argc_argv 132 | ; Default Value: On 133 | ; Development Value: Off 134 | ; Production Value: Off 135 | 136 | ; request_order 137 | ; Default Value: None 138 | ; Development Value: "GP" 139 | ; Production Value: "GP" 140 | 141 | ; session.gc_divisor 142 | ; Default Value: 100 143 | ; Development Value: 1000 144 | ; Production Value: 1000 145 | 146 | ; session.sid_bits_per_character 147 | ; Default Value: 4 148 | ; Development Value: 5 149 | ; Production Value: 5 150 | 151 | ; short_open_tag 152 | ; Default Value: On 153 | ; Development Value: Off 154 | ; Production Value: Off 155 | 156 | ; track_errors 157 | ; Default Value: Off 158 | ; Development Value: On 159 | ; Production Value: Off 160 | 161 | ; variables_order 162 | ; Default Value: "EGPCS" 163 | ; Development Value: "GPCS" 164 | ; Production Value: "GPCS" 165 | 166 | ;;;;;;;;;;;;;;;;;;;; 167 | ; php.ini Options ; 168 | ;;;;;;;;;;;;;;;;;;;; 169 | ; Name for user-defined php.ini (.htaccess) files. Default is ".user.ini" 170 | ;user_ini.filename = ".user.ini" 171 | 172 | ; To disable this feature set this option to empty value 173 | ;user_ini.filename = 174 | 175 | ; TTL for user-defined php.ini files (time-to-live) in seconds. Default is 300 seconds (5 minutes) 176 | ;user_ini.cache_ttl = 300 177 | 178 | ;;;;;;;;;;;;;;;;;;;; 179 | ; Language Options ; 180 | ;;;;;;;;;;;;;;;;;;;; 181 | 182 | ; Enable the PHP scripting language engine under Apache. 183 | ; http://php.net/engine 184 | engine = On 185 | 186 | ; This directive determines whether or not PHP will recognize code between 187 | ; tags as PHP source which should be processed as such. It is 188 | ; generally recommended that should be used and that this feature 189 | ; should be disabled, as enabling it may result in issues when generating XML 190 | ; documents, however this remains supported for backward compatibility reasons. 191 | ; Note that this directive does not control the would work. 323 | ; http://php.net/syntax-highlighting 324 | ;highlight.string = #DD0000 325 | ;highlight.comment = #FF9900 326 | ;highlight.keyword = #007700 327 | ;highlight.default = #0000BB 328 | ;highlight.html = #000000 329 | 330 | ; If enabled, the request will be allowed to complete even if the user aborts 331 | ; the request. Consider enabling it if executing long requests, which may end up 332 | ; being interrupted by the user or a browser timing out. PHP's default behavior 333 | ; is to disable this feature. 334 | ; http://php.net/ignore-user-abort 335 | ;ignore_user_abort = On 336 | 337 | ; Determines the size of the realpath cache to be used by PHP. This value should 338 | ; be increased on systems where PHP opens many files to reflect the quantity of 339 | ; the file operations performed. 340 | ; http://php.net/realpath-cache-size 341 | ;realpath_cache_size = 4096k 342 | 343 | ; Duration of time, in seconds for which to cache realpath information for a given 344 | ; file or directory. For systems with rarely changing files, consider increasing this 345 | ; value. 346 | ; http://php.net/realpath-cache-ttl 347 | ;realpath_cache_ttl = 120 348 | 349 | ; Enables or disables the circular reference collector. 350 | ; http://php.net/zend.enable-gc 351 | zend.enable_gc = On 352 | 353 | ; If enabled, scripts may be written in encodings that are incompatible with 354 | ; the scanner. CP936, Big5, CP949 and Shift_JIS are the examples of such 355 | ; encodings. To use this feature, mbstring extension must be enabled. 356 | ; Default: Off 357 | ;zend.multibyte = Off 358 | 359 | ; Allows to set the default encoding for the scripts. This value will be used 360 | ; unless "declare(encoding=...)" directive appears at the top of the script. 361 | ; Only affects if zend.multibyte is set. 362 | ; Default: "" 363 | ;zend.script_encoding = 364 | 365 | ;;;;;;;;;;;;;;;;; 366 | ; Miscellaneous ; 367 | ;;;;;;;;;;;;;;;;; 368 | 369 | ; Decides whether PHP may expose the fact that it is installed on the server 370 | ; (e.g. by adding its signature to the Web server header). It is no security 371 | ; threat in any way, but it makes it possible to determine whether you use PHP 372 | ; on your server or not. 373 | ; http://php.net/expose-php 374 | expose_php = On 375 | 376 | ;;;;;;;;;;;;;;;;;;; 377 | ; Resource Limits ; 378 | ;;;;;;;;;;;;;;;;;;; 379 | 380 | ; Maximum execution time of each script, in seconds 381 | ; http://php.net/max-execution-time 382 | ; Note: This directive is hardcoded to 0 for the CLI SAPI 383 | max_execution_time = 30 384 | 385 | ; Maximum amount of time each script may spend parsing request data. It's a good 386 | ; idea to limit this time on productions servers in order to eliminate unexpectedly 387 | ; long running scripts. 388 | ; Note: This directive is hardcoded to -1 for the CLI SAPI 389 | ; Default Value: -1 (Unlimited) 390 | ; Development Value: 60 (60 seconds) 391 | ; Production Value: 60 (60 seconds) 392 | ; http://php.net/max-input-time 393 | max_input_time = 60 394 | 395 | ; Maximum input variable nesting level 396 | ; http://php.net/max-input-nesting-level 397 | ;max_input_nesting_level = 64 398 | 399 | ; How many GET/POST/COOKIE input variables may be accepted 400 | ; max_input_vars = 1000 401 | 402 | ; Maximum amount of memory a script may consume (128MB) 403 | ; http://php.net/memory-limit 404 | memory_limit = 256M 405 | 406 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 407 | ; Error handling and logging ; 408 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 409 | 410 | ; This directive informs PHP of which errors, warnings and notices you would like 411 | ; it to take action for. The recommended way of setting values for this 412 | ; directive is through the use of the error level constants and bitwise 413 | ; operators. The error level constants are below here for convenience as well as 414 | ; some common settings and their meanings. 415 | ; By default, PHP is set to take action on all errors, notices and warnings EXCEPT 416 | ; those related to E_NOTICE and E_STRICT, which together cover best practices and 417 | ; recommended coding standards in PHP. For performance reasons, this is the 418 | ; recommend error reporting setting. Your production server shouldn't be wasting 419 | ; resources complaining about best practices and coding standards. That's what 420 | ; development servers and development settings are for. 421 | ; Note: The php.ini-development file has this setting as E_ALL. This 422 | ; means it pretty much reports everything which is exactly what you want during 423 | ; development and early testing. 424 | ; 425 | ; Error Level Constants: 426 | ; E_ALL - All errors and warnings (includes E_STRICT as of PHP 5.4.0) 427 | ; E_ERROR - fatal run-time errors 428 | ; E_RECOVERABLE_ERROR - almost fatal run-time errors 429 | ; E_WARNING - run-time warnings (non-fatal errors) 430 | ; E_PARSE - compile-time parse errors 431 | ; E_NOTICE - run-time notices (these are warnings which often result 432 | ; from a bug in your code, but it's possible that it was 433 | ; intentional (e.g., using an uninitialized variable and 434 | ; relying on the fact it is automatically initialized to an 435 | ; empty string) 436 | ; E_STRICT - run-time notices, enable to have PHP suggest changes 437 | ; to your code which will ensure the best interoperability 438 | ; and forward compatibility of your code 439 | ; E_CORE_ERROR - fatal errors that occur during PHP's initial startup 440 | ; E_CORE_WARNING - warnings (non-fatal errors) that occur during PHP's 441 | ; initial startup 442 | ; E_COMPILE_ERROR - fatal compile-time errors 443 | ; E_COMPILE_WARNING - compile-time warnings (non-fatal errors) 444 | ; E_USER_ERROR - user-generated error message 445 | ; E_USER_WARNING - user-generated warning message 446 | ; E_USER_NOTICE - user-generated notice message 447 | ; E_DEPRECATED - warn about code that will not work in future versions 448 | ; of PHP 449 | ; E_USER_DEPRECATED - user-generated deprecation warnings 450 | ; 451 | ; Common Values: 452 | ; E_ALL (Show all errors, warnings and notices including coding standards.) 453 | ; E_ALL & ~E_NOTICE (Show all errors, except for notices) 454 | ; E_ALL & ~E_NOTICE & ~E_STRICT (Show all errors, except for notices and coding standards warnings.) 455 | ; E_COMPILE_ERROR|E_RECOVERABLE_ERROR|E_ERROR|E_CORE_ERROR (Show only errors) 456 | ; Default Value: E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED 457 | ; Development Value: E_ALL 458 | ; Production Value: E_ALL & ~E_DEPRECATED & ~E_STRICT 459 | ; http://php.net/error-reporting 460 | error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT 461 | 462 | ; This directive controls whether or not and where PHP will output errors, 463 | ; notices and warnings too. Error output is very useful during development, but 464 | ; it could be very dangerous in production environments. Depending on the code 465 | ; which is triggering the error, sensitive information could potentially leak 466 | ; out of your application such as database usernames and passwords or worse. 467 | ; For production environments, we recommend logging errors rather than 468 | ; sending them to STDOUT. 469 | ; Possible Values: 470 | ; Off = Do not display any errors 471 | ; stderr = Display errors to STDERR (affects only CGI/CLI binaries!) 472 | ; On or stdout = Display errors to STDOUT 473 | ; Default Value: On 474 | ; Development Value: On 475 | ; Production Value: Off 476 | ; http://php.net/display-errors 477 | display_errors = Off 478 | 479 | ; The display of errors which occur during PHP's startup sequence are handled 480 | ; separately from display_errors. PHP's default behavior is to suppress those 481 | ; errors from clients. Turning the display of startup errors on can be useful in 482 | ; debugging configuration problems. We strongly recommend you 483 | ; set this to 'off' for production servers. 484 | ; Default Value: Off 485 | ; Development Value: On 486 | ; Production Value: Off 487 | ; http://php.net/display-startup-errors 488 | display_startup_errors = Off 489 | 490 | ; Besides displaying errors, PHP can also log errors to locations such as a 491 | ; server-specific log, STDERR, or a location specified by the error_log 492 | ; directive found below. While errors should not be displayed on productions 493 | ; servers they should still be monitored and logging is a great way to do that. 494 | ; Default Value: Off 495 | ; Development Value: On 496 | ; Production Value: On 497 | ; http://php.net/log-errors 498 | log_errors = On 499 | 500 | ; Set maximum length of log_errors. In error_log information about the source is 501 | ; added. The default is 1024 and 0 allows to not apply any maximum length at all. 502 | ; http://php.net/log-errors-max-len 503 | log_errors_max_len = 1024 504 | 505 | ; Do not log repeated messages. Repeated errors must occur in same file on same 506 | ; line unless ignore_repeated_source is set true. 507 | ; http://php.net/ignore-repeated-errors 508 | ignore_repeated_errors = Off 509 | 510 | ; Ignore source of message when ignoring repeated messages. When this setting 511 | ; is On you will not log errors with repeated messages from different files or 512 | ; source lines. 513 | ; http://php.net/ignore-repeated-source 514 | ignore_repeated_source = Off 515 | 516 | ; If this parameter is set to Off, then memory leaks will not be shown (on 517 | ; stdout or in the log). This has only effect in a debug compile, and if 518 | ; error reporting includes E_WARNING in the allowed list 519 | ; http://php.net/report-memleaks 520 | report_memleaks = On 521 | 522 | ; This setting is on by default. 523 | ;report_zend_debug = 0 524 | 525 | ; Store the last error/warning message in $php_errormsg (boolean). Setting this value 526 | ; to On can assist in debugging and is appropriate for development servers. It should 527 | ; however be disabled on production servers. 528 | ; Default Value: Off 529 | ; Development Value: On 530 | ; Production Value: Off 531 | ; http://php.net/track-errors 532 | track_errors = Off 533 | 534 | ; Turn off normal error reporting and emit XML-RPC error XML 535 | ; http://php.net/xmlrpc-errors 536 | ;xmlrpc_errors = 0 537 | 538 | ; An XML-RPC faultCode 539 | ;xmlrpc_error_number = 0 540 | 541 | ; When PHP displays or logs an error, it has the capability of formatting the 542 | ; error message as HTML for easier reading. This directive controls whether 543 | ; the error message is formatted as HTML or not. 544 | ; Note: This directive is hardcoded to Off for the CLI SAPI 545 | ; Default Value: On 546 | ; Development Value: On 547 | ; Production value: On 548 | ; http://php.net/html-errors 549 | html_errors = On 550 | 551 | ; If html_errors is set to On *and* docref_root is not empty, then PHP 552 | ; produces clickable error messages that direct to a page describing the error 553 | ; or function causing the error in detail. 554 | ; You can download a copy of the PHP manual from http://php.net/docs 555 | ; and change docref_root to the base URL of your local copy including the 556 | ; leading '/'. You must also specify the file extension being used including 557 | ; the dot. PHP's default behavior is to leave these settings empty, in which 558 | ; case no links to documentation are generated. 559 | ; Note: Never use this feature for production boxes. 560 | ; http://php.net/docref-root 561 | ; Examples 562 | ;docref_root = "/phpmanual/" 563 | 564 | ; http://php.net/docref-ext 565 | ;docref_ext = .html 566 | 567 | ; String to output before an error message. PHP's default behavior is to leave 568 | ; this setting blank. 569 | ; http://php.net/error-prepend-string 570 | ; Example: 571 | ;error_prepend_string = "" 572 | 573 | ; String to output after an error message. PHP's default behavior is to leave 574 | ; this setting blank. 575 | ; http://php.net/error-append-string 576 | ; Example: 577 | ;error_append_string = "" 578 | 579 | ; Log errors to specified file. PHP's default behavior is to leave this value 580 | ; empty. 581 | ; http://php.net/error-log 582 | ; Example: 583 | ;error_log = php_errors.log 584 | ; Log errors to syslog (Event Log on Windows). 585 | error_log = /var/log/php/php.error.log 586 | 587 | ;windows.show_crt_warning 588 | ; Default value: 0 589 | ; Development value: 0 590 | ; Production value: 0 591 | 592 | ;;;;;;;;;;;;;;;;; 593 | ; Data Handling ; 594 | ;;;;;;;;;;;;;;;;; 595 | 596 | ; The separator used in PHP generated URLs to separate arguments. 597 | ; PHP's default setting is "&". 598 | ; http://php.net/arg-separator.output 599 | ; Example: 600 | ;arg_separator.output = "&" 601 | 602 | ; List of separator(s) used by PHP to parse input URLs into variables. 603 | ; PHP's default setting is "&". 604 | ; NOTE: Every character in this directive is considered as separator! 605 | ; http://php.net/arg-separator.input 606 | ; Example: 607 | ;arg_separator.input = ";&" 608 | 609 | ; This directive determines which super global arrays are registered when PHP 610 | ; starts up. G,P,C,E & S are abbreviations for the following respective super 611 | ; globals: GET, POST, COOKIE, ENV and SERVER. There is a performance penalty 612 | ; paid for the registration of these arrays and because ENV is not as commonly 613 | ; used as the others, ENV is not recommended on productions servers. You 614 | ; can still get access to the environment variables through getenv() should you 615 | ; need to. 616 | ; Default Value: "EGPCS" 617 | ; Development Value: "GPCS" 618 | ; Production Value: "GPCS"; 619 | ; http://php.net/variables-order 620 | variables_order = "GPCS" 621 | 622 | ; This directive determines which super global data (G,P & C) should be 623 | ; registered into the super global array REQUEST. If so, it also determines 624 | ; the order in which that data is registered. The values for this directive 625 | ; are specified in the same manner as the variables_order directive, 626 | ; EXCEPT one. Leaving this value empty will cause PHP to use the value set 627 | ; in the variables_order directive. It does not mean it will leave the super 628 | ; globals array REQUEST empty. 629 | ; Default Value: None 630 | ; Development Value: "GP" 631 | ; Production Value: "GP" 632 | ; http://php.net/request-order 633 | request_order = "GP" 634 | 635 | ; This directive determines whether PHP registers $argv & $argc each time it 636 | ; runs. $argv contains an array of all the arguments passed to PHP when a script 637 | ; is invoked. $argc contains an integer representing the number of arguments 638 | ; that were passed when the script was invoked. These arrays are extremely 639 | ; useful when running scripts from the command line. When this directive is 640 | ; enabled, registering these variables consumes CPU cycles and memory each time 641 | ; a script is executed. For performance reasons, this feature should be disabled 642 | ; on production servers. 643 | ; Note: This directive is hardcoded to On for the CLI SAPI 644 | ; Default Value: On 645 | ; Development Value: Off 646 | ; Production Value: Off 647 | ; http://php.net/register-argc-argv 648 | register_argc_argv = Off 649 | 650 | ; When enabled, the ENV, REQUEST and SERVER variables are created when they're 651 | ; first used (Just In Time) instead of when the script starts. If these 652 | ; variables are not used within a script, having this directive on will result 653 | ; in a performance gain. The PHP directive register_argc_argv must be disabled 654 | ; for this directive to have any affect. 655 | ; http://php.net/auto-globals-jit 656 | auto_globals_jit = On 657 | 658 | ; Whether PHP will read the POST data. 659 | ; This option is enabled by default. 660 | ; Most likely, you won't want to disable this option globally. It causes $_POST 661 | ; and $_FILES to always be empty; the only way you will be able to read the 662 | ; POST data will be through the php://input stream wrapper. This can be useful 663 | ; to proxy requests or to process the POST data in a memory efficient fashion. 664 | ; http://php.net/enable-post-data-reading 665 | ;enable_post_data_reading = Off 666 | 667 | ; Maximum size of POST data that PHP will accept. 668 | ; Its value may be 0 to disable the limit. It is ignored if POST data reading 669 | ; is disabled through enable_post_data_reading. 670 | ; http://php.net/post-max-size 671 | post_max_size = 100M 672 | 673 | ; Automatically add files before PHP document. 674 | ; http://php.net/auto-prepend-file 675 | ; auto_prepend_file = "/var/www/html/xhgui-branch/external/header.php" 676 | 677 | ; Automatically add files after PHP document. 678 | ; http://php.net/auto-append-file 679 | auto_append_file = 680 | 681 | ; By default, PHP will output a media type using the Content-Type header. To 682 | ; disable this, simply set it to be empty. 683 | ; 684 | ; PHP's built-in default media type is set to text/html. 685 | ; http://php.net/default-mimetype 686 | default_mimetype = "text/html" 687 | 688 | ; PHP's default character set is set to UTF-8. 689 | ; http://php.net/default-charset 690 | default_charset = "UTF-8" 691 | 692 | ; PHP internal character encoding is set to empty. 693 | ; If empty, default_charset is used. 694 | ; http://php.net/internal-encoding 695 | ;internal_encoding = 696 | 697 | ; PHP input character encoding is set to empty. 698 | ; If empty, default_charset is used. 699 | ; http://php.net/input-encoding 700 | ;input_encoding = 701 | 702 | ; PHP output character encoding is set to empty. 703 | ; If empty, default_charset is used. 704 | ; See also output_buffer. 705 | ; http://php.net/output-encoding 706 | ;output_encoding = 707 | 708 | ;;;;;;;;;;;;;;;;;;;;;;;;; 709 | ; Paths and Directories ; 710 | ;;;;;;;;;;;;;;;;;;;;;;;;; 711 | 712 | ; UNIX: "/path1:/path2" 713 | ;include_path = ".:/php/includes" 714 | ; 715 | ; Windows: "\path1;\path2" 716 | ;include_path = ".;c:\php\includes" 717 | ; 718 | ; PHP's default setting for include_path is ".;/path/to/php/pear" 719 | ; http://php.net/include-path 720 | 721 | ; The root of the PHP pages, used only if nonempty. 722 | ; if PHP was not compiled with FORCE_REDIRECT, you SHOULD set doc_root 723 | ; if you are running php as a CGI under any web server (other than IIS) 724 | ; see documentation for security issues. The alternate is to use the 725 | ; cgi.force_redirect configuration below 726 | ; http://php.net/doc-root 727 | doc_root = 728 | 729 | ; The directory under which PHP opens the script using /~username used only 730 | ; if nonempty. 731 | ; http://php.net/user-dir 732 | user_dir = 733 | 734 | ; Directory in which the loadable extensions (modules) reside. 735 | ; http://php.net/extension-dir 736 | ; extension_dir = "./" 737 | ; On windows: 738 | ; extension_dir = "ext" 739 | 740 | ; Directory where the temporary files should be placed. 741 | ; Defaults to the system default (see sys_get_temp_dir) 742 | ; sys_temp_dir = "/tmp" 743 | 744 | ; Whether or not to enable the dl() function. The dl() function does NOT work 745 | ; properly in multithreaded servers, such as IIS or Zeus, and is automatically 746 | ; disabled on them. 747 | ; http://php.net/enable-dl 748 | enable_dl = Off 749 | 750 | ; cgi.force_redirect is necessary to provide security running PHP as a CGI under 751 | ; most web servers. Left undefined, PHP turns this on by default. You can 752 | ; turn it off here AT YOUR OWN RISK 753 | ; **You CAN safely turn this off for IIS, in fact, you MUST.** 754 | ; http://php.net/cgi.force-redirect 755 | ;cgi.force_redirect = 1 756 | 757 | ; if cgi.nph is enabled it will force cgi to always sent Status: 200 with 758 | ; every request. PHP's default behavior is to disable this feature. 759 | ;cgi.nph = 1 760 | 761 | ; if cgi.force_redirect is turned on, and you are not running under Apache or Netscape 762 | ; (iPlanet) web servers, you MAY need to set an environment variable name that PHP 763 | ; will look for to know it is OK to continue execution. Setting this variable MAY 764 | ; cause security issues, KNOW WHAT YOU ARE DOING FIRST. 765 | ; http://php.net/cgi.redirect-status-env 766 | ;cgi.redirect_status_env = 767 | 768 | ; cgi.fix_pathinfo provides *real* PATH_INFO/PATH_TRANSLATED support for CGI. PHP's 769 | ; previous behaviour was to set PATH_TRANSLATED to SCRIPT_FILENAME, and to not grok 770 | ; what PATH_INFO is. For more information on PATH_INFO, see the cgi specs. Setting 771 | ; this to 1 will cause PHP CGI to fix its paths to conform to the spec. A setting 772 | ; of zero causes PHP to behave as before. Default is 1. You should fix your scripts 773 | ; to use SCRIPT_FILENAME rather than PATH_TRANSLATED. 774 | ; http://php.net/cgi.fix-pathinfo 775 | ;cgi.fix_pathinfo=1 776 | 777 | ; if cgi.discard_path is enabled, the PHP CGI binary can safely be placed outside 778 | ; of the web tree and people will not be able to circumvent .htaccess security. 779 | ; http://php.net/cgi.dicard-path 780 | ;cgi.discard_path=1 781 | 782 | ; FastCGI under IIS (on WINNT based OS) supports the ability to impersonate 783 | ; security tokens of the calling client. This allows IIS to define the 784 | ; security context that the request runs under. mod_fastcgi under Apache 785 | ; does not currently support this feature (03/17/2002) 786 | ; Set to 1 if running under IIS. Default is zero. 787 | ; http://php.net/fastcgi.impersonate 788 | ;fastcgi.impersonate = 1 789 | 790 | ; Disable logging through FastCGI connection. PHP's default behavior is to enable 791 | ; this feature. 792 | ;fastcgi.logging = 0 793 | 794 | ; cgi.rfc2616_headers configuration option tells PHP what type of headers to 795 | ; use when sending HTTP response code. If set to 0, PHP sends Status: header that 796 | ; is supported by Apache. When this option is set to 1, PHP will send 797 | ; RFC2616 compliant header. 798 | ; Default is zero. 799 | ; http://php.net/cgi.rfc2616-headers 800 | ;cgi.rfc2616_headers = 0 801 | 802 | ; cgi.check_shebang_line controls whether CGI PHP checks for line starting with #! 803 | ; (shebang) at the top of the running script. This line might be needed if the 804 | ; script support running both as stand-alone script and via PHP CGI<. PHP in CGI 805 | ; mode skips this line and ignores its content if this directive is turned on. 806 | ; http://php.net/cgi.check-shebang-line 807 | ;cgi.check_shebang_line=1 808 | 809 | ;;;;;;;;;;;;;;;; 810 | ; File Uploads ; 811 | ;;;;;;;;;;;;;;;; 812 | 813 | ; Whether to allow HTTP file uploads. 814 | ; http://php.net/file-uploads 815 | file_uploads = On 816 | 817 | ; Temporary directory for HTTP uploaded files (will use system default if not 818 | ; specified). 819 | ; http://php.net/upload-tmp-dir 820 | ;upload_tmp_dir = 821 | 822 | ; Maximum allowed size for uploaded files. 823 | ; http://php.net/upload-max-filesize 824 | upload_max_filesize = 50M 825 | 826 | ; Maximum number of files that can be uploaded via a single request 827 | max_file_uploads = 20 828 | 829 | ;;;;;;;;;;;;;;;;;; 830 | ; Fopen wrappers ; 831 | ;;;;;;;;;;;;;;;;;; 832 | 833 | ; Whether to allow the treatment of URLs (like http:// or ftp://) as files. 834 | ; http://php.net/allow-url-fopen 835 | allow_url_fopen = On 836 | 837 | ; Whether to allow include/require to open URLs (like http:// or ftp://) as files. 838 | ; http://php.net/allow-url-include 839 | allow_url_include = Off 840 | 841 | ; Define the anonymous ftp password (your email address). PHP's default setting 842 | ; for this is empty. 843 | ; http://php.net/from 844 | ;from="john@doe.com" 845 | 846 | ; Define the User-Agent string. PHP's default setting for this is empty. 847 | ; http://php.net/user-agent 848 | ;user_agent="PHP" 849 | 850 | ; Default timeout for socket based streams (seconds) 851 | ; http://php.net/default-socket-timeout 852 | default_socket_timeout = 60 853 | 854 | ; If your scripts have to deal with files from Macintosh systems, 855 | ; or you are running on a Mac and need to deal with files from 856 | ; unix or win32 systems, setting this flag will cause PHP to 857 | ; automatically detect the EOL character in those files so that 858 | ; fgets() and file() will work regardless of the source of the file. 859 | ; http://php.net/auto-detect-line-endings 860 | ;auto_detect_line_endings = Off 861 | 862 | ;;;;;;;;;;;;;;;;;;;;;; 863 | ; Dynamic Extensions ; 864 | ;;;;;;;;;;;;;;;;;;;;;; 865 | 866 | ; If you wish to have an extension loaded automatically, use the following 867 | ; syntax: 868 | ; 869 | ; extension=modulename.extension 870 | ; 871 | ; For example, on Windows: 872 | ; 873 | ; extension=mysqli.dll 874 | ; 875 | ; ... or under UNIX: 876 | ; 877 | ; extension=mysqli.so 878 | ; 879 | ; ... or with a path: 880 | ; 881 | ; extension=/path/to/extension/mysqli.so 882 | ; 883 | ; If you only provide the name of the extension, PHP will look for it in its 884 | ; default extension directory. 885 | ; 886 | ; Windows Extensions 887 | ; Note that ODBC support is built in, so no dll is needed for it. 888 | ; Note that many DLL files are located in the extensions/ (PHP 4) ext/ (PHP 5+) 889 | ; extension folders as well as the separate PECL DLL download (PHP 5+). 890 | ; Be sure to appropriately set the extension_dir directive. 891 | ; 892 | ;extension=php_bz2.dll 893 | ;extension=php_curl.dll 894 | ;extension=php_fileinfo.dll 895 | ;extension=php_ftp.dll 896 | ;extension=php_gd2.dll 897 | ;extension=php_gettext.dll 898 | ;extension=php_gmp.dll 899 | ;extension=php_intl.dll 900 | ;extension=php_imap.dll 901 | ;extension=php_interbase.dll 902 | ;extension=php_ldap.dll 903 | ;extension=php_mbstring.dll 904 | ;extension=php_exif.dll ; Must be after mbstring as it depends on it 905 | ;extension=php_mysqli.dll 906 | ;extension=php_oci8_12c.dll ; Use with Oracle Database 12c Instant Client 907 | ;extension=php_openssl.dll 908 | ;extension=php_pdo_firebird.dll 909 | ;extension=php_pdo_mysql.dll 910 | ;extension=php_pdo_oci.dll 911 | ;extension=php_pdo_odbc.dll 912 | ;extension=php_pdo_pgsql.dll 913 | ;extension=php_pdo_sqlite.dll 914 | ;extension=php_pgsql.dll 915 | ;extension=php_shmop.dll 916 | 917 | ; The MIBS data available in the PHP distribution must be installed. 918 | ; See http://www.php.net/manual/en/snmp.installation.php 919 | ;extension=php_snmp.dll 920 | 921 | ;extension=php_soap.dll 922 | ;extension=php_sockets.dll 923 | ;extension=php_sqlite3.dll 924 | ;extension=php_tidy.dll 925 | ;extension=php_xmlrpc.dll 926 | ;extension=php_xsl.dll 927 | 928 | ;;;;;;;;;;;;;;;;;;; 929 | ; Module Settings ; 930 | ;;;;;;;;;;;;;;;;;;; 931 | 932 | [CLI Server] 933 | ; Whether the CLI web server uses ANSI color coding in its terminal output. 934 | cli_server.color = On 935 | 936 | [Date] 937 | ; Defines the default timezone used by the date functions 938 | ; http://php.net/date.timezone 939 | date.timezone = Asia/Shanghai 940 | 941 | ; http://php.net/date.default-latitude 942 | ;date.default_latitude = 31.7667 943 | 944 | ; http://php.net/date.default-longitude 945 | ;date.default_longitude = 35.2333 946 | 947 | ; http://php.net/date.sunrise-zenith 948 | ;date.sunrise_zenith = 90.583333 949 | 950 | ; http://php.net/date.sunset-zenith 951 | ;date.sunset_zenith = 90.583333 952 | 953 | [filter] 954 | ; http://php.net/filter.default 955 | ;filter.default = unsafe_raw 956 | 957 | ; http://php.net/filter.default-flags 958 | ;filter.default_flags = 959 | 960 | [iconv] 961 | ; Use of this INI entry is deprecated, use global input_encoding instead. 962 | ; If empty, default_charset or input_encoding or iconv.input_encoding is used. 963 | ; The precedence is: default_charset < intput_encoding < iconv.input_encoding 964 | ;iconv.input_encoding = 965 | 966 | ; Use of this INI entry is deprecated, use global internal_encoding instead. 967 | ; If empty, default_charset or internal_encoding or iconv.internal_encoding is used. 968 | ; The precedence is: default_charset < internal_encoding < iconv.internal_encoding 969 | ;iconv.internal_encoding = 970 | 971 | ; Use of this INI entry is deprecated, use global output_encoding instead. 972 | ; If empty, default_charset or output_encoding or iconv.output_encoding is used. 973 | ; The precedence is: default_charset < output_encoding < iconv.output_encoding 974 | ; To use an output encoding conversion, iconv's output handler must be set 975 | ; otherwise output encoding conversion cannot be performed. 976 | ;iconv.output_encoding = 977 | 978 | [intl] 979 | ;intl.default_locale = 980 | ; This directive allows you to produce PHP errors when some error 981 | ; happens within intl functions. The value is the level of the error produced. 982 | ; Default is 0, which does not produce any errors. 983 | ;intl.error_level = E_WARNING 984 | ;intl.use_exceptions = 0 985 | 986 | [sqlite3] 987 | ;sqlite3.extension_dir = 988 | 989 | [Pcre] 990 | ;PCRE library backtracking limit. 991 | ; http://php.net/pcre.backtrack-limit 992 | ;pcre.backtrack_limit=100000 993 | 994 | ;PCRE library recursion limit. 995 | ;Please note that if you set this value to a high number you may consume all 996 | ;the available process stack and eventually crash PHP (due to reaching the 997 | ;stack size limit imposed by the Operating System). 998 | ; http://php.net/pcre.recursion-limit 999 | ;pcre.recursion_limit=100000 1000 | 1001 | ;Enables or disables JIT compilation of patterns. This requires the PCRE 1002 | ;library to be compiled with JIT support. 1003 | ;pcre.jit=1 1004 | 1005 | [Pdo] 1006 | ; Whether to pool ODBC connections. Can be one of "strict", "relaxed" or "off" 1007 | ; http://php.net/pdo-odbc.connection-pooling 1008 | ;pdo_odbc.connection_pooling=strict 1009 | 1010 | ;pdo_odbc.db2_instance_name 1011 | 1012 | [Pdo_mysql] 1013 | ; If mysqlnd is used: Number of cache slots for the internal result set cache 1014 | ; http://php.net/pdo_mysql.cache_size 1015 | pdo_mysql.cache_size = 2000 1016 | 1017 | ; Default socket name for local MySQL connects. If empty, uses the built-in 1018 | ; MySQL defaults. 1019 | ; http://php.net/pdo_mysql.default-socket 1020 | pdo_mysql.default_socket= 1021 | 1022 | [Phar] 1023 | ; http://php.net/phar.readonly 1024 | ;phar.readonly = On 1025 | 1026 | ; http://php.net/phar.require-hash 1027 | ;phar.require_hash = On 1028 | 1029 | ;phar.cache_list = 1030 | 1031 | [mail function] 1032 | ; For Win32 only. 1033 | ; http://php.net/smtp 1034 | SMTP = localhost 1035 | ; http://php.net/smtp-port 1036 | smtp_port = 25 1037 | 1038 | ; For Win32 only. 1039 | ; http://php.net/sendmail-from 1040 | ;sendmail_from = me@example.com 1041 | 1042 | ; For Unix only. You may supply arguments as well (default: "sendmail -t -i"). 1043 | ; http://php.net/sendmail-path 1044 | ;sendmail_path = 1045 | 1046 | ; Force the addition of the specified parameters to be passed as extra parameters 1047 | ; to the sendmail binary. These parameters will always replace the value of 1048 | ; the 5th parameter to mail(). 1049 | ;mail.force_extra_parameters = 1050 | 1051 | ; Add X-PHP-Originating-Script: that will include uid of the script followed by the filename 1052 | mail.add_x_header = On 1053 | 1054 | ; The path to a log file that will log all mail() calls. Log entries include 1055 | ; the full path of the script, line number, To address and headers. 1056 | ;mail.log = 1057 | ; Log mail to syslog (Event Log on Windows). 1058 | ;mail.log = syslog 1059 | 1060 | [ODBC] 1061 | ; http://php.net/odbc.default-db 1062 | ;odbc.default_db = Not yet implemented 1063 | 1064 | ; http://php.net/odbc.default-user 1065 | ;odbc.default_user = Not yet implemented 1066 | 1067 | ; http://php.net/odbc.default-pw 1068 | ;odbc.default_pw = Not yet implemented 1069 | 1070 | ; Controls the ODBC cursor model. 1071 | ; Default: SQL_CURSOR_STATIC (default). 1072 | ;odbc.default_cursortype 1073 | 1074 | ; Allow or prevent persistent links. 1075 | ; http://php.net/odbc.allow-persistent 1076 | odbc.allow_persistent = On 1077 | 1078 | ; Check that a connection is still valid before reuse. 1079 | ; http://php.net/odbc.check-persistent 1080 | odbc.check_persistent = On 1081 | 1082 | ; Maximum number of persistent links. -1 means no limit. 1083 | ; http://php.net/odbc.max-persistent 1084 | odbc.max_persistent = -1 1085 | 1086 | ; Maximum number of links (persistent + non-persistent). -1 means no limit. 1087 | ; http://php.net/odbc.max-links 1088 | odbc.max_links = -1 1089 | 1090 | ; Handling of LONG fields. Returns number of bytes to variables. 0 means 1091 | ; passthru. 1092 | ; http://php.net/odbc.defaultlrl 1093 | odbc.defaultlrl = 4096 1094 | 1095 | ; Handling of binary data. 0 means passthru, 1 return as is, 2 convert to char. 1096 | ; See the documentation on odbc_binmode and odbc_longreadlen for an explanation 1097 | ; of odbc.defaultlrl and odbc.defaultbinmode 1098 | ; http://php.net/odbc.defaultbinmode 1099 | odbc.defaultbinmode = 1 1100 | 1101 | ;birdstep.max_links = -1 1102 | 1103 | [Interbase] 1104 | ; Allow or prevent persistent links. 1105 | ibase.allow_persistent = 1 1106 | 1107 | ; Maximum number of persistent links. -1 means no limit. 1108 | ibase.max_persistent = -1 1109 | 1110 | ; Maximum number of links (persistent + non-persistent). -1 means no limit. 1111 | ibase.max_links = -1 1112 | 1113 | ; Default database name for ibase_connect(). 1114 | ;ibase.default_db = 1115 | 1116 | ; Default username for ibase_connect(). 1117 | ;ibase.default_user = 1118 | 1119 | ; Default password for ibase_connect(). 1120 | ;ibase.default_password = 1121 | 1122 | ; Default charset for ibase_connect(). 1123 | ;ibase.default_charset = 1124 | 1125 | ; Default timestamp format. 1126 | ibase.timestampformat = "%Y-%m-%d %H:%M:%S" 1127 | 1128 | ; Default date format. 1129 | ibase.dateformat = "%Y-%m-%d" 1130 | 1131 | ; Default time format. 1132 | ibase.timeformat = "%H:%M:%S" 1133 | 1134 | [MySQLi] 1135 | 1136 | ; Maximum number of persistent links. -1 means no limit. 1137 | ; http://php.net/mysqli.max-persistent 1138 | mysqli.max_persistent = -1 1139 | 1140 | ; Allow accessing, from PHP's perspective, local files with LOAD DATA statements 1141 | ; http://php.net/mysqli.allow_local_infile 1142 | ;mysqli.allow_local_infile = On 1143 | 1144 | ; Allow or prevent persistent links. 1145 | ; http://php.net/mysqli.allow-persistent 1146 | mysqli.allow_persistent = On 1147 | 1148 | ; Maximum number of links. -1 means no limit. 1149 | ; http://php.net/mysqli.max-links 1150 | mysqli.max_links = -1 1151 | 1152 | ; If mysqlnd is used: Number of cache slots for the internal result set cache 1153 | ; http://php.net/mysqli.cache_size 1154 | mysqli.cache_size = 2000 1155 | 1156 | ; Default port number for mysqli_connect(). If unset, mysqli_connect() will use 1157 | ; the $MYSQL_TCP_PORT or the mysql-tcp entry in /etc/services or the 1158 | ; compile-time value defined MYSQL_PORT (in that order). Win32 will only look 1159 | ; at MYSQL_PORT. 1160 | ; http://php.net/mysqli.default-port 1161 | mysqli.default_port = 3306 1162 | 1163 | ; Default socket name for local MySQL connects. If empty, uses the built-in 1164 | ; MySQL defaults. 1165 | ; http://php.net/mysqli.default-socket 1166 | mysqli.default_socket = 1167 | 1168 | ; Default host for mysql_connect() (doesn't apply in safe mode). 1169 | ; http://php.net/mysqli.default-host 1170 | mysqli.default_host = 1171 | 1172 | ; Default user for mysql_connect() (doesn't apply in safe mode). 1173 | ; http://php.net/mysqli.default-user 1174 | mysqli.default_user = 1175 | 1176 | ; Default password for mysqli_connect() (doesn't apply in safe mode). 1177 | ; Note that this is generally a *bad* idea to store passwords in this file. 1178 | ; *Any* user with PHP access can run 'echo get_cfg_var("mysqli.default_pw") 1179 | ; and reveal this password! And of course, any users with read access to this 1180 | ; file will be able to reveal the password as well. 1181 | ; http://php.net/mysqli.default-pw 1182 | mysqli.default_pw = 1183 | 1184 | ; Allow or prevent reconnect 1185 | mysqli.reconnect = Off 1186 | 1187 | [mysqlnd] 1188 | ; Enable / Disable collection of general statistics by mysqlnd which can be 1189 | ; used to tune and monitor MySQL operations. 1190 | ; http://php.net/mysqlnd.collect_statistics 1191 | mysqlnd.collect_statistics = On 1192 | 1193 | ; Enable / Disable collection of memory usage statistics by mysqlnd which can be 1194 | ; used to tune and monitor MySQL operations. 1195 | ; http://php.net/mysqlnd.collect_memory_statistics 1196 | mysqlnd.collect_memory_statistics = Off 1197 | 1198 | ; Records communication from all extensions using mysqlnd to the specified log 1199 | ; file. 1200 | ; http://php.net/mysqlnd.debug 1201 | ;mysqlnd.debug = 1202 | 1203 | ; Defines which queries will be logged. 1204 | ; http://php.net/mysqlnd.log_mask 1205 | ;mysqlnd.log_mask = 0 1206 | 1207 | ; Default size of the mysqlnd memory pool, which is used by result sets. 1208 | ; http://php.net/mysqlnd.mempool_default_size 1209 | ;mysqlnd.mempool_default_size = 16000 1210 | 1211 | ; Size of a pre-allocated buffer used when sending commands to MySQL in bytes. 1212 | ; http://php.net/mysqlnd.net_cmd_buffer_size 1213 | ;mysqlnd.net_cmd_buffer_size = 2048 1214 | 1215 | ; Size of a pre-allocated buffer used for reading data sent by the server in 1216 | ; bytes. 1217 | ; http://php.net/mysqlnd.net_read_buffer_size 1218 | ;mysqlnd.net_read_buffer_size = 32768 1219 | 1220 | ; Timeout for network requests in seconds. 1221 | ; http://php.net/mysqlnd.net_read_timeout 1222 | ;mysqlnd.net_read_timeout = 31536000 1223 | 1224 | ; SHA-256 Authentication Plugin related. File with the MySQL server public RSA 1225 | ; key. 1226 | ; http://php.net/mysqlnd.sha256_server_public_key 1227 | ;mysqlnd.sha256_server_public_key = 1228 | 1229 | [OCI8] 1230 | 1231 | ; Connection: Enables privileged connections using external 1232 | ; credentials (OCI_SYSOPER, OCI_SYSDBA) 1233 | ; http://php.net/oci8.privileged-connect 1234 | ;oci8.privileged_connect = Off 1235 | 1236 | ; Connection: The maximum number of persistent OCI8 connections per 1237 | ; process. Using -1 means no limit. 1238 | ; http://php.net/oci8.max-persistent 1239 | ;oci8.max_persistent = -1 1240 | 1241 | ; Connection: The maximum number of seconds a process is allowed to 1242 | ; maintain an idle persistent connection. Using -1 means idle 1243 | ; persistent connections will be maintained forever. 1244 | ; http://php.net/oci8.persistent-timeout 1245 | ;oci8.persistent_timeout = -1 1246 | 1247 | ; Connection: The number of seconds that must pass before issuing a 1248 | ; ping during oci_pconnect() to check the connection validity. When 1249 | ; set to 0, each oci_pconnect() will cause a ping. Using -1 disables 1250 | ; pings completely. 1251 | ; http://php.net/oci8.ping-interval 1252 | ;oci8.ping_interval = 60 1253 | 1254 | ; Connection: Set this to a user chosen connection class to be used 1255 | ; for all pooled server requests with Oracle 11g Database Resident 1256 | ; Connection Pooling (DRCP). To use DRCP, this value should be set to 1257 | ; the same string for all web servers running the same application, 1258 | ; the database pool must be configured, and the connection string must 1259 | ; specify to use a pooled server. 1260 | ;oci8.connection_class = 1261 | 1262 | ; High Availability: Using On lets PHP receive Fast Application 1263 | ; Notification (FAN) events generated when a database node fails. The 1264 | ; database must also be configured to post FAN events. 1265 | ;oci8.events = Off 1266 | 1267 | ; Tuning: This option enables statement caching, and specifies how 1268 | ; many statements to cache. Using 0 disables statement caching. 1269 | ; http://php.net/oci8.statement-cache-size 1270 | ;oci8.statement_cache_size = 20 1271 | 1272 | ; Tuning: Enables statement prefetching and sets the default number of 1273 | ; rows that will be fetched automatically after statement execution. 1274 | ; http://php.net/oci8.default-prefetch 1275 | ;oci8.default_prefetch = 100 1276 | 1277 | ; Compatibility. Using On means oci_close() will not close 1278 | ; oci_connect() and oci_new_connect() connections. 1279 | ; http://php.net/oci8.old-oci-close-semantics 1280 | ;oci8.old_oci_close_semantics = Off 1281 | 1282 | [PostgreSQL] 1283 | ; Allow or prevent persistent links. 1284 | ; http://php.net/pgsql.allow-persistent 1285 | pgsql.allow_persistent = On 1286 | 1287 | ; Detect broken persistent links always with pg_pconnect(). 1288 | ; Auto reset feature requires a little overheads. 1289 | ; http://php.net/pgsql.auto-reset-persistent 1290 | pgsql.auto_reset_persistent = Off 1291 | 1292 | ; Maximum number of persistent links. -1 means no limit. 1293 | ; http://php.net/pgsql.max-persistent 1294 | pgsql.max_persistent = -1 1295 | 1296 | ; Maximum number of links (persistent+non persistent). -1 means no limit. 1297 | ; http://php.net/pgsql.max-links 1298 | pgsql.max_links = -1 1299 | 1300 | ; Ignore PostgreSQL backends Notice message or not. 1301 | ; Notice message logging require a little overheads. 1302 | ; http://php.net/pgsql.ignore-notice 1303 | pgsql.ignore_notice = 0 1304 | 1305 | ; Log PostgreSQL backends Notice message or not. 1306 | ; Unless pgsql.ignore_notice=0, module cannot log notice message. 1307 | ; http://php.net/pgsql.log-notice 1308 | pgsql.log_notice = 0 1309 | 1310 | [bcmath] 1311 | ; Number of decimal digits for all bcmath functions. 1312 | ; http://php.net/bcmath.scale 1313 | bcmath.scale = 0 1314 | 1315 | [browscap] 1316 | ; http://php.net/browscap 1317 | ;browscap = extra/browscap.ini 1318 | 1319 | [Session] 1320 | ; Handler used to store/retrieve data. 1321 | ; http://php.net/session.save-handler 1322 | session.save_handler = files 1323 | 1324 | ; Argument passed to save_handler. In the case of files, this is the path 1325 | ; where data files are stored. Note: Windows users have to change this 1326 | ; variable in order to use PHP's session functions. 1327 | ; 1328 | ; The path can be defined as: 1329 | ; 1330 | ; session.save_path = "N;/path" 1331 | ; 1332 | ; where N is an integer. Instead of storing all the session files in 1333 | ; /path, what this will do is use subdirectories N-levels deep, and 1334 | ; store the session data in those directories. This is useful if 1335 | ; your OS has problems with many files in one directory, and is 1336 | ; a more efficient layout for servers that handle many sessions. 1337 | ; 1338 | ; NOTE 1: PHP will not create this directory structure automatically. 1339 | ; You can use the script in the ext/session dir for that purpose. 1340 | ; NOTE 2: See the section on garbage collection below if you choose to 1341 | ; use subdirectories for session storage 1342 | ; 1343 | ; The file storage module creates files using mode 600 by default. 1344 | ; You can change that by using 1345 | ; 1346 | ; session.save_path = "N;MODE;/path" 1347 | ; 1348 | ; where MODE is the octal representation of the mode. Note that this 1349 | ; does not overwrite the process's umask. 1350 | ; http://php.net/session.save-path 1351 | ;session.save_path = "/tmp" 1352 | 1353 | ; Whether to use strict session mode. 1354 | ; Strict session mode does not accept uninitialized session ID and regenerate 1355 | ; session ID if browser sends uninitialized session ID. Strict mode protects 1356 | ; applications from session fixation via session adoption vulnerability. It is 1357 | ; disabled by default for maximum compatibility, but enabling it is encouraged. 1358 | ; https://wiki.php.net/rfc/strict_sessions 1359 | session.use_strict_mode = 0 1360 | 1361 | ; Whether to use cookies. 1362 | ; http://php.net/session.use-cookies 1363 | session.use_cookies = 1 1364 | 1365 | ; http://php.net/session.cookie-secure 1366 | ;session.cookie_secure = 1367 | 1368 | ; This option forces PHP to fetch and use a cookie for storing and maintaining 1369 | ; the session id. We encourage this operation as it's very helpful in combating 1370 | ; session hijacking when not specifying and managing your own session id. It is 1371 | ; not the be-all and end-all of session hijacking defense, but it's a good start. 1372 | ; http://php.net/session.use-only-cookies 1373 | session.use_only_cookies = 1 1374 | 1375 | ; Name of the session (used as cookie name). 1376 | ; http://php.net/session.name 1377 | session.name = PHPSESSID 1378 | 1379 | ; Initialize session on request startup. 1380 | ; http://php.net/session.auto-start 1381 | session.auto_start = 0 1382 | 1383 | ; Lifetime in seconds of cookie or, if 0, until browser is restarted. 1384 | ; http://php.net/session.cookie-lifetime 1385 | session.cookie_lifetime = 0 1386 | 1387 | ; The path for which the cookie is valid. 1388 | ; http://php.net/session.cookie-path 1389 | session.cookie_path = / 1390 | 1391 | ; The domain for which the cookie is valid. 1392 | ; http://php.net/session.cookie-domain 1393 | session.cookie_domain = 1394 | 1395 | ; Whether or not to add the httpOnly flag to the cookie, which makes it inaccessible to browser scripting languages such as JavaScript. 1396 | ; http://php.net/session.cookie-httponly 1397 | session.cookie_httponly = 1398 | 1399 | ; Handler used to serialize data. php is the standard serializer of PHP. 1400 | ; http://php.net/session.serialize-handler 1401 | session.serialize_handler = php 1402 | 1403 | ; Defines the probability that the 'garbage collection' process is started 1404 | ; on every session initialization. The probability is calculated by using 1405 | ; gc_probability/gc_divisor. Where session.gc_probability is the numerator 1406 | ; and gc_divisor is the denominator in the equation. Setting this value to 1 1407 | ; when the session.gc_divisor value is 100 will give you approximately a 1% chance 1408 | ; the gc will run on any give request. 1409 | ; Default Value: 1 1410 | ; Development Value: 1 1411 | ; Production Value: 1 1412 | ; http://php.net/session.gc-probability 1413 | session.gc_probability = 1 1414 | 1415 | ; Defines the probability that the 'garbage collection' process is started on every 1416 | ; session initialization. The probability is calculated by using the following equation: 1417 | ; gc_probability/gc_divisor. Where session.gc_probability is the numerator and 1418 | ; session.gc_divisor is the denominator in the equation. Setting this value to 1 1419 | ; when the session.gc_divisor value is 100 will give you approximately a 1% chance 1420 | ; the gc will run on any give request. Increasing this value to 1000 will give you 1421 | ; a 0.1% chance the gc will run on any give request. For high volume production servers, 1422 | ; this is a more efficient approach. 1423 | ; Default Value: 100 1424 | ; Development Value: 1000 1425 | ; Production Value: 1000 1426 | ; http://php.net/session.gc-divisor 1427 | session.gc_divisor = 1000 1428 | 1429 | ; After this number of seconds, stored data will be seen as 'garbage' and 1430 | ; cleaned up by the garbage collection process. 1431 | ; http://php.net/session.gc-maxlifetime 1432 | session.gc_maxlifetime = 1440 1433 | 1434 | ; NOTE: If you are using the subdirectory option for storing session files 1435 | ; (see session.save_path above), then garbage collection does *not* 1436 | ; happen automatically. You will need to do your own garbage 1437 | ; collection through a shell script, cron entry, or some other method. 1438 | ; For example, the following script would is the equivalent of 1439 | ; setting session.gc_maxlifetime to 1440 (1440 seconds = 24 minutes): 1440 | ; find /path/to/sessions -cmin +24 -type f | xargs rm 1441 | 1442 | ; Check HTTP Referer to invalidate externally stored URLs containing ids. 1443 | ; HTTP_REFERER has to contain this substring for the session to be 1444 | ; considered as valid. 1445 | ; http://php.net/session.referer-check 1446 | session.referer_check = 1447 | 1448 | ; Set to {nocache,private,public,} to determine HTTP caching aspects 1449 | ; or leave this empty to avoid sending anti-caching headers. 1450 | ; http://php.net/session.cache-limiter 1451 | session.cache_limiter = nocache 1452 | 1453 | ; Document expires after n minutes. 1454 | ; http://php.net/session.cache-expire 1455 | session.cache_expire = 180 1456 | 1457 | ; trans sid support is disabled by default. 1458 | ; Use of trans sid may risk your users' security. 1459 | ; Use this option with caution. 1460 | ; - User may send URL contains active session ID 1461 | ; to other person via. email/irc/etc. 1462 | ; - URL that contains active session ID may be stored 1463 | ; in publicly accessible computer. 1464 | ; - User may access your site with the same session ID 1465 | ; always using URL stored in browser's history or bookmarks. 1466 | ; http://php.net/session.use-trans-sid 1467 | session.use_trans_sid = 0 1468 | 1469 | ; Set session ID character length. This value could be between 22 to 256. 1470 | ; Shorter length than default is supported only for compatibility reason. 1471 | ; Users should use 32 or more chars. 1472 | ; http://php.net/session.sid-length 1473 | ; Default Value: 32 1474 | ; Development Value: 26 1475 | ; Production Value: 26 1476 | session.sid_length = 26 1477 | 1478 | ; The URL rewriter will look for URLs in a defined set of HTML tags. 1479 | ;
is special; if you include them here, the rewriter will 1480 | ; add a hidden field with the info which is otherwise appended 1481 | ; to URLs. tag's action attribute URL will not be modified 1482 | ; unless it is specified. 1483 | ; Note that all valid entries require a "=", even if no value follows. 1484 | ; Default Value: "a=href,area=href,frame=src,form=" 1485 | ; Development Value: "a=href,area=href,frame=src,form=" 1486 | ; Production Value: "a=href,area=href,frame=src,form=" 1487 | ; http://php.net/url-rewriter.tags 1488 | session.trans_sid_tags = "a=href,area=href,frame=src,form=" 1489 | 1490 | ; URL rewriter does not rewrite absolute URLs by default. 1491 | ; To enable rewrites for absolute pathes, target hosts must be specified 1492 | ; at RUNTIME. i.e. use ini_set() 1493 | ; tags is special. PHP will check action attribute's URL regardless 1494 | ; of session.trans_sid_tags setting. 1495 | ; If no host is defined, HTTP_HOST will be used for allowed host. 1496 | ; Example value: php.net,www.php.net,wiki.php.net 1497 | ; Use "," for multiple hosts. No spaces are allowed. 1498 | ; Default Value: "" 1499 | ; Development Value: "" 1500 | ; Production Value: "" 1501 | ;session.trans_sid_hosts="" 1502 | 1503 | ; Define how many bits are stored in each character when converting 1504 | ; the binary hash data to something readable. 1505 | ; Possible values: 1506 | ; 4 (4 bits: 0-9, a-f) 1507 | ; 5 (5 bits: 0-9, a-v) 1508 | ; 6 (6 bits: 0-9, a-z, A-Z, "-", ",") 1509 | ; Default Value: 4 1510 | ; Development Value: 5 1511 | ; Production Value: 5 1512 | ; http://php.net/session.hash-bits-per-character 1513 | session.sid_bits_per_character = 5 1514 | 1515 | ; Enable upload progress tracking in $_SESSION 1516 | ; Default Value: On 1517 | ; Development Value: On 1518 | ; Production Value: On 1519 | ; http://php.net/session.upload-progress.enabled 1520 | ;session.upload_progress.enabled = On 1521 | 1522 | ; Cleanup the progress information as soon as all POST data has been read 1523 | ; (i.e. upload completed). 1524 | ; Default Value: On 1525 | ; Development Value: On 1526 | ; Production Value: On 1527 | ; http://php.net/session.upload-progress.cleanup 1528 | ;session.upload_progress.cleanup = On 1529 | 1530 | ; A prefix used for the upload progress key in $_SESSION 1531 | ; Default Value: "upload_progress_" 1532 | ; Development Value: "upload_progress_" 1533 | ; Production Value: "upload_progress_" 1534 | ; http://php.net/session.upload-progress.prefix 1535 | ;session.upload_progress.prefix = "upload_progress_" 1536 | 1537 | ; The index name (concatenated with the prefix) in $_SESSION 1538 | ; containing the upload progress information 1539 | ; Default Value: "PHP_SESSION_UPLOAD_PROGRESS" 1540 | ; Development Value: "PHP_SESSION_UPLOAD_PROGRESS" 1541 | ; Production Value: "PHP_SESSION_UPLOAD_PROGRESS" 1542 | ; http://php.net/session.upload-progress.name 1543 | ;session.upload_progress.name = "PHP_SESSION_UPLOAD_PROGRESS" 1544 | 1545 | ; How frequently the upload progress should be updated. 1546 | ; Given either in percentages (per-file), or in bytes 1547 | ; Default Value: "1%" 1548 | ; Development Value: "1%" 1549 | ; Production Value: "1%" 1550 | ; http://php.net/session.upload-progress.freq 1551 | ;session.upload_progress.freq = "1%" 1552 | 1553 | ; The minimum delay between updates, in seconds 1554 | ; Default Value: 1 1555 | ; Development Value: 1 1556 | ; Production Value: 1 1557 | ; http://php.net/session.upload-progress.min-freq 1558 | ;session.upload_progress.min_freq = "1" 1559 | 1560 | ; Only write session data when session data is changed. Enabled by default. 1561 | ; http://php.net/session.lazy-write 1562 | ;session.lazy_write = On 1563 | 1564 | [Assertion] 1565 | ; Switch whether to compile assertions at all (to have no overhead at run-time) 1566 | ; -1: Do not compile at all 1567 | ; 0: Jump over assertion at run-time 1568 | ; 1: Execute assertions 1569 | ; Changing from or to a negative value is only possible in php.ini! (For turning assertions on and off at run-time, see assert.active, when zend.assertions = 1) 1570 | ; Default Value: 1 1571 | ; Development Value: 1 1572 | ; Production Value: -1 1573 | ; http://php.net/zend.assertions 1574 | zend.assertions = -1 1575 | 1576 | ; Assert(expr); active by default. 1577 | ; http://php.net/assert.active 1578 | ;assert.active = On 1579 | 1580 | ; Throw an AssertationException on failed assertions 1581 | ; http://php.net/assert.exception 1582 | ;assert.exception = On 1583 | 1584 | ; Issue a PHP warning for each failed assertion. (Overridden by assert.exception if active) 1585 | ; http://php.net/assert.warning 1586 | ;assert.warning = On 1587 | 1588 | ; Don't bail out by default. 1589 | ; http://php.net/assert.bail 1590 | ;assert.bail = Off 1591 | 1592 | ; User-function to be called if an assertion fails. 1593 | ; http://php.net/assert.callback 1594 | ;assert.callback = 0 1595 | 1596 | ; Eval the expression with current error_reporting(). Set to true if you want 1597 | ; error_reporting(0) around the eval(). 1598 | ; http://php.net/assert.quiet-eval 1599 | ;assert.quiet_eval = 0 1600 | 1601 | [COM] 1602 | ; path to a file containing GUIDs, IIDs or filenames of files with TypeLibs 1603 | ; http://php.net/com.typelib-file 1604 | ;com.typelib_file = 1605 | 1606 | ; allow Distributed-COM calls 1607 | ; http://php.net/com.allow-dcom 1608 | ;com.allow_dcom = true 1609 | 1610 | ; autoregister constants of a components typlib on com_load() 1611 | ; http://php.net/com.autoregister-typelib 1612 | ;com.autoregister_typelib = true 1613 | 1614 | ; register constants casesensitive 1615 | ; http://php.net/com.autoregister-casesensitive 1616 | ;com.autoregister_casesensitive = false 1617 | 1618 | ; show warnings on duplicate constant registrations 1619 | ; http://php.net/com.autoregister-verbose 1620 | ;com.autoregister_verbose = true 1621 | 1622 | ; The default character set code-page to use when passing strings to and from COM objects. 1623 | ; Default: system ANSI code page 1624 | ;com.code_page= 1625 | 1626 | [mbstring] 1627 | ; language for internal character representation. 1628 | ; This affects mb_send_mail() and mbstring.detect_order. 1629 | ; http://php.net/mbstring.language 1630 | ;mbstring.language = Japanese 1631 | 1632 | ; Use of this INI entry is deprecated, use global internal_encoding instead. 1633 | ; internal/script encoding. 1634 | ; Some encoding cannot work as internal encoding. (e.g. SJIS, BIG5, ISO-2022-*) 1635 | ; If empty, default_charset or internal_encoding or iconv.internal_encoding is used. 1636 | ; The precedence is: default_charset < internal_encoding < iconv.internal_encoding 1637 | ;mbstring.internal_encoding = 1638 | 1639 | ; Use of this INI entry is deprecated, use global input_encoding instead. 1640 | ; http input encoding. 1641 | ; mbstring.encoding_traslation = On is needed to use this setting. 1642 | ; If empty, default_charset or input_encoding or mbstring.input is used. 1643 | ; The precedence is: default_charset < intput_encoding < mbsting.http_input 1644 | ; http://php.net/mbstring.http-input 1645 | ;mbstring.http_input = 1646 | 1647 | ; Use of this INI entry is deprecated, use global output_encoding instead. 1648 | ; http output encoding. 1649 | ; mb_output_handler must be registered as output buffer to function. 1650 | ; If empty, default_charset or output_encoding or mbstring.http_output is used. 1651 | ; The precedence is: default_charset < output_encoding < mbstring.http_output 1652 | ; To use an output encoding conversion, mbstring's output handler must be set 1653 | ; otherwise output encoding conversion cannot be performed. 1654 | ; http://php.net/mbstring.http-output 1655 | ;mbstring.http_output = 1656 | 1657 | ; enable automatic encoding translation according to 1658 | ; mbstring.internal_encoding setting. Input chars are 1659 | ; converted to internal encoding by setting this to On. 1660 | ; Note: Do _not_ use automatic encoding translation for 1661 | ; portable libs/applications. 1662 | ; http://php.net/mbstring.encoding-translation 1663 | ;mbstring.encoding_translation = Off 1664 | 1665 | ; automatic encoding detection order. 1666 | ; "auto" detect order is changed according to mbstring.language 1667 | ; http://php.net/mbstring.detect-order 1668 | ;mbstring.detect_order = auto 1669 | 1670 | ; substitute_character used when character cannot be converted 1671 | ; one from another 1672 | ; http://php.net/mbstring.substitute-character 1673 | ;mbstring.substitute_character = none 1674 | 1675 | ; overload(replace) single byte functions by mbstring functions. 1676 | ; mail(), ereg(), etc are overloaded by mb_send_mail(), mb_ereg(), 1677 | ; etc. Possible values are 0,1,2,4 or combination of them. 1678 | ; For example, 7 for overload everything. 1679 | ; 0: No overload 1680 | ; 1: Overload mail() function 1681 | ; 2: Overload str*() functions 1682 | ; 4: Overload ereg*() functions 1683 | ; http://php.net/mbstring.func-overload 1684 | ;mbstring.func_overload = 0 1685 | 1686 | ; enable strict encoding detection. 1687 | ; Default: Off 1688 | ;mbstring.strict_detection = On 1689 | 1690 | ; This directive specifies the regex pattern of content types for which mb_output_handler() 1691 | ; is activated. 1692 | ; Default: mbstring.http_output_conv_mimetype=^(text/|application/xhtml\+xml) 1693 | ;mbstring.http_output_conv_mimetype= 1694 | 1695 | [gd] 1696 | ; Tell the jpeg decode to ignore warnings and try to create 1697 | ; a gd image. The warning will then be displayed as notices 1698 | ; disabled by default 1699 | ; http://php.net/gd.jpeg-ignore-warning 1700 | ;gd.jpeg_ignore_warning = 1 1701 | 1702 | [exif] 1703 | ; Exif UNICODE user comments are handled as UCS-2BE/UCS-2LE and JIS as JIS. 1704 | ; With mbstring support this will automatically be converted into the encoding 1705 | ; given by corresponding encode setting. When empty mbstring.internal_encoding 1706 | ; is used. For the decode settings you can distinguish between motorola and 1707 | ; intel byte order. A decode setting cannot be empty. 1708 | ; http://php.net/exif.encode-unicode 1709 | ;exif.encode_unicode = ISO-8859-15 1710 | 1711 | ; http://php.net/exif.decode-unicode-motorola 1712 | ;exif.decode_unicode_motorola = UCS-2BE 1713 | 1714 | ; http://php.net/exif.decode-unicode-intel 1715 | ;exif.decode_unicode_intel = UCS-2LE 1716 | 1717 | ; http://php.net/exif.encode-jis 1718 | ;exif.encode_jis = 1719 | 1720 | ; http://php.net/exif.decode-jis-motorola 1721 | ;exif.decode_jis_motorola = JIS 1722 | 1723 | ; http://php.net/exif.decode-jis-intel 1724 | ;exif.decode_jis_intel = JIS 1725 | 1726 | [Tidy] 1727 | ; The path to a default tidy configuration file to use when using tidy 1728 | ; http://php.net/tidy.default-config 1729 | ;tidy.default_config = /usr/local/lib/php/default.tcfg 1730 | 1731 | ; Should tidy clean and repair output automatically? 1732 | ; WARNING: Do not use this option if you are generating non-html content 1733 | ; such as dynamic images 1734 | ; http://php.net/tidy.clean-output 1735 | tidy.clean_output = Off 1736 | 1737 | [soap] 1738 | ; Enables or disables WSDL caching feature. 1739 | ; http://php.net/soap.wsdl-cache-enabled 1740 | soap.wsdl_cache_enabled=1 1741 | 1742 | ; Sets the directory name where SOAP extension will put cache files. 1743 | ; http://php.net/soap.wsdl-cache-dir 1744 | soap.wsdl_cache_dir="/tmp" 1745 | 1746 | ; (time to live) Sets the number of second while cached file will be used 1747 | ; instead of original one. 1748 | ; http://php.net/soap.wsdl-cache-ttl 1749 | soap.wsdl_cache_ttl=86400 1750 | 1751 | ; Sets the size of the cache limit. (Max. number of WSDL files to cache) 1752 | soap.wsdl_cache_limit = 5 1753 | 1754 | [sysvshm] 1755 | ; A default size of the shared memory segment 1756 | ;sysvshm.init_mem = 10000 1757 | 1758 | [ldap] 1759 | ; Sets the maximum number of open links or -1 for unlimited. 1760 | ldap.max_links = -1 1761 | 1762 | [dba] 1763 | ;dba.default_handler= 1764 | 1765 | [opcache] 1766 | ; Determines if Zend OPCache is enabled 1767 | ;opcache.enable=1 1768 | 1769 | ; Determines if Zend OPCache is enabled for the CLI version of PHP 1770 | ;opcache.enable_cli=1 1771 | 1772 | ; The OPcache shared memory storage size. 1773 | ;opcache.memory_consumption=128 1774 | 1775 | ; The amount of memory for interned strings in Mbytes. 1776 | ;opcache.interned_strings_buffer=8 1777 | 1778 | ; The maximum number of keys (scripts) in the OPcache hash table. 1779 | ; Only numbers between 200 and 1000000 are allowed. 1780 | ;opcache.max_accelerated_files=10000 1781 | 1782 | ; The maximum percentage of "wasted" memory until a restart is scheduled. 1783 | ;opcache.max_wasted_percentage=5 1784 | 1785 | ; When this directive is enabled, the OPcache appends the current working 1786 | ; directory to the script key, thus eliminating possible collisions between 1787 | ; files with the same name (basename). Disabling the directive improves 1788 | ; performance, but may break existing applications. 1789 | ;opcache.use_cwd=1 1790 | 1791 | ; When disabled, you must reset the OPcache manually or restart the 1792 | ; webserver for changes to the filesystem to take effect. 1793 | ;opcache.validate_timestamps=1 1794 | 1795 | ; How often (in seconds) to check file timestamps for changes to the shared 1796 | ; memory storage allocation. ("1" means validate once per second, but only 1797 | ; once per request. "0" means always validate) 1798 | ;opcache.revalidate_freq=2 1799 | 1800 | ; Enables or disables file search in include_path optimization 1801 | ;opcache.revalidate_path=0 1802 | 1803 | ; If disabled, all PHPDoc comments are dropped from the code to reduce the 1804 | ; size of the optimized code. 1805 | ;opcache.save_comments=1 1806 | 1807 | ; If enabled, a fast shutdown sequence is used for the accelerated code 1808 | ; Depending on the used Memory Manager this may cause some incompatibilities. 1809 | ;opcache.fast_shutdown=0 1810 | 1811 | ; Allow file existence override (file_exists, etc.) performance feature. 1812 | ;opcache.enable_file_override=0 1813 | 1814 | ; A bitmask, where each bit enables or disables the appropriate OPcache 1815 | ; passes 1816 | ;opcache.optimization_level=0xffffffff 1817 | 1818 | ;opcache.inherited_hack=1 1819 | ;opcache.dups_fix=0 1820 | 1821 | ; The location of the OPcache blacklist file (wildcards allowed). 1822 | ; Each OPcache blacklist file is a text file that holds the names of files 1823 | ; that should not be accelerated. The file format is to add each filename 1824 | ; to a new line. The filename may be a full path or just a file prefix 1825 | ; (i.e., /var/www/x blacklists all the files and directories in /var/www 1826 | ; that start with 'x'). Line starting with a ; are ignored (comments). 1827 | ;opcache.blacklist_filename= 1828 | 1829 | ; Allows exclusion of large files from being cached. By default all files 1830 | ; are cached. 1831 | ;opcache.max_file_size=0 1832 | 1833 | ; Check the cache checksum each N requests. 1834 | ; The default value of "0" means that the checks are disabled. 1835 | ;opcache.consistency_checks=0 1836 | 1837 | ; How long to wait (in seconds) for a scheduled restart to begin if the cache 1838 | ; is not being accessed. 1839 | ;opcache.force_restart_timeout=180 1840 | 1841 | ; OPcache error_log file name. Empty string assumes "stderr". 1842 | ;opcache.error_log= 1843 | 1844 | ; All OPcache errors go to the Web server log. 1845 | ; By default, only fatal errors (level 0) or errors (level 1) are logged. 1846 | ; You can also enable warnings (level 2), info messages (level 3) or 1847 | ; debug messages (level 4). 1848 | ;opcache.log_verbosity_level=1 1849 | 1850 | ; Preferred Shared Memory back-end. Leave empty and let the system decide. 1851 | ;opcache.preferred_memory_model= 1852 | 1853 | ; Protect the shared memory from unexpected writing during script execution. 1854 | ; Useful for internal debugging only. 1855 | ;opcache.protect_memory=0 1856 | 1857 | ; Allows calling OPcache API functions only from PHP scripts which path is 1858 | ; started from specified string. The default "" means no restriction 1859 | ;opcache.restrict_api= 1860 | 1861 | ; Mapping base of shared memory segments (for Windows only). All the PHP 1862 | ; processes have to map shared memory into the same address space. This 1863 | ; directive allows to manually fix the "Unable to reattach to base address" 1864 | ; errors. 1865 | ;opcache.mmap_base= 1866 | 1867 | ; Enables and sets the second level cache directory. 1868 | ; It should improve performance when SHM memory is full, at server restart or 1869 | ; SHM reset. The default "" disables file based caching. 1870 | ;opcache.file_cache= 1871 | 1872 | ; Enables or disables opcode caching in shared memory. 1873 | ;opcache.file_cache_only=0 1874 | 1875 | ; Enables or disables checksum validation when script loaded from file cache. 1876 | ;opcache.file_cache_consistency_checks=1 1877 | 1878 | ; Implies opcache.file_cache_only=1 for a certain process that failed to 1879 | ; reattach to the shared memory (for Windows only). Explicitly enabled file 1880 | ; cache is required. 1881 | ;opcache.file_cache_fallback=1 1882 | 1883 | ; Enables or disables copying of PHP code (text segment) into HUGE PAGES. 1884 | ; This should improve performance, but requires appropriate OS configuration. 1885 | ;opcache.huge_code_pages=1 1886 | 1887 | ; Validate cached file permissions. 1888 | ;opcache.validate_permission=0 1889 | 1890 | ; Prevent name collisions in chroot'ed environment. 1891 | ;opcache.validate_root=0 1892 | 1893 | [curl] 1894 | ; A default value for the CURLOPT_CAINFO option. This is required to be an 1895 | ; absolute path. 1896 | ;curl.cainfo = 1897 | 1898 | [openssl] 1899 | ; The location of a Certificate Authority (CA) file on the local filesystem 1900 | ; to use when verifying the identity of SSL/TLS peers. Most users should 1901 | ; not specify a value for this directive as PHP will attempt to use the 1902 | ; OS-managed cert stores in its absence. If specified, this value may still 1903 | ; be overridden on a per-stream basis via the "cafile" SSL stream context 1904 | ; option. 1905 | ;openssl.cafile= 1906 | 1907 | ; If openssl.cafile is not specified or if the CA file is not found, the 1908 | ; directory pointed to by openssl.capath is searched for a suitable 1909 | ; certificate. This value must be a correctly hashed certificate directory. 1910 | ; Most users should not specify a value for this directive as PHP will 1911 | ; attempt to use the OS-managed cert stores in its absence. If specified, 1912 | ; this value may still be overridden on a per-stream basis via the "capath" 1913 | ; SSL stream context option. 1914 | ;openssl.capath= 1915 | 1916 | ; Local Variables: 1917 | ; tab-width: 4 1918 | ; End: 1919 | 1920 | [XDebug] 1921 | ;xdebug.remote_enable = 1 1922 | ;xdebug.remote_handler = "dbgp" 1923 | ; Set to host.docker.internal on Mac and Windows, otherwise, set to host real ip 1924 | ;xdebug.remote_host = host.docker.internal 1925 | ;xdebug.remote_port = 9000 1926 | ;xdebug.remote_log = /var/log/php/xdebug.log 1927 | 1928 | [mongodb] 1929 | extension=mongodb.so 1930 | 1931 | [tideways] 1932 | extension=tideways_xhprof.so 1933 | tideways.auto_prepend_library=0 1934 | tideways.sample_rate=100 1935 | 1936 | [xhprof] 1937 | extension=xhprof.so 1938 | xhprof.output_dir="/var/log/xhprof" 1939 | 1940 | SERVER_ENV=develop 1941 | -------------------------------------------------------------------------------- /conf/redis.conf: -------------------------------------------------------------------------------- 1 | # Redis configuration file example. 2 | # 3 | # Note that in order to read the configuration file, Redis must be 4 | # started with the file path as first argument: 5 | # 6 | # ./redis-server /path/to/redis.conf 7 | 8 | # Note on units: when memory size is needed, it is possible to specify 9 | # it in the usual form of 1k 5GB 4M and so forth: 10 | # 11 | # 1k => 1000 bytes 12 | # 1kb => 1024 bytes 13 | # 1m => 1000000 bytes 14 | # 1mb => 1024*1024 bytes 15 | # 1g => 1000000000 bytes 16 | # 1gb => 1024*1024*1024 bytes 17 | # 18 | # units are case insensitive so 1GB 1Gb 1gB are all the same. 19 | 20 | ################################## INCLUDES ################################### 21 | 22 | # Include one or more other config files here. This is useful if you 23 | # have a standard template that goes to all Redis servers but also need 24 | # to customize a few per-server settings. Include files can include 25 | # other files, so use this wisely. 26 | # 27 | # Notice option "include" won't be rewritten by command "CONFIG REWRITE" 28 | # from admin or Redis Sentinel. Since Redis always uses the last processed 29 | # line as value of a configuration directive, you'd better put includes 30 | # at the beginning of this file to avoid overwriting config change at runtime. 31 | # 32 | # If instead you are interested in using includes to override configuration 33 | # options, it is better to use include as the last line. 34 | # 35 | # include /path/to/local.conf 36 | # include /path/to/other.conf 37 | 38 | ################################## MODULES ##################################### 39 | 40 | # Load modules at startup. If the server is not able to load modules 41 | # it will abort. It is possible to use multiple loadmodule directives. 42 | # 43 | # loadmodule /path/to/my_module.so 44 | # loadmodule /path/to/other_module.so 45 | 46 | ################################## NETWORK ##################################### 47 | 48 | # By default, if no "bind" configuration directive is specified, Redis listens 49 | # for connections from all the network interfaces available on the server. 50 | # It is possible to listen to just one or multiple selected interfaces using 51 | # the "bind" configuration directive, followed by one or more IP addresses. 52 | # 53 | # Examples: 54 | # 55 | # bind 192.168.1.100 10.0.0.1 56 | # bind 127.0.0.1 ::1 57 | # 58 | # ~~~ WARNING ~~~ If the computer running Redis is directly exposed to the 59 | # internet, binding to all the interfaces is dangerous and will expose the 60 | # instance to everybody on the internet. So by default we uncomment the 61 | # following bind directive, that will force Redis to listen only into 62 | # the IPv4 loopback interface address (this means Redis will be able to 63 | # accept connections only from clients running into the same computer it 64 | # is running). 65 | # 66 | # IF YOU ARE SURE YOU WANT YOUR INSTANCE TO LISTEN TO ALL THE INTERFACES 67 | # JUST COMMENT THE FOLLOWING LINE. 68 | # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 69 | bind 0.0.0.0 70 | 71 | # Protected mode is a layer of security protection, in order to avoid that 72 | # Redis instances left open on the internet are accessed and exploited. 73 | # 74 | # When protected mode is on and if: 75 | # 76 | # 1) The server is not binding explicitly to a set of addresses using the 77 | # "bind" directive. 78 | # 2) No password is configured. 79 | # 80 | # The server only accepts connections from clients connecting from the 81 | # IPv4 and IPv6 loopback addresses 127.0.0.1 and ::1, and from Unix domain 82 | # sockets. 83 | # 84 | # By default protected mode is enabled. You should disable it only if 85 | # you are sure you want clients from other hosts to connect to Redis 86 | # even if no authentication is configured, nor a specific set of interfaces 87 | # are explicitly listed using the "bind" directive. 88 | protected-mode yes 89 | 90 | # Accept connections on the specified port, default is 6379 (IANA #815344). 91 | # If port 0 is specified Redis will not listen on a TCP socket. 92 | port 6379 93 | 94 | # TCP listen() backlog. 95 | # 96 | # In high requests-per-second environments you need an high backlog in order 97 | # to avoid slow clients connections issues. Note that the Linux kernel 98 | # will silently truncate it to the value of /proc/sys/net/core/somaxconn so 99 | # make sure to raise both the value of somaxconn and tcp_max_syn_backlog 100 | # in order to get the desired effect. 101 | tcp-backlog 511 102 | 103 | # Unix socket. 104 | # 105 | # Specify the path for the Unix socket that will be used to listen for 106 | # incoming connections. There is no default, so Redis will not listen 107 | # on a unix socket when not specified. 108 | # 109 | # unixsocket /tmp/redis.sock 110 | # unixsocketperm 700 111 | 112 | # Close the connection after a client is idle for N seconds (0 to disable) 113 | timeout 0 114 | 115 | # TCP keepalive. 116 | # 117 | # If non-zero, use SO_KEEPALIVE to send TCP ACKs to clients in absence 118 | # of communication. This is useful for two reasons: 119 | # 120 | # 1) Detect dead peers. 121 | # 2) Take the connection alive from the point of view of network 122 | # equipment in the middle. 123 | # 124 | # On Linux, the specified value (in seconds) is the period used to send ACKs. 125 | # Note that to close the connection the double of the time is needed. 126 | # On other kernels the period depends on the kernel configuration. 127 | # 128 | # A reasonable value for this option is 300 seconds, which is the new 129 | # Redis default starting with Redis 3.2.1. 130 | tcp-keepalive 300 131 | 132 | ################################# GENERAL ##################################### 133 | 134 | # By default Redis does not run as a daemon. Use 'yes' if you need it. 135 | # Note that Redis will write a pid file in /var/run/redis.pid when daemonized. 136 | daemonize no 137 | 138 | # If you run Redis from upstart or systemd, Redis can interact with your 139 | # supervision tree. Options: 140 | # supervised no - no supervision interaction 141 | # supervised upstart - signal upstart by putting Redis into SIGSTOP mode 142 | # supervised systemd - signal systemd by writing READY=1 to $NOTIFY_SOCKET 143 | # supervised auto - detect upstart or systemd method based on 144 | # UPSTART_JOB or NOTIFY_SOCKET environment variables 145 | # Note: these supervision methods only signal "process is ready." 146 | # They do not enable continuous liveness pings back to your supervisor. 147 | supervised no 148 | 149 | # If a pid file is specified, Redis writes it where specified at startup 150 | # and removes it at exit. 151 | # 152 | # When the server runs non daemonized, no pid file is created if none is 153 | # specified in the configuration. When the server is daemonized, the pid file 154 | # is used even if not specified, defaulting to "/var/run/redis.pid". 155 | # 156 | # Creating a pid file is best effort: if Redis is not able to create it 157 | # nothing bad happens, the server will start and run normally. 158 | pidfile /var/run/redis_6379.pid 159 | 160 | # Specify the server verbosity level. 161 | # This can be one of: 162 | # debug (a lot of information, useful for development/testing) 163 | # verbose (many rarely useful info, but not a mess like the debug level) 164 | # notice (moderately verbose, what you want in production probably) 165 | # warning (only very important / critical messages are logged) 166 | loglevel notice 167 | 168 | # Specify the log file name. Also the empty string can be used to force 169 | # Redis to log on the standard output. Note that if you use standard 170 | # output for logging but daemonize, logs will be sent to /dev/null 171 | logfile "" 172 | 173 | # To enable logging to the system logger, just set 'syslog-enabled' to yes, 174 | # and optionally update the other syslog parameters to suit your needs. 175 | # syslog-enabled no 176 | 177 | # Specify the syslog identity. 178 | # syslog-ident redis 179 | 180 | # Specify the syslog facility. Must be USER or between LOCAL0-LOCAL7. 181 | # syslog-facility local0 182 | 183 | # Set the number of databases. The default database is DB 0, you can select 184 | # a different one on a per-connection basis using SELECT where 185 | # dbid is a number between 0 and 'databases'-1 186 | databases 16 187 | 188 | # By default Redis shows an ASCII art logo only when started to log to the 189 | # standard output and if the standard output is a TTY. Basically this means 190 | # that normally a logo is displayed only in interactive sessions. 191 | # 192 | # However it is possible to force the pre-4.0 behavior and always show a 193 | # ASCII art logo in startup logs by setting the following option to yes. 194 | always-show-logo yes 195 | 196 | ################################ SNAPSHOTTING ################################ 197 | # 198 | # Save the DB on disk: 199 | # 200 | # save 201 | # 202 | # Will save the DB if both the given number of seconds and the given 203 | # number of write operations against the DB occurred. 204 | # 205 | # In the example below the behaviour will be to save: 206 | # after 900 sec (15 min) if at least 1 key changed 207 | # after 300 sec (5 min) if at least 10 keys changed 208 | # after 60 sec if at least 10000 keys changed 209 | # 210 | # Note: you can disable saving completely by commenting out all "save" lines. 211 | # 212 | # It is also possible to remove all the previously configured save 213 | # points by adding a save directive with a single empty string argument 214 | # like in the following example: 215 | # 216 | # save "" 217 | 218 | save 900 1 219 | save 300 10 220 | save 60 10000 221 | 222 | # By default Redis will stop accepting writes if RDB snapshots are enabled 223 | # (at least one save point) and the latest background save failed. 224 | # This will make the user aware (in a hard way) that data is not persisting 225 | # on disk properly, otherwise chances are that no one will notice and some 226 | # disaster will happen. 227 | # 228 | # If the background saving process will start working again Redis will 229 | # automatically allow writes again. 230 | # 231 | # However if you have setup your proper monitoring of the Redis server 232 | # and persistence, you may want to disable this feature so that Redis will 233 | # continue to work as usual even if there are problems with disk, 234 | # permissions, and so forth. 235 | stop-writes-on-bgsave-error yes 236 | 237 | # Compress string objects using LZF when dump .rdb databases? 238 | # For default that's set to 'yes' as it's almost always a win. 239 | # If you want to save some CPU in the saving child set it to 'no' but 240 | # the dataset will likely be bigger if you have compressible values or keys. 241 | rdbcompression yes 242 | 243 | # Since version 5 of RDB a CRC64 checksum is placed at the end of the file. 244 | # This makes the format more resistant to corruption but there is a performance 245 | # hit to pay (around 10%) when saving and loading RDB files, so you can disable it 246 | # for maximum performances. 247 | # 248 | # RDB files created with checksum disabled have a checksum of zero that will 249 | # tell the loading code to skip the check. 250 | rdbchecksum yes 251 | 252 | # The filename where to dump the DB 253 | dbfilename dump.rdb 254 | 255 | # The working directory. 256 | # 257 | # The DB will be written inside this directory, with the filename specified 258 | # above using the 'dbfilename' configuration directive. 259 | # 260 | # The Append Only File will also be created inside this directory. 261 | # 262 | # Note that you must specify a directory here, not a file name. 263 | dir ./ 264 | 265 | ################################# REPLICATION ################################# 266 | 267 | # Master-Replica replication. Use replicaof to make a Redis instance a copy of 268 | # another Redis server. A few things to understand ASAP about Redis replication. 269 | # 270 | # +------------------+ +---------------+ 271 | # | Master | ---> | Replica | 272 | # | (receive writes) | | (exact copy) | 273 | # +------------------+ +---------------+ 274 | # 275 | # 1) Redis replication is asynchronous, but you can configure a master to 276 | # stop accepting writes if it appears to be not connected with at least 277 | # a given number of replicas. 278 | # 2) Redis replicas are able to perform a partial resynchronization with the 279 | # master if the replication link is lost for a relatively small amount of 280 | # time. You may want to configure the replication backlog size (see the next 281 | # sections of this file) with a sensible value depending on your needs. 282 | # 3) Replication is automatic and does not need user intervention. After a 283 | # network partition replicas automatically try to reconnect to masters 284 | # and resynchronize with them. 285 | # 286 | # replicaof 287 | 288 | # If the master is password protected (using the "requirepass" configuration 289 | # directive below) it is possible to tell the replica to authenticate before 290 | # starting the replication synchronization process, otherwise the master will 291 | # refuse the replica request. 292 | # 293 | # masterauth 294 | 295 | # When a replica loses its connection with the master, or when the replication 296 | # is still in progress, the replica can act in two different ways: 297 | # 298 | # 1) if replica-serve-stale-data is set to 'yes' (the default) the replica will 299 | # still reply to client requests, possibly with out of date data, or the 300 | # data set may just be empty if this is the first synchronization. 301 | # 302 | # 2) if replica-serve-stale-data is set to 'no' the replica will reply with 303 | # an error "SYNC with master in progress" to all the kind of commands 304 | # but to INFO, replicaOF, AUTH, PING, SHUTDOWN, REPLCONF, ROLE, CONFIG, 305 | # SUBSCRIBE, UNSUBSCRIBE, PSUBSCRIBE, PUNSUBSCRIBE, PUBLISH, PUBSUB, 306 | # COMMAND, POST, HOST: and LATENCY. 307 | # 308 | replica-serve-stale-data yes 309 | 310 | # You can configure a replica instance to accept writes or not. Writing against 311 | # a replica instance may be useful to store some ephemeral data (because data 312 | # written on a replica will be easily deleted after resync with the master) but 313 | # may also cause problems if clients are writing to it because of a 314 | # misconfiguration. 315 | # 316 | # Since Redis 2.6 by default replicas are read-only. 317 | # 318 | # Note: read only replicas are not designed to be exposed to untrusted clients 319 | # on the internet. It's just a protection layer against misuse of the instance. 320 | # Still a read only replica exports by default all the administrative commands 321 | # such as CONFIG, DEBUG, and so forth. To a limited extent you can improve 322 | # security of read only replicas using 'rename-command' to shadow all the 323 | # administrative / dangerous commands. 324 | replica-read-only yes 325 | 326 | # Replication SYNC strategy: disk or socket. 327 | # 328 | # ------------------------------------------------------- 329 | # WARNING: DISKLESS REPLICATION IS EXPERIMENTAL CURRENTLY 330 | # ------------------------------------------------------- 331 | # 332 | # New replicas and reconnecting replicas that are not able to continue the replication 333 | # process just receiving differences, need to do what is called a "full 334 | # synchronization". An RDB file is transmitted from the master to the replicas. 335 | # The transmission can happen in two different ways: 336 | # 337 | # 1) Disk-backed: The Redis master creates a new process that writes the RDB 338 | # file on disk. Later the file is transferred by the parent 339 | # process to the replicas incrementally. 340 | # 2) Diskless: The Redis master creates a new process that directly writes the 341 | # RDB file to replica sockets, without touching the disk at all. 342 | # 343 | # With disk-backed replication, while the RDB file is generated, more replicas 344 | # can be queued and served with the RDB file as soon as the current child producing 345 | # the RDB file finishes its work. With diskless replication instead once 346 | # the transfer starts, new replicas arriving will be queued and a new transfer 347 | # will start when the current one terminates. 348 | # 349 | # When diskless replication is used, the master waits a configurable amount of 350 | # time (in seconds) before starting the transfer in the hope that multiple replicas 351 | # will arrive and the transfer can be parallelized. 352 | # 353 | # With slow disks and fast (large bandwidth) networks, diskless replication 354 | # works better. 355 | repl-diskless-sync no 356 | 357 | # When diskless replication is enabled, it is possible to configure the delay 358 | # the server waits in order to spawn the child that transfers the RDB via socket 359 | # to the replicas. 360 | # 361 | # This is important since once the transfer starts, it is not possible to serve 362 | # new replicas arriving, that will be queued for the next RDB transfer, so the server 363 | # waits a delay in order to let more replicas arrive. 364 | # 365 | # The delay is specified in seconds, and by default is 5 seconds. To disable 366 | # it entirely just set it to 0 seconds and the transfer will start ASAP. 367 | repl-diskless-sync-delay 5 368 | 369 | # Replicas send PINGs to server in a predefined interval. It's possible to change 370 | # this interval with the repl_ping_replica_period option. The default value is 10 371 | # seconds. 372 | # 373 | # repl-ping-replica-period 10 374 | 375 | # The following option sets the replication timeout for: 376 | # 377 | # 1) Bulk transfer I/O during SYNC, from the point of view of replica. 378 | # 2) Master timeout from the point of view of replicas (data, pings). 379 | # 3) Replica timeout from the point of view of masters (REPLCONF ACK pings). 380 | # 381 | # It is important to make sure that this value is greater than the value 382 | # specified for repl-ping-replica-period otherwise a timeout will be detected 383 | # every time there is low traffic between the master and the replica. 384 | # 385 | # repl-timeout 60 386 | 387 | # Disable TCP_NODELAY on the replica socket after SYNC? 388 | # 389 | # If you select "yes" Redis will use a smaller number of TCP packets and 390 | # less bandwidth to send data to replicas. But this can add a delay for 391 | # the data to appear on the replica side, up to 40 milliseconds with 392 | # Linux kernels using a default configuration. 393 | # 394 | # If you select "no" the delay for data to appear on the replica side will 395 | # be reduced but more bandwidth will be used for replication. 396 | # 397 | # By default we optimize for low latency, but in very high traffic conditions 398 | # or when the master and replicas are many hops away, turning this to "yes" may 399 | # be a good idea. 400 | repl-disable-tcp-nodelay no 401 | 402 | # Set the replication backlog size. The backlog is a buffer that accumulates 403 | # replica data when replicas are disconnected for some time, so that when a replica 404 | # wants to reconnect again, often a full resync is not needed, but a partial 405 | # resync is enough, just passing the portion of data the replica missed while 406 | # disconnected. 407 | # 408 | # The bigger the replication backlog, the longer the time the replica can be 409 | # disconnected and later be able to perform a partial resynchronization. 410 | # 411 | # The backlog is only allocated once there is at least a replica connected. 412 | # 413 | # repl-backlog-size 1mb 414 | 415 | # After a master has no longer connected replicas for some time, the backlog 416 | # will be freed. The following option configures the amount of seconds that 417 | # need to elapse, starting from the time the last replica disconnected, for 418 | # the backlog buffer to be freed. 419 | # 420 | # Note that replicas never free the backlog for timeout, since they may be 421 | # promoted to masters later, and should be able to correctly "partially 422 | # resynchronize" with the replicas: hence they should always accumulate backlog. 423 | # 424 | # A value of 0 means to never release the backlog. 425 | # 426 | # repl-backlog-ttl 3600 427 | 428 | # The replica priority is an integer number published by Redis in the INFO output. 429 | # It is used by Redis Sentinel in order to select a replica to promote into a 430 | # master if the master is no longer working correctly. 431 | # 432 | # A replica with a low priority number is considered better for promotion, so 433 | # for instance if there are three replicas with priority 10, 100, 25 Sentinel will 434 | # pick the one with priority 10, that is the lowest. 435 | # 436 | # However a special priority of 0 marks the replica as not able to perform the 437 | # role of master, so a replica with priority of 0 will never be selected by 438 | # Redis Sentinel for promotion. 439 | # 440 | # By default the priority is 100. 441 | replica-priority 100 442 | 443 | # It is possible for a master to stop accepting writes if there are less than 444 | # N replicas connected, having a lag less or equal than M seconds. 445 | # 446 | # The N replicas need to be in "online" state. 447 | # 448 | # The lag in seconds, that must be <= the specified value, is calculated from 449 | # the last ping received from the replica, that is usually sent every second. 450 | # 451 | # This option does not GUARANTEE that N replicas will accept the write, but 452 | # will limit the window of exposure for lost writes in case not enough replicas 453 | # are available, to the specified number of seconds. 454 | # 455 | # For example to require at least 3 replicas with a lag <= 10 seconds use: 456 | # 457 | # min-replicas-to-write 3 458 | # min-replicas-max-lag 10 459 | # 460 | # Setting one or the other to 0 disables the feature. 461 | # 462 | # By default min-replicas-to-write is set to 0 (feature disabled) and 463 | # min-replicas-max-lag is set to 10. 464 | 465 | # A Redis master is able to list the address and port of the attached 466 | # replicas in different ways. For example the "INFO replication" section 467 | # offers this information, which is used, among other tools, by 468 | # Redis Sentinel in order to discover replica instances. 469 | # Another place where this info is available is in the output of the 470 | # "ROLE" command of a master. 471 | # 472 | # The listed IP and address normally reported by a replica is obtained 473 | # in the following way: 474 | # 475 | # IP: The address is auto detected by checking the peer address 476 | # of the socket used by the replica to connect with the master. 477 | # 478 | # Port: The port is communicated by the replica during the replication 479 | # handshake, and is normally the port that the replica is using to 480 | # listen for connections. 481 | # 482 | # However when port forwarding or Network Address Translation (NAT) is 483 | # used, the replica may be actually reachable via different IP and port 484 | # pairs. The following two options can be used by a replica in order to 485 | # report to its master a specific set of IP and port, so that both INFO 486 | # and ROLE will report those values. 487 | # 488 | # There is no need to use both the options if you need to override just 489 | # the port or the IP address. 490 | # 491 | # replica-announce-ip 5.5.5.5 492 | # replica-announce-port 1234 493 | 494 | ################################## SECURITY ################################### 495 | 496 | # Require clients to issue AUTH before processing any other 497 | # commands. This might be useful in environments in which you do not trust 498 | # others with access to the host running redis-server. 499 | # 500 | # This should stay commented out for backward compatibility and because most 501 | # people do not need auth (e.g. they run their own servers). 502 | # 503 | # Warning: since Redis is pretty fast an outside user can try up to 504 | # 150k passwords per second against a good box. This means that you should 505 | # use a very strong password otherwise it will be very easy to break. 506 | # 507 | # requirepass foobared 508 | 509 | # Command renaming. 510 | # 511 | # It is possible to change the name of dangerous commands in a shared 512 | # environment. For instance the CONFIG command may be renamed into something 513 | # hard to guess so that it will still be available for internal-use tools 514 | # but not available for general clients. 515 | # 516 | # Example: 517 | # 518 | # rename-command CONFIG b840fc02d524045429941cc15f59e41cb7be6c52 519 | # 520 | # It is also possible to completely kill a command by renaming it into 521 | # an empty string: 522 | # 523 | # rename-command CONFIG "" 524 | # 525 | # Please note that changing the name of commands that are logged into the 526 | # AOF file or transmitted to replicas may cause problems. 527 | 528 | ################################### CLIENTS #################################### 529 | 530 | # Set the max number of connected clients at the same time. By default 531 | # this limit is set to 10000 clients, however if the Redis server is not 532 | # able to configure the process file limit to allow for the specified limit 533 | # the max number of allowed clients is set to the current file limit 534 | # minus 32 (as Redis reserves a few file descriptors for internal uses). 535 | # 536 | # Once the limit is reached Redis will close all the new connections sending 537 | # an error 'max number of clients reached'. 538 | # 539 | # maxclients 10000 540 | 541 | ############################## MEMORY MANAGEMENT ################################ 542 | 543 | # Set a memory usage limit to the specified amount of bytes. 544 | # When the memory limit is reached Redis will try to remove keys 545 | # according to the eviction policy selected (see maxmemory-policy). 546 | # 547 | # If Redis can't remove keys according to the policy, or if the policy is 548 | # set to 'noeviction', Redis will start to reply with errors to commands 549 | # that would use more memory, like SET, LPUSH, and so on, and will continue 550 | # to reply to read-only commands like GET. 551 | # 552 | # This option is usually useful when using Redis as an LRU or LFU cache, or to 553 | # set a hard memory limit for an instance (using the 'noeviction' policy). 554 | # 555 | # WARNING: If you have replicas attached to an instance with maxmemory on, 556 | # the size of the output buffers needed to feed the replicas are subtracted 557 | # from the used memory count, so that network problems / resyncs will 558 | # not trigger a loop where keys are evicted, and in turn the output 559 | # buffer of replicas is full with DELs of keys evicted triggering the deletion 560 | # of more keys, and so forth until the database is completely emptied. 561 | # 562 | # In short... if you have replicas attached it is suggested that you set a lower 563 | # limit for maxmemory so that there is some free RAM on the system for replica 564 | # output buffers (but this is not needed if the policy is 'noeviction'). 565 | # 566 | # maxmemory 567 | 568 | # MAXMEMORY POLICY: how Redis will select what to remove when maxmemory 569 | # is reached. You can select among five behaviors: 570 | # 571 | # volatile-lru -> Evict using approximated LRU among the keys with an expire set. 572 | # allkeys-lru -> Evict any key using approximated LRU. 573 | # volatile-lfu -> Evict using approximated LFU among the keys with an expire set. 574 | # allkeys-lfu -> Evict any key using approximated LFU. 575 | # volatile-random -> Remove a random key among the ones with an expire set. 576 | # allkeys-random -> Remove a random key, any key. 577 | # volatile-ttl -> Remove the key with the nearest expire time (minor TTL) 578 | # noeviction -> Don't evict anything, just return an error on write operations. 579 | # 580 | # LRU means Least Recently Used 581 | # LFU means Least Frequently Used 582 | # 583 | # Both LRU, LFU and volatile-ttl are implemented using approximated 584 | # randomized algorithms. 585 | # 586 | # Note: with any of the above policies, Redis will return an error on write 587 | # operations, when there are no suitable keys for eviction. 588 | # 589 | # At the date of writing these commands are: set setnx setex append 590 | # incr decr rpush lpush rpushx lpushx linsert lset rpoplpush sadd 591 | # sinter sinterstore sunion sunionstore sdiff sdiffstore zadd zincrby 592 | # zunionstore zinterstore hset hsetnx hmset hincrby incrby decrby 593 | # getset mset msetnx exec sort 594 | # 595 | # The default is: 596 | # 597 | # maxmemory-policy noeviction 598 | 599 | # LRU, LFU and minimal TTL algorithms are not precise algorithms but approximated 600 | # algorithms (in order to save memory), so you can tune it for speed or 601 | # accuracy. For default Redis will check five keys and pick the one that was 602 | # used less recently, you can change the sample size using the following 603 | # configuration directive. 604 | # 605 | # The default of 5 produces good enough results. 10 Approximates very closely 606 | # true LRU but costs more CPU. 3 is faster but not very accurate. 607 | # 608 | # maxmemory-samples 5 609 | 610 | # Starting from Redis 5, by default a replica will ignore its maxmemory setting 611 | # (unless it is promoted to master after a failover or manually). It means 612 | # that the eviction of keys will be just handled by the master, sending the 613 | # DEL commands to the replica as keys evict in the master side. 614 | # 615 | # This behavior ensures that masters and replicas stay consistent, and is usually 616 | # what you want, however if your replica is writable, or you want the replica to have 617 | # a different memory setting, and you are sure all the writes performed to the 618 | # replica are idempotent, then you may change this default (but be sure to understand 619 | # what you are doing). 620 | # 621 | # Note that since the replica by default does not evict, it may end using more 622 | # memory than the one set via maxmemory (there are certain buffers that may 623 | # be larger on the replica, or data structures may sometimes take more memory and so 624 | # forth). So make sure you monitor your replicas and make sure they have enough 625 | # memory to never hit a real out-of-memory condition before the master hits 626 | # the configured maxmemory setting. 627 | # 628 | # replica-ignore-maxmemory yes 629 | 630 | ############################# LAZY FREEING #################################### 631 | 632 | # Redis has two primitives to delete keys. One is called DEL and is a blocking 633 | # deletion of the object. It means that the server stops processing new commands 634 | # in order to reclaim all the memory associated with an object in a synchronous 635 | # way. If the key deleted is associated with a small object, the time needed 636 | # in order to execute the DEL command is very small and comparable to most other 637 | # O(1) or O(log_N) commands in Redis. However if the key is associated with an 638 | # aggregated value containing millions of elements, the server can block for 639 | # a long time (even seconds) in order to complete the operation. 640 | # 641 | # For the above reasons Redis also offers non blocking deletion primitives 642 | # such as UNLINK (non blocking DEL) and the ASYNC option of FLUSHALL and 643 | # FLUSHDB commands, in order to reclaim memory in background. Those commands 644 | # are executed in constant time. Another thread will incrementally free the 645 | # object in the background as fast as possible. 646 | # 647 | # DEL, UNLINK and ASYNC option of FLUSHALL and FLUSHDB are user-controlled. 648 | # It's up to the design of the application to understand when it is a good 649 | # idea to use one or the other. However the Redis server sometimes has to 650 | # delete keys or flush the whole database as a side effect of other operations. 651 | # Specifically Redis deletes objects independently of a user call in the 652 | # following scenarios: 653 | # 654 | # 1) On eviction, because of the maxmemory and maxmemory policy configurations, 655 | # in order to make room for new data, without going over the specified 656 | # memory limit. 657 | # 2) Because of expire: when a key with an associated time to live (see the 658 | # EXPIRE command) must be deleted from memory. 659 | # 3) Because of a side effect of a command that stores data on a key that may 660 | # already exist. For example the RENAME command may delete the old key 661 | # content when it is replaced with another one. Similarly SUNIONSTORE 662 | # or SORT with STORE option may delete existing keys. The SET command 663 | # itself removes any old content of the specified key in order to replace 664 | # it with the specified string. 665 | # 4) During replication, when a replica performs a full resynchronization with 666 | # its master, the content of the whole database is removed in order to 667 | # load the RDB file just transferred. 668 | # 669 | # In all the above cases the default is to delete objects in a blocking way, 670 | # like if DEL was called. However you can configure each case specifically 671 | # in order to instead release memory in a non-blocking way like if UNLINK 672 | # was called, using the following configuration directives: 673 | 674 | lazyfree-lazy-eviction no 675 | lazyfree-lazy-expire no 676 | lazyfree-lazy-server-del no 677 | replica-lazy-flush no 678 | 679 | ############################## APPEND ONLY MODE ############################### 680 | 681 | # By default Redis asynchronously dumps the dataset on disk. This mode is 682 | # good enough in many applications, but an issue with the Redis process or 683 | # a power outage may result into a few minutes of writes lost (depending on 684 | # the configured save points). 685 | # 686 | # The Append Only File is an alternative persistence mode that provides 687 | # much better durability. For instance using the default data fsync policy 688 | # (see later in the config file) Redis can lose just one second of writes in a 689 | # dramatic event like a server power outage, or a single write if something 690 | # wrong with the Redis process itself happens, but the operating system is 691 | # still running correctly. 692 | # 693 | # AOF and RDB persistence can be enabled at the same time without problems. 694 | # If the AOF is enabled on startup Redis will load the AOF, that is the file 695 | # with the better durability guarantees. 696 | # 697 | # Please check http://redis.io/topics/persistence for more information. 698 | 699 | appendonly no 700 | 701 | # The name of the append only file (default: "appendonly.aof") 702 | 703 | appendfilename "appendonly.aof" 704 | 705 | # The fsync() call tells the Operating System to actually write data on disk 706 | # instead of waiting for more data in the output buffer. Some OS will really flush 707 | # data on disk, some other OS will just try to do it ASAP. 708 | # 709 | # Redis supports three different modes: 710 | # 711 | # no: don't fsync, just let the OS flush the data when it wants. Faster. 712 | # always: fsync after every write to the append only log. Slow, Safest. 713 | # everysec: fsync only one time every second. Compromise. 714 | # 715 | # The default is "everysec", as that's usually the right compromise between 716 | # speed and data safety. It's up to you to understand if you can relax this to 717 | # "no" that will let the operating system flush the output buffer when 718 | # it wants, for better performances (but if you can live with the idea of 719 | # some data loss consider the default persistence mode that's snapshotting), 720 | # or on the contrary, use "always" that's very slow but a bit safer than 721 | # everysec. 722 | # 723 | # More details please check the following article: 724 | # http://antirez.com/post/redis-persistence-demystified.html 725 | # 726 | # If unsure, use "everysec". 727 | 728 | # appendfsync always 729 | appendfsync everysec 730 | # appendfsync no 731 | 732 | # When the AOF fsync policy is set to always or everysec, and a background 733 | # saving process (a background save or AOF log background rewriting) is 734 | # performing a lot of I/O against the disk, in some Linux configurations 735 | # Redis may block too long on the fsync() call. Note that there is no fix for 736 | # this currently, as even performing fsync in a different thread will block 737 | # our synchronous write(2) call. 738 | # 739 | # In order to mitigate this problem it's possible to use the following option 740 | # that will prevent fsync() from being called in the main process while a 741 | # BGSAVE or BGREWRITEAOF is in progress. 742 | # 743 | # This means that while another child is saving, the durability of Redis is 744 | # the same as "appendfsync none". In practical terms, this means that it is 745 | # possible to lose up to 30 seconds of log in the worst scenario (with the 746 | # default Linux settings). 747 | # 748 | # If you have latency problems turn this to "yes". Otherwise leave it as 749 | # "no" that is the safest pick from the point of view of durability. 750 | 751 | no-appendfsync-on-rewrite no 752 | 753 | # Automatic rewrite of the append only file. 754 | # Redis is able to automatically rewrite the log file implicitly calling 755 | # BGREWRITEAOF when the AOF log size grows by the specified percentage. 756 | # 757 | # This is how it works: Redis remembers the size of the AOF file after the 758 | # latest rewrite (if no rewrite has happened since the restart, the size of 759 | # the AOF at startup is used). 760 | # 761 | # This base size is compared to the current size. If the current size is 762 | # bigger than the specified percentage, the rewrite is triggered. Also 763 | # you need to specify a minimal size for the AOF file to be rewritten, this 764 | # is useful to avoid rewriting the AOF file even if the percentage increase 765 | # is reached but it is still pretty small. 766 | # 767 | # Specify a percentage of zero in order to disable the automatic AOF 768 | # rewrite feature. 769 | 770 | auto-aof-rewrite-percentage 100 771 | auto-aof-rewrite-min-size 64mb 772 | 773 | # An AOF file may be found to be truncated at the end during the Redis 774 | # startup process, when the AOF data gets loaded back into memory. 775 | # This may happen when the system where Redis is running 776 | # crashes, especially when an ext4 filesystem is mounted without the 777 | # data=ordered option (however this can't happen when Redis itself 778 | # crashes or aborts but the operating system still works correctly). 779 | # 780 | # Redis can either exit with an error when this happens, or load as much 781 | # data as possible (the default now) and start if the AOF file is found 782 | # to be truncated at the end. The following option controls this behavior. 783 | # 784 | # If aof-load-truncated is set to yes, a truncated AOF file is loaded and 785 | # the Redis server starts emitting a log to inform the user of the event. 786 | # Otherwise if the option is set to no, the server aborts with an error 787 | # and refuses to start. When the option is set to no, the user requires 788 | # to fix the AOF file using the "redis-check-aof" utility before to restart 789 | # the server. 790 | # 791 | # Note that if the AOF file will be found to be corrupted in the middle 792 | # the server will still exit with an error. This option only applies when 793 | # Redis will try to read more data from the AOF file but not enough bytes 794 | # will be found. 795 | aof-load-truncated yes 796 | 797 | # When rewriting the AOF file, Redis is able to use an RDB preamble in the 798 | # AOF file for faster rewrites and recoveries. When this option is turned 799 | # on the rewritten AOF file is composed of two different stanzas: 800 | # 801 | # [RDB file][AOF tail] 802 | # 803 | # When loading Redis recognizes that the AOF file starts with the "REDIS" 804 | # string and loads the prefixed RDB file, and continues loading the AOF 805 | # tail. 806 | aof-use-rdb-preamble yes 807 | 808 | ################################ LUA SCRIPTING ############################### 809 | 810 | # Max execution time of a Lua script in milliseconds. 811 | # 812 | # If the maximum execution time is reached Redis will log that a script is 813 | # still in execution after the maximum allowed time and will start to 814 | # reply to queries with an error. 815 | # 816 | # When a long running script exceeds the maximum execution time only the 817 | # SCRIPT KILL and SHUTDOWN NOSAVE commands are available. The first can be 818 | # used to stop a script that did not yet called write commands. The second 819 | # is the only way to shut down the server in the case a write command was 820 | # already issued by the script but the user doesn't want to wait for the natural 821 | # termination of the script. 822 | # 823 | # Set it to 0 or a negative value for unlimited execution without warnings. 824 | lua-time-limit 5000 825 | 826 | ################################ REDIS CLUSTER ############################### 827 | # 828 | # ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 829 | # WARNING EXPERIMENTAL: Redis Cluster is considered to be stable code, however 830 | # in order to mark it as "mature" we need to wait for a non trivial percentage 831 | # of users to deploy it in production. 832 | # ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 833 | # 834 | # Normal Redis instances can't be part of a Redis Cluster; only nodes that are 835 | # started as cluster nodes can. In order to start a Redis instance as a 836 | # cluster node enable the cluster support uncommenting the following: 837 | # 838 | # cluster-enabled yes 839 | 840 | # Every cluster node has a cluster configuration file. This file is not 841 | # intended to be edited by hand. It is created and updated by Redis nodes. 842 | # Every Redis Cluster node requires a different cluster configuration file. 843 | # Make sure that instances running in the same system do not have 844 | # overlapping cluster configuration file names. 845 | # 846 | # cluster-config-file nodes-6379.conf 847 | 848 | # Cluster node timeout is the amount of milliseconds a node must be unreachable 849 | # for it to be considered in failure state. 850 | # Most other internal time limits are multiple of the node timeout. 851 | # 852 | # cluster-node-timeout 15000 853 | 854 | # A replica of a failing master will avoid to start a failover if its data 855 | # looks too old. 856 | # 857 | # There is no simple way for a replica to actually have an exact measure of 858 | # its "data age", so the following two checks are performed: 859 | # 860 | # 1) If there are multiple replicas able to failover, they exchange messages 861 | # in order to try to give an advantage to the replica with the best 862 | # replication offset (more data from the master processed). 863 | # Replicas will try to get their rank by offset, and apply to the start 864 | # of the failover a delay proportional to their rank. 865 | # 866 | # 2) Every single replica computes the time of the last interaction with 867 | # its master. This can be the last ping or command received (if the master 868 | # is still in the "connected" state), or the time that elapsed since the 869 | # disconnection with the master (if the replication link is currently down). 870 | # If the last interaction is too old, the replica will not try to failover 871 | # at all. 872 | # 873 | # The point "2" can be tuned by user. Specifically a replica will not perform 874 | # the failover if, since the last interaction with the master, the time 875 | # elapsed is greater than: 876 | # 877 | # (node-timeout * replica-validity-factor) + repl-ping-replica-period 878 | # 879 | # So for example if node-timeout is 30 seconds, and the replica-validity-factor 880 | # is 10, and assuming a default repl-ping-replica-period of 10 seconds, the 881 | # replica will not try to failover if it was not able to talk with the master 882 | # for longer than 310 seconds. 883 | # 884 | # A large replica-validity-factor may allow replicas with too old data to failover 885 | # a master, while a too small value may prevent the cluster from being able to 886 | # elect a replica at all. 887 | # 888 | # For maximum availability, it is possible to set the replica-validity-factor 889 | # to a value of 0, which means, that replicas will always try to failover the 890 | # master regardless of the last time they interacted with the master. 891 | # (However they'll always try to apply a delay proportional to their 892 | # offset rank). 893 | # 894 | # Zero is the only value able to guarantee that when all the partitions heal 895 | # the cluster will always be able to continue. 896 | # 897 | # cluster-replica-validity-factor 10 898 | 899 | # Cluster replicas are able to migrate to orphaned masters, that are masters 900 | # that are left without working replicas. This improves the cluster ability 901 | # to resist to failures as otherwise an orphaned master can't be failed over 902 | # in case of failure if it has no working replicas. 903 | # 904 | # Replicas migrate to orphaned masters only if there are still at least a 905 | # given number of other working replicas for their old master. This number 906 | # is the "migration barrier". A migration barrier of 1 means that a replica 907 | # will migrate only if there is at least 1 other working replica for its master 908 | # and so forth. It usually reflects the number of replicas you want for every 909 | # master in your cluster. 910 | # 911 | # Default is 1 (replicas migrate only if their masters remain with at least 912 | # one replica). To disable migration just set it to a very large value. 913 | # A value of 0 can be set but is useful only for debugging and dangerous 914 | # in production. 915 | # 916 | # cluster-migration-barrier 1 917 | 918 | # By default Redis Cluster nodes stop accepting queries if they detect there 919 | # is at least an hash slot uncovered (no available node is serving it). 920 | # This way if the cluster is partially down (for example a range of hash slots 921 | # are no longer covered) all the cluster becomes, eventually, unavailable. 922 | # It automatically returns available as soon as all the slots are covered again. 923 | # 924 | # However sometimes you want the subset of the cluster which is working, 925 | # to continue to accept queries for the part of the key space that is still 926 | # covered. In order to do so, just set the cluster-require-full-coverage 927 | # option to no. 928 | # 929 | # cluster-require-full-coverage yes 930 | 931 | # This option, when set to yes, prevents replicas from trying to failover its 932 | # master during master failures. However the master can still perform a 933 | # manual failover, if forced to do so. 934 | # 935 | # This is useful in different scenarios, especially in the case of multiple 936 | # data center operations, where we want one side to never be promoted if not 937 | # in the case of a total DC failure. 938 | # 939 | # cluster-replica-no-failover no 940 | 941 | # In order to setup your cluster make sure to read the documentation 942 | # available at http://redis.io web site. 943 | 944 | ########################## CLUSTER DOCKER/NAT support ######################## 945 | 946 | # In certain deployments, Redis Cluster nodes address discovery fails, because 947 | # addresses are NAT-ted or because ports are forwarded (the typical case is 948 | # Docker and other containers). 949 | # 950 | # In order to make Redis Cluster working in such environments, a static 951 | # configuration where each node knows its public address is needed. The 952 | # following two options are used for this scope, and are: 953 | # 954 | # * cluster-announce-ip 955 | # * cluster-announce-port 956 | # * cluster-announce-bus-port 957 | # 958 | # Each instruct the node about its address, client port, and cluster message 959 | # bus port. The information is then published in the header of the bus packets 960 | # so that other nodes will be able to correctly map the address of the node 961 | # publishing the information. 962 | # 963 | # If the above options are not used, the normal Redis Cluster auto-detection 964 | # will be used instead. 965 | # 966 | # Note that when remapped, the bus port may not be at the fixed offset of 967 | # clients port + 10000, so you can specify any port and bus-port depending 968 | # on how they get remapped. If the bus-port is not set, a fixed offset of 969 | # 10000 will be used as usually. 970 | # 971 | # Example: 972 | # 973 | # cluster-announce-ip 10.1.1.5 974 | # cluster-announce-port 6379 975 | # cluster-announce-bus-port 6380 976 | 977 | ################################## SLOW LOG ################################### 978 | 979 | # The Redis Slow Log is a system to log queries that exceeded a specified 980 | # execution time. The execution time does not include the I/O operations 981 | # like talking with the client, sending the reply and so forth, 982 | # but just the time needed to actually execute the command (this is the only 983 | # stage of command execution where the thread is blocked and can not serve 984 | # other requests in the meantime). 985 | # 986 | # You can configure the slow log with two parameters: one tells Redis 987 | # what is the execution time, in microseconds, to exceed in order for the 988 | # command to get logged, and the other parameter is the length of the 989 | # slow log. When a new command is logged the oldest one is removed from the 990 | # queue of logged commands. 991 | 992 | # The following time is expressed in microseconds, so 1000000 is equivalent 993 | # to one second. Note that a negative number disables the slow log, while 994 | # a value of zero forces the logging of every command. 995 | slowlog-log-slower-than 10000 996 | 997 | # There is no limit to this length. Just be aware that it will consume memory. 998 | # You can reclaim memory used by the slow log with SLOWLOG RESET. 999 | slowlog-max-len 128 1000 | 1001 | ################################ LATENCY MONITOR ############################## 1002 | 1003 | # The Redis latency monitoring subsystem samples different operations 1004 | # at runtime in order to collect data related to possible sources of 1005 | # latency of a Redis instance. 1006 | # 1007 | # Via the LATENCY command this information is available to the user that can 1008 | # print graphs and obtain reports. 1009 | # 1010 | # The system only logs operations that were performed in a time equal or 1011 | # greater than the amount of milliseconds specified via the 1012 | # latency-monitor-threshold configuration directive. When its value is set 1013 | # to zero, the latency monitor is turned off. 1014 | # 1015 | # By default latency monitoring is disabled since it is mostly not needed 1016 | # if you don't have latency issues, and collecting data has a performance 1017 | # impact, that while very small, can be measured under big load. Latency 1018 | # monitoring can easily be enabled at runtime using the command 1019 | # "CONFIG SET latency-monitor-threshold " if needed. 1020 | latency-monitor-threshold 0 1021 | 1022 | ############################# EVENT NOTIFICATION ############################## 1023 | 1024 | # Redis can notify Pub/Sub clients about events happening in the key space. 1025 | # This feature is documented at http://redis.io/topics/notifications 1026 | # 1027 | # For instance if keyspace events notification is enabled, and a client 1028 | # performs a DEL operation on key "foo" stored in the Database 0, two 1029 | # messages will be published via Pub/Sub: 1030 | # 1031 | # PUBLISH __keyspace@0__:foo del 1032 | # PUBLISH __keyevent@0__:del foo 1033 | # 1034 | # It is possible to select the events that Redis will notify among a set 1035 | # of classes. Every class is identified by a single character: 1036 | # 1037 | # K Keyspace events, published with __keyspace@__ prefix. 1038 | # E Keyevent events, published with __keyevent@__ prefix. 1039 | # g Generic commands (non-type specific) like DEL, EXPIRE, RENAME, ... 1040 | # $ String commands 1041 | # l List commands 1042 | # s Set commands 1043 | # h Hash commands 1044 | # z Sorted set commands 1045 | # x Expired events (events generated every time a key expires) 1046 | # e Evicted events (events generated when a key is evicted for maxmemory) 1047 | # A Alias for g$lshzxe, so that the "AKE" string means all the events. 1048 | # 1049 | # The "notify-keyspace-events" takes as argument a string that is composed 1050 | # of zero or multiple characters. The empty string means that notifications 1051 | # are disabled. 1052 | # 1053 | # Example: to enable list and generic events, from the point of view of the 1054 | # event name, use: 1055 | # 1056 | # notify-keyspace-events Elg 1057 | # 1058 | # Example 2: to get the stream of the expired keys subscribing to channel 1059 | # name __keyevent@0__:expired use: 1060 | # 1061 | # notify-keyspace-events Ex 1062 | # 1063 | # By default all notifications are disabled because most users don't need 1064 | # this feature and the feature has some overhead. Note that if you don't 1065 | # specify at least one of K or E, no events will be delivered. 1066 | notify-keyspace-events "" 1067 | 1068 | ############################### ADVANCED CONFIG ############################### 1069 | 1070 | # Hashes are encoded using a memory efficient data structure when they have a 1071 | # small number of entries, and the biggest entry does not exceed a given 1072 | # threshold. These thresholds can be configured using the following directives. 1073 | hash-max-ziplist-entries 512 1074 | hash-max-ziplist-value 64 1075 | 1076 | # Lists are also encoded in a special way to save a lot of space. 1077 | # The number of entries allowed per internal list node can be specified 1078 | # as a fixed maximum size or a maximum number of elements. 1079 | # For a fixed maximum size, use -5 through -1, meaning: 1080 | # -5: max size: 64 Kb <-- not recommended for normal workloads 1081 | # -4: max size: 32 Kb <-- not recommended 1082 | # -3: max size: 16 Kb <-- probably not recommended 1083 | # -2: max size: 8 Kb <-- good 1084 | # -1: max size: 4 Kb <-- good 1085 | # Positive numbers mean store up to _exactly_ that number of elements 1086 | # per list node. 1087 | # The highest performing option is usually -2 (8 Kb size) or -1 (4 Kb size), 1088 | # but if your use case is unique, adjust the settings as necessary. 1089 | list-max-ziplist-size -2 1090 | 1091 | # Lists may also be compressed. 1092 | # Compress depth is the number of quicklist ziplist nodes from *each* side of 1093 | # the list to *exclude* from compression. The head and tail of the list 1094 | # are always uncompressed for fast push/pop operations. Settings are: 1095 | # 0: disable all list compression 1096 | # 1: depth 1 means "don't start compressing until after 1 node into the list, 1097 | # going from either the head or tail" 1098 | # So: [head]->node->node->...->node->[tail] 1099 | # [head], [tail] will always be uncompressed; inner nodes will compress. 1100 | # 2: [head]->[next]->node->node->...->node->[prev]->[tail] 1101 | # 2 here means: don't compress head or head->next or tail->prev or tail, 1102 | # but compress all nodes between them. 1103 | # 3: [head]->[next]->[next]->node->node->...->node->[prev]->[prev]->[tail] 1104 | # etc. 1105 | list-compress-depth 0 1106 | 1107 | # Sets have a special encoding in just one case: when a set is composed 1108 | # of just strings that happen to be integers in radix 10 in the range 1109 | # of 64 bit signed integers. 1110 | # The following configuration setting sets the limit in the size of the 1111 | # set in order to use this special memory saving encoding. 1112 | set-max-intset-entries 512 1113 | 1114 | # Similarly to hashes and lists, sorted sets are also specially encoded in 1115 | # order to save a lot of space. This encoding is only used when the length and 1116 | # elements of a sorted set are below the following limits: 1117 | zset-max-ziplist-entries 128 1118 | zset-max-ziplist-value 64 1119 | 1120 | # HyperLogLog sparse representation bytes limit. The limit includes the 1121 | # 16 bytes header. When an HyperLogLog using the sparse representation crosses 1122 | # this limit, it is converted into the dense representation. 1123 | # 1124 | # A value greater than 16000 is totally useless, since at that point the 1125 | # dense representation is more memory efficient. 1126 | # 1127 | # The suggested value is ~ 3000 in order to have the benefits of 1128 | # the space efficient encoding without slowing down too much PFADD, 1129 | # which is O(N) with the sparse encoding. The value can be raised to 1130 | # ~ 10000 when CPU is not a concern, but space is, and the data set is 1131 | # composed of many HyperLogLogs with cardinality in the 0 - 15000 range. 1132 | hll-sparse-max-bytes 3000 1133 | 1134 | # Streams macro node max size / items. The stream data structure is a radix 1135 | # tree of big nodes that encode multiple items inside. Using this configuration 1136 | # it is possible to configure how big a single node can be in bytes, and the 1137 | # maximum number of items it may contain before switching to a new node when 1138 | # appending new stream entries. If any of the following settings are set to 1139 | # zero, the limit is ignored, so for instance it is possible to set just a 1140 | # max entires limit by setting max-bytes to 0 and max-entries to the desired 1141 | # value. 1142 | stream-node-max-bytes 4096 1143 | stream-node-max-entries 100 1144 | 1145 | # Active rehashing uses 1 millisecond every 100 milliseconds of CPU time in 1146 | # order to help rehashing the main Redis hash table (the one mapping top-level 1147 | # keys to values). The hash table implementation Redis uses (see dict.c) 1148 | # performs a lazy rehashing: the more operation you run into a hash table 1149 | # that is rehashing, the more rehashing "steps" are performed, so if the 1150 | # server is idle the rehashing is never complete and some more memory is used 1151 | # by the hash table. 1152 | # 1153 | # The default is to use this millisecond 10 times every second in order to 1154 | # actively rehash the main dictionaries, freeing memory when possible. 1155 | # 1156 | # If unsure: 1157 | # use "activerehashing no" if you have hard latency requirements and it is 1158 | # not a good thing in your environment that Redis can reply from time to time 1159 | # to queries with 2 milliseconds delay. 1160 | # 1161 | # use "activerehashing yes" if you don't have such hard requirements but 1162 | # want to free memory asap when possible. 1163 | activerehashing yes 1164 | 1165 | # The client output buffer limits can be used to force disconnection of clients 1166 | # that are not reading data from the server fast enough for some reason (a 1167 | # common reason is that a Pub/Sub client can't consume messages as fast as the 1168 | # publisher can produce them). 1169 | # 1170 | # The limit can be set differently for the three different classes of clients: 1171 | # 1172 | # normal -> normal clients including MONITOR clients 1173 | # replica -> replica clients 1174 | # pubsub -> clients subscribed to at least one pubsub channel or pattern 1175 | # 1176 | # The syntax of every client-output-buffer-limit directive is the following: 1177 | # 1178 | # client-output-buffer-limit 1179 | # 1180 | # A client is immediately disconnected once the hard limit is reached, or if 1181 | # the soft limit is reached and remains reached for the specified number of 1182 | # seconds (continuously). 1183 | # So for instance if the hard limit is 32 megabytes and the soft limit is 1184 | # 16 megabytes / 10 seconds, the client will get disconnected immediately 1185 | # if the size of the output buffers reach 32 megabytes, but will also get 1186 | # disconnected if the client reaches 16 megabytes and continuously overcomes 1187 | # the limit for 10 seconds. 1188 | # 1189 | # By default normal clients are not limited because they don't receive data 1190 | # without asking (in a push way), but just after a request, so only 1191 | # asynchronous clients may create a scenario where data is requested faster 1192 | # than it can read. 1193 | # 1194 | # Instead there is a default limit for pubsub and replica clients, since 1195 | # subscribers and replicas receive data in a push fashion. 1196 | # 1197 | # Both the hard or the soft limit can be disabled by setting them to zero. 1198 | client-output-buffer-limit normal 0 0 0 1199 | client-output-buffer-limit replica 256mb 64mb 60 1200 | client-output-buffer-limit pubsub 32mb 8mb 60 1201 | 1202 | # Client query buffers accumulate new commands. They are limited to a fixed 1203 | # amount by default in order to avoid that a protocol desynchronization (for 1204 | # instance due to a bug in the client) will lead to unbound memory usage in 1205 | # the query buffer. However you can configure it here if you have very special 1206 | # needs, such us huge multi/exec requests or alike. 1207 | # 1208 | # client-query-buffer-limit 1gb 1209 | 1210 | # In the Redis protocol, bulk requests, that are, elements representing single 1211 | # strings, are normally limited ot 512 mb. However you can change this limit 1212 | # here. 1213 | # 1214 | # proto-max-bulk-len 512mb 1215 | 1216 | # Redis calls an internal function to perform many background tasks, like 1217 | # closing connections of clients in timeout, purging expired keys that are 1218 | # never requested, and so forth. 1219 | # 1220 | # Not all tasks are performed with the same frequency, but Redis checks for 1221 | # tasks to perform according to the specified "hz" value. 1222 | # 1223 | # By default "hz" is set to 10. Raising the value will use more CPU when 1224 | # Redis is idle, but at the same time will make Redis more responsive when 1225 | # there are many keys expiring at the same time, and timeouts may be 1226 | # handled with more precision. 1227 | # 1228 | # The range is between 1 and 500, however a value over 100 is usually not 1229 | # a good idea. Most users should use the default of 10 and raise this up to 1230 | # 100 only in environments where very low latency is required. 1231 | hz 10 1232 | 1233 | # Normally it is useful to have an HZ value which is proportional to the 1234 | # number of clients connected. This is useful in order, for instance, to 1235 | # avoid too many clients are processed for each background task invocation 1236 | # in order to avoid latency spikes. 1237 | # 1238 | # Since the default HZ value by default is conservatively set to 10, Redis 1239 | # offers, and enables by default, the ability to use an adaptive HZ value 1240 | # which will temporary raise when there are many connected clients. 1241 | # 1242 | # When dynamic HZ is enabled, the actual configured HZ will be used as 1243 | # as a baseline, but multiples of the configured HZ value will be actually 1244 | # used as needed once more clients are connected. In this way an idle 1245 | # instance will use very little CPU time while a busy instance will be 1246 | # more responsive. 1247 | dynamic-hz yes 1248 | 1249 | # When a child rewrites the AOF file, if the following option is enabled 1250 | # the file will be fsync-ed every 32 MB of data generated. This is useful 1251 | # in order to commit the file to the disk more incrementally and avoid 1252 | # big latency spikes. 1253 | aof-rewrite-incremental-fsync yes 1254 | 1255 | # When redis saves RDB file, if the following option is enabled 1256 | # the file will be fsync-ed every 32 MB of data generated. This is useful 1257 | # in order to commit the file to the disk more incrementally and avoid 1258 | # big latency spikes. 1259 | rdb-save-incremental-fsync yes 1260 | 1261 | # Redis LFU eviction (see maxmemory setting) can be tuned. However it is a good 1262 | # idea to start with the default settings and only change them after investigating 1263 | # how to improve the performances and how the keys LFU change over time, which 1264 | # is possible to inspect via the OBJECT FREQ command. 1265 | # 1266 | # There are two tunable parameters in the Redis LFU implementation: the 1267 | # counter logarithm factor and the counter decay time. It is important to 1268 | # understand what the two parameters mean before changing them. 1269 | # 1270 | # The LFU counter is just 8 bits per key, it's maximum value is 255, so Redis 1271 | # uses a probabilistic increment with logarithmic behavior. Given the value 1272 | # of the old counter, when a key is accessed, the counter is incremented in 1273 | # this way: 1274 | # 1275 | # 1. A random number R between 0 and 1 is extracted. 1276 | # 2. A probability P is calculated as 1/(old_value*lfu_log_factor+1). 1277 | # 3. The counter is incremented only if R < P. 1278 | # 1279 | # The default lfu-log-factor is 10. This is a table of how the frequency 1280 | # counter changes with a different number of accesses with different 1281 | # logarithmic factors: 1282 | # 1283 | # +--------+------------+------------+------------+------------+------------+ 1284 | # | factor | 100 hits | 1000 hits | 100K hits | 1M hits | 10M hits | 1285 | # +--------+------------+------------+------------+------------+------------+ 1286 | # | 0 | 104 | 255 | 255 | 255 | 255 | 1287 | # +--------+------------+------------+------------+------------+------------+ 1288 | # | 1 | 18 | 49 | 255 | 255 | 255 | 1289 | # +--------+------------+------------+------------+------------+------------+ 1290 | # | 10 | 10 | 18 | 142 | 255 | 255 | 1291 | # +--------+------------+------------+------------+------------+------------+ 1292 | # | 100 | 8 | 11 | 49 | 143 | 255 | 1293 | # +--------+------------+------------+------------+------------+------------+ 1294 | # 1295 | # NOTE: The above table was obtained by running the following commands: 1296 | # 1297 | # redis-benchmark -n 1000000 incr foo 1298 | # redis-cli object freq foo 1299 | # 1300 | # NOTE 2: The counter initial value is 5 in order to give new objects a chance 1301 | # to accumulate hits. 1302 | # 1303 | # The counter decay time is the time, in minutes, that must elapse in order 1304 | # for the key counter to be divided by two (or decremented if it has a value 1305 | # less <= 10). 1306 | # 1307 | # The default value for the lfu-decay-time is 1. A Special value of 0 means to 1308 | # decay the counter every time it happens to be scanned. 1309 | # 1310 | # lfu-log-factor 10 1311 | # lfu-decay-time 1 1312 | 1313 | ########################### ACTIVE DEFRAGMENTATION ####################### 1314 | # 1315 | # WARNING THIS FEATURE IS EXPERIMENTAL. However it was stress tested 1316 | # even in production and manually tested by multiple engineers for some 1317 | # time. 1318 | # 1319 | # What is active defragmentation? 1320 | # ------------------------------- 1321 | # 1322 | # Active (online) defragmentation allows a Redis server to compact the 1323 | # spaces left between small allocations and deallocations of data in memory, 1324 | # thus allowing to reclaim back memory. 1325 | # 1326 | # Fragmentation is a natural process that happens with every allocator (but 1327 | # less so with Jemalloc, fortunately) and certain workloads. Normally a server 1328 | # restart is needed in order to lower the fragmentation, or at least to flush 1329 | # away all the data and create it again. However thanks to this feature 1330 | # implemented by Oran Agra for Redis 4.0 this process can happen at runtime 1331 | # in an "hot" way, while the server is running. 1332 | # 1333 | # Basically when the fragmentation is over a certain level (see the 1334 | # configuration options below) Redis will start to create new copies of the 1335 | # values in contiguous memory regions by exploiting certain specific Jemalloc 1336 | # features (in order to understand if an allocation is causing fragmentation 1337 | # and to allocate it in a better place), and at the same time, will release the 1338 | # old copies of the data. This process, repeated incrementally for all the keys 1339 | # will cause the fragmentation to drop back to normal values. 1340 | # 1341 | # Important things to understand: 1342 | # 1343 | # 1. This feature is disabled by default, and only works if you compiled Redis 1344 | # to use the copy of Jemalloc we ship with the source code of Redis. 1345 | # This is the default with Linux builds. 1346 | # 1347 | # 2. You never need to enable this feature if you don't have fragmentation 1348 | # issues. 1349 | # 1350 | # 3. Once you experience fragmentation, you can enable this feature when 1351 | # needed with the command "CONFIG SET activedefrag yes". 1352 | # 1353 | # The configuration parameters are able to fine tune the behavior of the 1354 | # defragmentation process. If you are not sure about what they mean it is 1355 | # a good idea to leave the defaults untouched. 1356 | 1357 | # Enabled active defragmentation 1358 | # activedefrag yes 1359 | 1360 | # Minimum amount of fragmentation waste to start active defrag 1361 | # active-defrag-ignore-bytes 100mb 1362 | 1363 | # Minimum percentage of fragmentation to start active defrag 1364 | # active-defrag-threshold-lower 10 1365 | 1366 | # Maximum percentage of fragmentation at which we use maximum effort 1367 | # active-defrag-threshold-upper 100 1368 | 1369 | # Minimal effort for defrag in CPU percentage 1370 | # active-defrag-cycle-min 5 1371 | 1372 | # Maximal effort for defrag in CPU percentage 1373 | # active-defrag-cycle-max 75 1374 | 1375 | # Maximum number of set/hash/zset/list fields that will be processed from 1376 | # the main dictionary scan 1377 | # active-defrag-max-scan-fields 1000 1378 | -------------------------------------------------------------------------------- /docker-compose-sample.yml: -------------------------------------------------------------------------------- 1 | version: "3" 2 | services: 3 | nginx: 4 | image: nginx:${NGINX_VERSION} 5 | ports: 6 | - "${NGINX_HTTP_HOST_PORT}:80" 7 | - "${NGINX_HTTPS_HOST_PORT}:443" 8 | volumes: 9 | - ${SOURCE_DIR}:/var/www/html/:rw 10 | - ${NGINX_CONFD_DIR}:/etc/nginx/conf.d/:rw 11 | - ${NGINX_CONF_FILE}:/etc/nginx/nginx.conf:ro 12 | - ${NGINX_LOG_DIR}:/var/log/nginx/:rw 13 | restart: always 14 | networks: 15 | - default 16 | 17 | php72: 18 | build: 19 | context: . 20 | args: 21 | PHP_VERSION: ${PHP72_VERSION} 22 | ALPINE_REPOSITORIES: ${ALPINE_REPOSITORIES} 23 | PHP_EXTENSIONS: ${PHP72_EXTENSIONS} 24 | MORE_EXTENSION_INSTALLER: php72.sh 25 | volumes: 26 | - ${SOURCE_DIR}:/var/www/html/:rw 27 | - ${PHP72_PHP_CONF_FILE}:/usr/local/etc/php/php.ini:ro 28 | - ${PHP72_FPM_CONF_FILE}:/usr/local/etc/php-fpm.d/www.conf:rw 29 | - ${PHP72_LOG_DIR}:/var/log/php 30 | restart: always 31 | cap_add: 32 | - SYS_PTRACE 33 | networks: 34 | - default 35 | 36 | php56: 37 | build: 38 | context: . 39 | args: 40 | PHP_VERSION: ${PHP56_VERSION} 41 | ALPINE_REPOSITORIES: ${ALPINE_REPOSITORIES} 42 | PHP_EXTENSIONS: ${PHP56_EXTENSIONS} 43 | MORE_EXTENSION_INSTALLER: php56.sh 44 | volumes: 45 | - ${SOURCE_DIR}:/var/www/html/:rw 46 | - ${PHP56_PHP_CONF_FILE}:/usr/local/etc/php/php.ini:ro 47 | - ${PHP56_FPM_CONF_FILE}:/usr/local/etc/php-fpm.d/www.conf:rw 48 | - ${PHP56_LOG_DIR}:/var/log/php 49 | restart: always 50 | cap_add: 51 | - SYS_PTRACE 52 | networks: 53 | - default 54 | 55 | mysql: 56 | image: mysql:${MYSQL_VERSION} 57 | ports: 58 | - "${MYSQL_HOST_PORT}:3306" 59 | volumes: 60 | - ${MYSQL_CONF_FILE}:/etc/mysql/conf.d/mysql.cnf:ro 61 | - ${MYSQL_DATA_DIR}:/var/lib/mysql/:rw 62 | restart: always 63 | networks: 64 | - default 65 | environment: 66 | MYSQL_ROOT_PASSWORD: "${MYSQL_ROOT_PASSWORD}" 67 | 68 | redis: 69 | image: redis:${REDIS_VERSION} 70 | ports: 71 | - "${REDIS_HOST_PORT}:6379" 72 | volumes: 73 | - ${REDIS_CONF_FILE}:/etc/redis.conf:ro 74 | restart: always 75 | entrypoint: ["redis-server", "/etc/redis.conf"] 76 | networks: 77 | - default 78 | 79 | phpmyadmin: 80 | image: phpmyadmin/phpmyadmin:latest 81 | ports: 82 | - "${PHPMYADMIN_HOST_PORT}:80" 83 | networks: 84 | - default 85 | environment: 86 | - PMA_HOST=mysql 87 | - PMA_PORT=3306 88 | 89 | phpredisadmin: 90 | image: erikdubbelboer/phpredisadmin:latest 91 | ports: 92 | - "${REDISMYADMIN_HOST_PORT}:80" 93 | networks: 94 | - default 95 | environment: 96 | - REDIS_1_HOST=redis 97 | - REDIS_1_PORT=6379 98 | 99 | mongo: 100 | image: mongo:${MONGO_VERSION} 101 | ports: 102 | - "${MONGO_HOST_PORT}:27017" 103 | volumes: 104 | - ${MONGO_DATA_DB_DIR}:/data/db:rw 105 | restart: always 106 | networks: 107 | - default 108 | # external: true 109 | 110 | mongo-express: 111 | image: mongo-express 112 | restart: always 113 | ports: 114 | - "${MONGO_EXPRESS_HOST_PORT}:8081" 115 | 116 | networks: 117 | default: 118 | -------------------------------------------------------------------------------- /docs/dnmp-plus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guanguans/dnmp-plus/a4e6302545130c89c966f89aeb148fe49f8c7808/docs/dnmp-plus.png -------------------------------------------------------------------------------- /docs/localhost.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guanguans/dnmp-plus/a4e6302545130c89c966f89aeb148fe49f8c7808/docs/localhost.png -------------------------------------------------------------------------------- /docs/xhgui1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guanguans/dnmp-plus/a4e6302545130c89c966f89aeb148fe49f8c7808/docs/xhgui1.png -------------------------------------------------------------------------------- /docs/xhgui2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guanguans/dnmp-plus/a4e6302545130c89c966f89aeb148fe49f8c7808/docs/xhgui2.png -------------------------------------------------------------------------------- /docs/xhgui3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guanguans/dnmp-plus/a4e6302545130c89c966f89aeb148fe49f8c7808/docs/xhgui3.png -------------------------------------------------------------------------------- /env.sample: -------------------------------------------------------------------------------- 1 | ################################################ 2 | ### environment config file ### 3 | ################################################ 4 | SOURCE_DIR=./www 5 | 6 | 7 | ############# PHP Alpine Repositories ############ 8 | ALPINE_REPOSITORIES=mirrors.aliyun.com 9 | 10 | 11 | #################### Nginx ##################### 12 | NGINX_VERSION=1.15.7-alpine 13 | NGINX_HTTP_HOST_PORT=80 14 | NGINX_HTTPS_HOST_PORT=443 15 | NGINX_CONFD_DIR=./conf/conf.d 16 | NGINX_CONF_FILE=./conf/nginx.conf 17 | NGINX_LOG_DIR=./log/nginx 18 | 19 | 20 | ############ PHP extensions ################# 21 | # Available extensions: 22 | # 23 | # pdo_mysql,zip,pcntl,mysqli,mbstring,exif,bcmath,calendar, 24 | # sockets,gettext,shmop,sysvmsg,sysvsem,sysvshm,pdo_rebird, 25 | # pdo_dblib,pdo_oci,pdo_odbc,pdo_pgsql,pgsql,oci8,odbc,dba, 26 | # gd,intl,bz2,soap,xsl,xmlrpc,wddx,curl,readline,snmp,pspell, 27 | # recode,tidy,gmp,imap,ldap,imagick,sqlsrv,mcrypt,opcache, 28 | # redis,memcached,xdebug,swoole,pdo_sqlsrv,sodium,yaf,mysql 29 | # 30 | # Please seperate theme with comma(,) if you use more than 31 | # one. 32 | # 33 | # For other extensions not list here, you also can install 34 | # via pecl or source, which show in script install.sh and 35 | # php72.sh in extensions. 36 | #################### end #################### 37 | 38 | 39 | #################### PHP7.2 #################### 40 | PHP72_VERSION=7.2.19 41 | PHP72_PHP_CONF_FILE=./conf/php.ini 42 | PHP72_FPM_CONF_FILE=./conf/php-fpm.conf 43 | PHP72_LOG_DIR=./log/php 44 | PHP72_EXTENSIONS=pdo_mysql,opcache,redis,xdebug,mongodb,tideways 45 | 46 | 47 | #################### PHP5.6 #################### 48 | PHP56_VERSION=5.6.40 49 | PHP56_PHP_CONF_FILE=./conf/php.ini 50 | PHP56_FPM_CONF_FILE=./conf/php-fpm.conf 51 | PHP56_LOG_DIR=./log/php 52 | PHP56_EXTENSIONS=opcache,redis,xdebug,mongodb 53 | 54 | 55 | #################### MySQL ##################### 56 | MYSQL_VERSION=8.0.13 57 | MYSQL_HOST_PORT=3306 58 | MYSQL_ROOT_PASSWORD=123456 59 | MYSQL_DATA_DIR=./mysql 60 | MYSQL_CONF_FILE=./conf/mysql.cnf 61 | 62 | 63 | #################### Redis ##################### 64 | REDIS_VERSION=5.0.3-alpine 65 | REDIS_HOST_PORT=6379 66 | REDIS_CONF_FILE=./conf/redis.conf 67 | 68 | 69 | ################## phpMyAdmin ################## 70 | PHPMYADMIN_HOST_PORT=8080 71 | 72 | 73 | ################# redisMyAdmin ################# 74 | REDISMYADMIN_HOST_PORT=8081 75 | 76 | 77 | #################### Mongo ##################### 78 | MONGO_VERSION=latest 79 | MONGO_HOST_PORT=27017 80 | MONGO_DATA_DB_DIR=./mongo 81 | 82 | 83 | ############### Mongo Express ################## 84 | MONGO_EXPRESS_HOST_PORT=8082 85 | -------------------------------------------------------------------------------- /extensions/install.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | echo 4 | echo "============================================" 5 | echo "Install extensions from : install.sh" 6 | echo "PHP version : ${PHP_VERSION}" 7 | echo "Extra Extensions : ${PHP_EXTENSIONS}" 8 | echo "Multicore Compilation : ${MC}" 9 | echo "Work directory : ${PWD}" 10 | echo "============================================" 11 | echo 12 | 13 | 14 | if [ "${ALPINE_REPOSITORIES}" != "" ]; then 15 | sed -i "s/dl-cdn.alpinelinux.org/${ALPINE_REPOSITORIES}/g" /etc/apk/repositories 16 | fi 17 | 18 | 19 | if [ "${PHP_EXTENSIONS}" != "" ]; then 20 | echo "---------- Install general dependencies ----------" 21 | apk add --no-cache autoconf g++ libtool make curl-dev libxml2-dev linux-headers 22 | fi 23 | 24 | if [ -z "${EXTENSIONS##*,pdo_mysql,*}" ]; then 25 | echo "---------- Install pdo_mysql ----------" 26 | docker-php-ext-install ${MC} pdo_mysql 27 | fi 28 | 29 | if [ -z "${EXTENSIONS##*,zip,*}" ]; then 30 | echo "---------- Install zip ----------" 31 | docker-php-ext-install ${MC} zip 32 | fi 33 | 34 | if [ -z "${EXTENSIONS##*,pcntl,*}" ]; then 35 | echo "---------- Install pcntl ----------" 36 | docker-php-ext-install ${MC} pcntl 37 | fi 38 | 39 | if [ -z "${EXTENSIONS##*,mysqli,*}" ]; then 40 | echo "---------- Install mysqli ----------" 41 | docker-php-ext-install ${MC} mysqli 42 | fi 43 | 44 | if [ -z "${EXTENSIONS##*,mbstring,*}" ]; then 45 | echo "---------- Install mbstring ----------" 46 | docker-php-ext-install ${MC} mbstring 47 | fi 48 | 49 | if [ -z "${EXTENSIONS##*,exif,*}" ]; then 50 | echo "---------- Install exif ----------" 51 | docker-php-ext-install ${MC} exif 52 | fi 53 | 54 | if [ -z "${EXTENSIONS##*,bcmath,*}" ]; then 55 | echo "---------- Install bcmath ----------" 56 | docker-php-ext-install ${MC} bcmath 57 | fi 58 | 59 | if [ -z "${EXTENSIONS##*,calendar,*}" ]; then 60 | echo "---------- Install calendar ----------" 61 | docker-php-ext-install ${MC} calendar 62 | fi 63 | 64 | if [ -z "${EXTENSIONS##*,zend_test,*}" ]; then 65 | echo "---------- Install zend_test ----------" 66 | docker-php-ext-install ${MC} zend_test 67 | fi 68 | 69 | if [ -z "${EXTENSIONS##*,opcache,*}" ]; then 70 | echo "---------- Install opcache ----------" 71 | docker-php-ext-install opcache 72 | fi 73 | 74 | if [ -z "${EXTENSIONS##*,sockets,*}" ]; then 75 | echo "---------- Install sockets ----------" 76 | docker-php-ext-install ${MC} sockets 77 | fi 78 | 79 | if [ -z "${EXTENSIONS##*,gettext,*}" ]; then 80 | echo "---------- Install gettext ----------" 81 | docker-php-ext-install ${MC} gettext 82 | fi 83 | 84 | if [ -z "${EXTENSIONS##*,shmop,*}" ]; then 85 | echo "---------- Install shmop ----------" 86 | docker-php-ext-install ${MC} shmop 87 | fi 88 | 89 | if [ -z "${EXTENSIONS##*,sysvmsg,*}" ]; then 90 | echo "---------- Install sysvmsg ----------" 91 | docker-php-ext-install ${MC} sysvmsg 92 | fi 93 | 94 | if [ -z "${EXTENSIONS##*,sysvsem,*}" ]; then 95 | echo "---------- Install sysvsem ----------" 96 | docker-php-ext-install ${MC} sysvsem 97 | fi 98 | 99 | if [ -z "${EXTENSIONS##*,sysvshm,*}" ]; then 100 | echo "---------- Install sysvshm ----------" 101 | docker-php-ext-install ${MC} sysvshm 102 | fi 103 | 104 | if [ -z "${EXTENSIONS##*,pdo_firebird,*}" ]; then 105 | echo "---------- Install pdo_firebird ----------" 106 | docker-php-ext-install ${MC} pdo_firebird 107 | fi 108 | 109 | if [ -z "${EXTENSIONS##*,pdo_dblib,*}" ]; then 110 | echo "---------- Install pdo_dblib ----------" 111 | docker-php-ext-install ${MC} pdo_dblib 112 | fi 113 | 114 | if [ -z "${EXTENSIONS##*,pdo_oci,*}" ]; then 115 | echo "---------- Install pdo_oci ----------" 116 | docker-php-ext-install ${MC} pdo_oci 117 | fi 118 | 119 | if [ -z "${EXTENSIONS##*,pdo_odbc,*}" ]; then 120 | echo "---------- Install pdo_odbc ----------" 121 | docker-php-ext-install ${MC} pdo_odbc 122 | fi 123 | 124 | if [ -z "${EXTENSIONS##*,pdo_pgsql,*}" ]; then 125 | echo "---------- Install pdo_pgsql ----------" 126 | apk --no-cache add postgresql-dev \ 127 | && docker-php-ext-install ${MC} pdo_pgsql 128 | fi 129 | 130 | if [ -z "${EXTENSIONS##*,pgsql,*}" ]; then 131 | echo "---------- Install pgsql ----------" 132 | apk --no-cache add postgresql-dev \ 133 | && docker-php-ext-install ${MC} pgsql 134 | fi 135 | 136 | if [ -z "${EXTENSIONS##*,oci8,*}" ]; then 137 | echo "---------- Install oci8 ----------" 138 | docker-php-ext-install ${MC} oci8 139 | fi 140 | 141 | if [ -z "${EXTENSIONS##*,odbc,*}" ]; then 142 | echo "---------- Install odbc ----------" 143 | docker-php-ext-install ${MC} odbc 144 | fi 145 | 146 | if [ -z "${EXTENSIONS##*,dba,*}" ]; then 147 | echo "---------- Install dba ----------" 148 | docker-php-ext-install ${MC} dba 149 | fi 150 | 151 | if [ -z "${EXTENSIONS##*,interbase,*}" ]; then 152 | echo "---------- Install interbase ----------" 153 | echo "Alpine linux do not support interbase/firebird!!!" 154 | #docker-php-ext-install ${MC} interbase 155 | fi 156 | 157 | if [ -z "${EXTENSIONS##*,gd,*}" ]; then 158 | echo "---------- Install gd ----------" 159 | apk add --no-cache freetype-dev libjpeg-turbo-dev libpng-dev \ 160 | && docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ \ 161 | && docker-php-ext-install ${MC} gd 162 | fi 163 | 164 | if [ -z "${EXTENSIONS##*,intl,*}" ]; then 165 | echo "---------- Install intl ----------" 166 | apk add --no-cache icu-dev 167 | docker-php-ext-install ${MC} intl 168 | fi 169 | 170 | if [ -z "${EXTENSIONS##*,bz2,*}" ]; then 171 | echo "---------- Install bz2 ----------" 172 | apk add --no-cache bzip2-dev 173 | docker-php-ext-install ${MC} bz2 174 | fi 175 | 176 | if [ -z "${EXTENSIONS##*,soap,*}" ]; then 177 | echo "---------- Install soap ----------" 178 | docker-php-ext-install ${MC} soap 179 | fi 180 | 181 | if [ -z "${EXTENSIONS##*,xsl,*}" ]; then 182 | echo "---------- Install xsl ----------" 183 | apk add --no-cache libxslt-dev 184 | docker-php-ext-install ${MC} xsl 185 | fi 186 | 187 | if [ -z "${EXTENSIONS##*,xmlrpc,*}" ]; then 188 | echo "---------- Install xmlrpc ----------" 189 | apk add --no-cache libxslt-dev 190 | docker-php-ext-install ${MC} xmlrpc 191 | fi 192 | 193 | if [ -z "${EXTENSIONS##*,wddx,*}" ]; then 194 | echo "---------- Install wddx ----------" 195 | apk add --no-cache libxslt-dev 196 | docker-php-ext-install ${MC} wddx 197 | fi 198 | 199 | if [ -z "${EXTENSIONS##*,curl,*}" ]; then 200 | echo "---------- Install curl ----------" 201 | docker-php-ext-install ${MC} curl 202 | fi 203 | 204 | if [ -z "${EXTENSIONS##*,readline,*}" ]; then 205 | echo "---------- Install readline ----------" 206 | apk add --no-cache readline-dev 207 | apk add --no-cache libedit-dev 208 | docker-php-ext-install ${MC} readline 209 | fi 210 | 211 | if [ -z "${EXTENSIONS##*,snmp,*}" ]; then 212 | echo "---------- Install snmp ----------" 213 | apk add --no-cache net-snmp-dev 214 | docker-php-ext-install ${MC} snmp 215 | fi 216 | 217 | if [ -z "${EXTENSIONS##*,pspell,*}" ]; then 218 | echo "---------- Install pspell ----------" 219 | apk add --no-cache aspell-dev 220 | apk add --no-cache aspell-en 221 | docker-php-ext-install ${MC} pspell 222 | fi 223 | 224 | if [ -z "${EXTENSIONS##*,recode,*}" ]; then 225 | echo "---------- Install recode ----------" 226 | apk add --no-cache recode-dev 227 | docker-php-ext-install ${MC} recode 228 | fi 229 | 230 | if [ -z "${EXTENSIONS##*,tidy,*}" ]; then 231 | echo "---------- Install tidy ----------" 232 | apk add --no-cache tidyhtml-dev=5.2.0-r1 --repository http://${ALPINE_REPOSITORIES}/alpine/v3.6/community 233 | docker-php-ext-install ${MC} tidy 234 | fi 235 | 236 | if [ -z "${EXTENSIONS##*,gmp,*}" ]; then 237 | echo "---------- Install gmp ----------" 238 | apk add --no-cache gmp-dev 239 | docker-php-ext-install ${MC} gmp 240 | fi 241 | 242 | if [ -z "${EXTENSIONS##*,imap,*}" ]; then 243 | echo "---------- Install imap ----------" 244 | apk add --no-cache imap-dev 245 | docker-php-ext-configure imap --with-imap --with-imap-ssl 246 | docker-php-ext-install ${MC} imap 247 | fi 248 | 249 | if [ -z "${EXTENSIONS##*,ldap,*}" ]; then 250 | echo "---------- Install ldap ----------" 251 | apk add --no-cache ldb-dev 252 | apk add --no-cache openldap-dev 253 | docker-php-ext-install ${MC} ldap 254 | fi 255 | 256 | if [ -z "${EXTENSIONS##*,imagick,*}" ]; then 257 | echo "---------- Install imagick ----------" 258 | apk add --no-cache file-dev 259 | apk add --no-cache imagemagick-dev 260 | printf "\n" | pecl install imagick-3.4.4 261 | docker-php-ext-enable imagick 262 | fi 263 | 264 | if [ -z "${EXTENSIONS##*,yaf,*}" ]; then 265 | echo "---------- Install yaf ----------" 266 | printf "\n" | pecl install yaf 267 | docker-php-ext-enable yaf 268 | fi -------------------------------------------------------------------------------- /extensions/php56.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | echo 4 | echo "============================================" 5 | echo "Install extensions from : ${MORE_EXTENSION_INSTALLER}" 6 | echo "PHP version : ${PHP_VERSION}" 7 | echo "Extra Extensions : ${PHP_EXTENSIONS}" 8 | echo "Multicore Compilation : ${MC}" 9 | echo "Work directory : ${PWD}" 10 | echo "============================================" 11 | echo 12 | 13 | 14 | if [ -z "${EXTENSIONS##*,mcrypt,*}" ]; then 15 | echo "---------- Install mcrypt ----------" 16 | apk add --no-cache libmcrypt-dev \ 17 | && docker-php-ext-install ${MC} mcrypt 18 | fi 19 | 20 | 21 | if [ -z "${EXTENSIONS##*,mysql,*}" ]; then 22 | echo "---------- Install mysql ----------" 23 | docker-php-ext-install ${MC} mysql 24 | fi 25 | 26 | 27 | if [ -z "${EXTENSIONS##*,sodium,*}" ]; then 28 | echo "---------- Install sodium ----------" 29 | apk add --no-cache libsodium-dev 30 | docker-php-ext-install ${MC} sodium 31 | fi 32 | 33 | 34 | if [ -z "${EXTENSIONS##*,redis,*}" ]; then 35 | echo "---------- Install redis ----------" 36 | mkdir redis \ 37 | && tar -xf redis-4.1.1.tgz -C redis --strip-components=1 \ 38 | && ( cd redis && phpize && ./configure && make ${MC} && make install ) \ 39 | && docker-php-ext-enable redis 40 | fi 41 | 42 | 43 | if [ -z "${EXTENSIONS##*,memcached,*}" ]; then 44 | echo "---------- Install memcached ----------" 45 | apk add --no-cache libmemcached-dev zlib-dev 46 | printf "\n" | pecl install memcached-2.2.0 47 | docker-php-ext-enable memcached 48 | fi 49 | 50 | 51 | if [ -z "${EXTENSIONS##*,xdebug,*}" ]; then 52 | echo "---------- Install xdebug ----------" 53 | mkdir xdebug \ 54 | && tar -xf xdebug-2.5.5.tgz -C xdebug --strip-components=1 \ 55 | && ( cd xdebug && phpize && ./configure && make ${MC} && make install ) \ 56 | && docker-php-ext-enable xdebug 57 | fi 58 | 59 | 60 | if [ -z "${EXTENSIONS##*,swoole,*}" ]; then 61 | echo "---------- Install swoole ----------" 62 | mkdir swoole \ 63 | && tar -xf swoole-2.0.11.tgz -C swoole --strip-components=1 \ 64 | && ( cd swoole && phpize && ./configure --enable-openssl && make ${MC} && make install ) \ 65 | && docker-php-ext-enable swoole 66 | fi 67 | 68 | if [ -z "${EXTENSIONS##*,pdo_sqlsrv,*}" ]; then 69 | echo "---------- Install pdo_sqlsrv ----------" 70 | echo "pdo_sqlsrv requires PHP >= 7.1.0, installed version is ${PHP_VERSION}" 71 | fi 72 | 73 | if [ -z "${EXTENSIONS##*,sqlsrv,*}" ]; then 74 | echo "---------- Install sqlsrv ----------" 75 | echo "pdo_sqlsrv requires PHP >= 7.1.0, installed version is ${PHP_VERSION}" 76 | fi 77 | 78 | if [ -z "${EXTENSIONS##*,mongodb,*}" ]; then 79 | echo "---------- Install mongodb ----------" 80 | apk add --no-cache unixodbc-dev 81 | printf "\n" | pecl install mongodb 82 | docker-php-ext-enable mongodb 83 | fi 84 | 85 | if [ -z "${EXTENSIONS##*,xhprof,*}" ]; then 86 | echo "---------- Install xhprof ----------" 87 | apk add --no-cache unixodbc-dev 88 | printf "\n" | pecl install xhprof-beta 89 | docker-php-ext-enable xhprof 90 | fi 91 | -------------------------------------------------------------------------------- /extensions/php72.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | echo 4 | echo "============================================" 5 | echo "Install extensions from : ${MORE_EXTENSION_INSTALLER}" 6 | echo "PHP version : ${PHP_VERSION}" 7 | echo "Extra Extensions : ${PHP_EXTENSIONS}" 8 | echo "Multicore Compilation : ${MC}" 9 | echo "Work directory : ${PWD}" 10 | echo "============================================" 11 | echo 12 | 13 | 14 | if [ -z "${EXTENSIONS##*,mcrypt,*}" ]; then 15 | echo "---------- mcrypt was REMOVED from PHP 7.2.0 ----------" 16 | fi 17 | 18 | 19 | if [ -z "${EXTENSIONS##*,mysql,*}" ]; then 20 | echo "---------- mysql was REMOVED from PHP 7.0.0 ----------" 21 | fi 22 | 23 | 24 | if [ -z "${EXTENSIONS##*,sodium,*}" ]; then 25 | echo "---------- Install sodium ----------" 26 | echo "Sodium is bundled with PHP from PHP 7.2.0 " 27 | fi 28 | 29 | 30 | if [ -z "${EXTENSIONS##*,redis,*}" ]; then 31 | echo "---------- Install redis ----------" 32 | mkdir redis \ 33 | && tar -xf redis-4.1.1.tgz -C redis --strip-components=1 \ 34 | && ( cd redis && phpize && ./configure && make ${MC} && make install ) \ 35 | && docker-php-ext-enable redis 36 | fi 37 | 38 | 39 | if [ -z "${EXTENSIONS##*,memcached,*}" ]; then 40 | echo "---------- Install memcached ----------" 41 | apk add --no-cache libmemcached-dev zlib-dev 42 | printf "\n" | pecl install memcached-3.1.3 43 | docker-php-ext-enable memcached 44 | fi 45 | 46 | 47 | if [ -z "${EXTENSIONS##*,xdebug,*}" ]; then 48 | echo "---------- Install xdebug ----------" 49 | mkdir xdebug \ 50 | && tar -xf xdebug-2.6.1.tgz -C xdebug --strip-components=1 \ 51 | && ( cd xdebug && phpize && ./configure && make ${MC} && make install ) \ 52 | && docker-php-ext-enable xdebug 53 | fi 54 | 55 | 56 | if [ -z "${EXTENSIONS##*,swoole,*}" ]; then 57 | echo "---------- Install swoole ----------" 58 | mkdir swoole \ 59 | && tar -xf swoole-4.2.1.tgz -C swoole --strip-components=1 \ 60 | && ( cd swoole && phpize && ./configure --enable-openssl && make ${MC} && make install ) \ 61 | && docker-php-ext-enable swoole 62 | fi 63 | 64 | if [ -z "${EXTENSIONS##*,pdo_sqlsrv,*}" ]; then 65 | echo "---------- Install pdo_sqlsrv ----------" 66 | apk add --no-cache unixodbc-dev 67 | pecl install pdo_sqlsrv 68 | docker-php-ext-enable pdo_sqlsrv 69 | fi 70 | 71 | if [ -z "${EXTENSIONS##*,sqlsrv,*}" ]; then 72 | echo "---------- Install sqlsrv ----------" 73 | apk add --no-cache unixodbc-dev 74 | printf "\n" | pecl install sqlsrv 75 | docker-php-ext-enable sqlsrv 76 | fi 77 | 78 | if [ -z "${EXTENSIONS##*,mongodb,*}" ]; then 79 | echo "---------- Install mongodb ----------" 80 | apk add --no-cache unixodbc-dev 81 | printf "\n" | pecl install mongodb 82 | docker-php-ext-enable mongodb 83 | fi 84 | 85 | if [ -z "${EXTENSIONS##*,tideways,*}" ]; then 86 | echo "---------- Install tideways ----------" 87 | mkdir tideways \ 88 | && tar -xf tideways-4.1.7.tar.gz -C tideways --strip-components=1 \ 89 | && ( cd tideways && phpize && ./configure && make ${MC} && make install ) \ 90 | && docker-php-ext-enable tideways 91 | fi 92 | -------------------------------------------------------------------------------- /extensions/redis-4.1.1.tgz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guanguans/dnmp-plus/a4e6302545130c89c966f89aeb148fe49f8c7808/extensions/redis-4.1.1.tgz -------------------------------------------------------------------------------- /extensions/swoole-2.0.11.tgz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guanguans/dnmp-plus/a4e6302545130c89c966f89aeb148fe49f8c7808/extensions/swoole-2.0.11.tgz -------------------------------------------------------------------------------- /extensions/swoole-4.2.1.tgz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guanguans/dnmp-plus/a4e6302545130c89c966f89aeb148fe49f8c7808/extensions/swoole-4.2.1.tgz -------------------------------------------------------------------------------- /extensions/tideways-4.1.7.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guanguans/dnmp-plus/a4e6302545130c89c966f89aeb148fe49f8c7808/extensions/tideways-4.1.7.tar.gz -------------------------------------------------------------------------------- /extensions/xdebug-2.5.5.tgz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guanguans/dnmp-plus/a4e6302545130c89c966f89aeb148fe49f8c7808/extensions/xdebug-2.5.5.tgz -------------------------------------------------------------------------------- /extensions/xdebug-2.6.1.tgz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/guanguans/dnmp-plus/a4e6302545130c89c966f89aeb148fe49f8c7808/extensions/xdebug-2.6.1.tgz -------------------------------------------------------------------------------- /log/nginx/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /log/php/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /log/xhprof/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /mongo/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore -------------------------------------------------------------------------------- /mysql/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore -------------------------------------------------------------------------------- /travis-build.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | #### halt script on error 4 | set -xe 5 | 6 | echo '##### Print docker version' 7 | docker --version 8 | 9 | echo '##### Print environment' 10 | env | sort 11 | 12 | #### Build the Docker Images 13 | 14 | cp env.sample .env 15 | cat .env 16 | cp docker-compose-sample.yml docker-compose.yml 17 | docker-compose up -d 18 | docker images 19 | -------------------------------------------------------------------------------- /www/localhost/index.php: -------------------------------------------------------------------------------- 1 | 欢迎使用DNMP-PLUS!'; 4 | echo '

版本信息

'; 5 | 6 | echo '
    '; 7 | echo '
  • PHP版本:', PHP_VERSION, '
  • '; 8 | echo '
  • Nginx版本:', $_SERVER['SERVER_SOFTWARE'], '
  • '; 9 | echo '
  • MySQL服务器版本:', getMysqlVersion(), '
  • '; 10 | echo '
  • Redis服务器版本:', getRedisVersion(), '
  • '; 11 | echo '
  • MongoDB服务器版本:', getMongoDBVersion(), '
  • '; 12 | echo '
'; 13 | 14 | echo '

已安装扩展

'; 15 | printExtensions(); 16 | 17 | 18 | /** 19 | * 获取MySQL版本 20 | */ 21 | function getMysqlVersion() 22 | { 23 | if (!extension_loaded('PDO_MYSQL')) { 24 | return 'PDO_MYSQL 扩展未安装 ×'; 25 | } 26 | 27 | try { 28 | $dbh = new PDO('mysql:host=mysql;dbname=mysql', 'root', '123456'); 29 | $sth = $dbh->query('SELECT VERSION() as version'); 30 | $info = $sth->fetch(); 31 | } catch (PDOException $e) { 32 | return $e->getMessage(); 33 | } 34 | 35 | return $info['version']; 36 | } 37 | 38 | /** 39 | * 获取MongoDB版本 40 | */ 41 | function getMongoDBVersion() 42 | { 43 | if (!extension_loaded('mongodb')) { 44 | return 'Mongodb 扩展未安装 ×'; 45 | } 46 | 47 | try { 48 | $manager = new MongoDB\Driver\Manager('mongodb://mongo:27017'); 49 | $command = new MongoDB\Driver\Command(['buildinfo' => true]); 50 | $cursor = $manager->executeCommand('admin', $command)->toArray(); 51 | 52 | return $cursor[0]->version; 53 | } catch (Exception $e) { 54 | return $e->getMessage(); 55 | } 56 | } 57 | 58 | /** 59 | * 获取Redis版本 60 | */ 61 | function getRedisVersion() 62 | { 63 | if (!extension_loaded('redis')) { 64 | return 'Redis 扩展未安装 ×'; 65 | } 66 | 67 | try { 68 | $redis = new Redis(); 69 | $redis->connect('redis', 6379); 70 | $info = $redis->info(); 71 | 72 | return $info['redis_version']; 73 | } catch (Exception $e) { 74 | return $e->getMessage(); 75 | } 76 | } 77 | 78 | /** 79 | * 获取已安装扩展列表 80 | */ 81 | function printExtensions() 82 | { 83 | $getLoadedExtensions = get_loaded_extensions(); 84 | echo '
    '; 85 | foreach ($getLoadedExtensions as $name) { 86 | if ($name === 'mongodb' 87 | || $name === 'mongo' 88 | || $name === 'tideways_xhprof' 89 | || $name === 'tideways' 90 | || $name === 'xhprof' 91 | ) { 92 | echo "
  1. ", $name, '=', phpversion($name), '
  2. '; 93 | } else { 94 | echo "
  3. ", $name, '=', phpversion($name), '
  4. '; 95 | } 96 | } 97 | echo '
'; 98 | } 99 | --------------------------------------------------------------------------------