7 企业级镜像仓库 Harbor

7.1 Harbor概述

Harbor是由VMWare公司开源的容器镜像仓库。事实上,Harbor是在Docker Registry上进行了相应的企业级扩展,从而获得了更加广泛的应用,这些新的企业级特性包括:管理用户界面,基于角色的访问控制,AD/LDAP集成以及审计日志等,足以满足基本企业需求。

Harbor 是由 VMware 公司中国团队为企业用户设计的 Registry server 开源项目,包括了权限管理 (RBAC)、LDAP、审计、管理界面、自我注册、HA 等企业必需的功能,同时针对中国用户的特点,设计镜像复制和中文支持等功能。

02 Docker 进阶部分 - 图1

作为一个企业级私有 Registry 服务器,Harbor 提供了更好的性能和安全。提升用户使用 Registry 构建和运行环境传输镜像的效率。Harbor 支持安装在多个 Registry 节点的镜像资源复制,镜像全部保存在私有 Registry 中, 确保数据和知识产权在公司内部网络中管控。另外,Harbor 也提供了高级的安全特性,诸如用户管理,访问控制和活动审计等。
  • 基于角色的访问控制 - 用户与 Docker 镜像仓库通过 “项目” 进行组织管理,一个用户可以对多个镜像仓库在同一命名空间(project)里有不同的权限。
  • 镜像复制 - 镜像可以在多个 Registry 实例中复制(同步)。尤其适合于负载均衡,高可用,混合云和多云的场景。
  • 图形化用户界面 - 用户可以通过浏览器来浏览,检索当前 Docker 镜像仓库,管理项目和命名空间。
  • AD/LDAP 支持 - Harbor 可以集成企业内部已有的 AD/LDAP,用于鉴权认证管理。
  • 审计管理 - 所有针对镜像仓库的操作都可以被记录追溯,用于审计管理。
  • 国际化 - 已拥有英文、中文、德文、日文和俄文的本地化版本。更多的语言将会添加进来。
  • RESTful API - RESTful API 提供给管理员对于 Harbor 更多的操控,使得与其它管理软件集成变得更容易。
  • 部署简单 - 提供在线和离线两种安装工具, 也可以安装到 vSphere 平台 (OVA 方式) 虚拟设备。

Pulic Reference:https://goharbor.io/

Reference:https://goharbor.io/docs/2.6.0/

Github:https://github.com/goharbor/harbor

7.2 Harbor HTTP/HTTPS搭建与使用

7.2.1 Harbor 部署先决条件

服务器硬件配置:

  • 最低要求:CPU2核 / 内存4G / 硬盘40GB。
  • 推荐:CPU4核 / 内存8G / 硬盘160GB

软件:

  • Docker 17.06版本+
  • Docker Compose 1.18版本+

Harbor 安装有 2 种方式:

  • 在线安装:从Docker Hub下载Harbor相关镜像,因此安装软件包非常小。
  • 离线安装:安装包包含部署的相关镜像,因此安装包比较大

7.2.2 Harbor 部署 HTTP

1、先安装Docker和Docker Compose

  1. # 官方站点
  2. https://github.com/docker/compose/releases
  3. # Docker Compose 存放在Git Hub,不太稳定。
  4. # 你可以也通过执行下面的命令,高速安装Docker Compose。
  5. curl -L https://get.daocloud.io/docker/compose/releases/download/v2.13.0/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose
  6. chmod +x /usr/local/bin/docker-compose
  7. # 你可以通过修改URL中的版本,可以自定义您的需要的版本。

2、部署Harbor HTTP

  1. # https://github.com/goharbor/harbor/releases/download/v2.6.2/harbor-offline-installer-v2.6.2.tgz
  2. $ tar -zxvf harbor-offline-installer-v2.6.2.tgz
  3. $ cd harbor
  4. $ cp harbor.yml.tmpl harbor.yml
  5. $ vim harbor.yml
  6. hostname: reg.kubesphere.com
  7. https: #先注释https相关配置
  8. harbor_admin_password: Harbor12345
  9. # 部署Harbor HTTP
  10. $ ./prepare
  11. $ ./install.sh

02 Docker 进阶部分 - 图2

  1. $ docker-compose ps
  2. Name Command State Ports
  3. -----------------------------------------------------------------------------------------------------------------
  4. harbor-core /harbor/entrypoint.sh Up (health: starting)
  5. harbor-db /docker-entrypoint.sh 96 13 Up (health: starting)
  6. harbor-jobservice /harbor/entrypoint.sh Up (health: starting)
  7. harbor-log /bin/sh -c /usr/local/bin/ ... Up (health: starting) 127.0.0.1:1514->10514/tcp
  8. harbor-portal nginx -g daemon off; Up (health: starting)
  9. nginx nginx -g daemon off; Up (health: starting) 0.0.0.0:80->8080/tcp,:::80->8080/tcp
  10. redis redis-server /etc/redis.conf Up (health: starting)
  11. registry /home/harbor/entrypoint.sh Up (health: starting)
  12. registryctl /home/harbor/start.sh Up (health: starting)

浏览器访问http://<IP地址>:80也可以修改主机的host文件将IP地址 域名进行绑定

默认用户名:admin

默认密码:Harbor12345

02 Docker 进阶部分 - 图3

Harbor 的主界面

02 Docker 进阶部分 - 图4

  1. cat >> /etc/hosts <<EOF
  2. # KubeSphere Harbor Host BEGIN
  3. 10.0.0.100 reg.kubesphere.com
  4. # KubeSphere Harbor Host END
  5. EOF

7.2.3 Harbor 基本使用

1、配置 HTTP 镜像仓库可信任

  1. $ vi /etc/docker/daemon.json
  2. {"insecure-registries": ["reg.kubesphere.com"]}
  3. $ systemctl restart docker
  4. $ docker info | grep -A 2 "Insecure Registries"
  5. Insecure Registries:
  6. reg.kubesphere.com
  7. 127.0.0.0/8
  8. # 重启Docker服务后,需要确保 Harbor Docker 容器的正常运行

2、登录到Harbor镜像仓库

  1. $ docker login --username=admin --password="Harbor12345" reg.kubesphere.com
  2. WARNING! Using --password via the CLI is insecure. Use --password-stdin.
  3. WARNING! Your password will be stored unencrypted in /root/.docker/config.json.
  4. Configure a credential helper to remove this warning. See
  5. https://docs.docker.com/engine/reference/commandline/login/#credentials-store
  6. Login Succeeded

02 Docker 进阶部分 - 图5

2、打标签

  1. $ docker tag centos:centos7.9.2009 reg.kubesphere.com/library/centos:centos7.9.2009
  2. # reg.kubesphere.com/library/centos:centos7.9.2009
  3. # 镜像中心/项目/镜像:标签

02 Docker 进阶部分 - 图6

3、上传

  1. $ docker push reg.kubesphere.com/library/centos:centos7.9.2009

02 Docker 进阶部分 - 图7

4、下载

  1. $ docker pull reg.kubesphere.com/library/centos:centos7.9.2009

7.2.4 Harbor 部署 HTTPS

1、生成SSL证书

  1. $ mkdir -pv harbor/ssl ; cd harbor/ssl
  2. $ cat > cfssl.sh <<EOF
  3. #!/bin/bash
  4. wget https://pkg.cfssl.org/R1.2/cfssl_linux-amd64
  5. wget https://pkg.cfssl.org/R1.2/cfssljson_linux-amd64
  6. wget https://pkg.cfssl.org/R1.2/cfssl-certinfo_linux-amd64
  7. chmod +x cfssl*
  8. mv cfssl_linux-amd64 /usr/bin/cfssl
  9. mv cfssljson_linux-amd64 /usr/bin/cfssljson
  10. mv cfssl-certinfo_linux-amd64 /usr/bin/cfssl-certinfo
  11. EOF
  12. $ cfssl
  13. cfssl cfssl-certinfo cfssljson
  14. cat > ca-config.json <<EOF
  15. {
  16. "signing": {
  17. "default": {
  18. "expiry": "87600h"
  19. },
  20. "profiles": {
  21. "kubernetes": {
  22. "expiry": "87600h",
  23. "usages": [
  24. "signing",
  25. "key encipherment",
  26. "server auth",
  27. "client auth"
  28. ]
  29. }
  30. }
  31. }
  32. }
  33. EOF
  34. cat > ca-csr.json <<EOF
  35. {
  36. "CN": "kubernetes",
  37. "key": {
  38. "algo": "rsa",
  39. "size": 2048
  40. },
  41. "names": [
  42. {
  43. "C": "CN",
  44. "L": "Beijing",
  45. "ST": "Beijing"
  46. }
  47. ]
  48. }
  49. EOF
  50. $ cfssl gencert -initca ca-csr.json | cfssljson -bare ca -
  51. cat > reg.kubesphere.com-csr.json <<EOF
  52. {
  53. "CN": "reg.kubesphere.com",
  54. "hosts": [],
  55. "key": {
  56. "algo": "rsa",
  57. "size": 2048
  58. },
  59. "names": [
  60. {
  61. "C": "CN",
  62. "L": "Beijing",
  63. "ST": "Beijing"
  64. }
  65. ]
  66. }
  67. EOF
  68. $ cfssl gencert -ca=ca.pem -ca-key=ca-key.pem -config=ca-config.json -profile=kubernetes reg.kubesphere.com-csr.json | cfssljson -bare reg.kubesphere.com

生成证书脚本

  1. #!/bin/bash
  2. cat > ca-config.json <<EOF
  3. {
  4. "signing": {
  5. "default": {
  6. "expiry": "87600h"
  7. },
  8. "profiles": {
  9. "kubernetes": {
  10. "expiry": "87600h",
  11. "usages": [
  12. "signing",
  13. "key encipherment",
  14. "server auth",
  15. "client auth"
  16. ]
  17. }
  18. }
  19. }
  20. }
  21. EOF
  22. cat > ca-csr.json <<EOF
  23. {
  24. "CN": "kubernetes",
  25. "key": {
  26. "algo": "rsa",
  27. "size": 2048
  28. },
  29. "names": [
  30. {
  31. "C": "CN",
  32. "L": "Beijing",
  33. "ST": "Beijing"
  34. }
  35. ]
  36. }
  37. EOF
  38. cfssl gencert -initca ca-csr.json | cfssljson -bare ca -
  39. cat > reg.kubesphere.com-csr.json <<EOF
  40. {
  41. "CN": "reg.kubesphere.com",
  42. "hosts": [],
  43. "key": {
  44. "algo": "rsa",
  45. "size": 2048
  46. },
  47. "names": [
  48. {
  49. "C": "CN",
  50. "L": "Beijing",
  51. "ST": "Beijing"
  52. }
  53. ]
  54. }
  55. EOF
  56. cfssl gencert -ca=ca.pem -ca-key=ca-key.pem -config=ca-config.json -profile=kubernetes reg.kubesphere.com-csr.json | cfssljson -bare reg.kubesphere.com

2、Harbor启用HTTPS

  1. $ vim harbor.yml
  2. https:
  3. port:443
  4. certificate: /root/harbor/ssl/reg.kubesphere.com.pem
  5. private_key: /root/harbor/ssl/reg.kubesphere.com-key.pem

3、重新配置并部署Harbor

  1. $ ./prepare
  2. $ docker-compose down
  3. $ docker-compose up -d
  4. $ docker-compose ps -a
  5. Name Command State Ports
  6. -----------------------------------------------------------------------------------------------------------------------------------------------harbor-core /harbor/entrypoint.sh Up (healthy)
  7. harbor-db /docker-entrypoint.sh 96 13 Up (healthy)
  8. harbor-jobservice /harbor/entrypoint.sh Up (healthy)
  9. harbor-log /bin/sh -c /usr/local/bin/ ... Up (healthy) 127.0.0.1:1514->10514/tcp
  10. harbor-portal nginx -g daemon off; Up (healthy)
  11. nginx nginx -g daemon off; Up (healthy) 0.0.0.0:80->8080/tcp,:::80->8080/tcp,
  12. 0.0.0.0:443->8443/tcp,:::443->8443/tcp
  13. redis redis-server /etc/redis.conf Up (healthy)
  14. registry /home/harbor/entrypoint.sh Up (healthy)
  15. registryctl /home/harbor/start.sh Up (healthy)

浏览器访问:http:s//<IP地址>也可以修改主机的host文件将IP地址 域名进行绑定

默认用户名:admin

默认密码:Harbor12345

02 Docker 进阶部分 - 图8

浏览器的证书查看

02 Docker 进阶部分 - 图9

Harbor 镜像仓库可以正常使用

02 Docker 进阶部分 - 图10

4、将数字证书复制到Docker主机

  1. $ cat >> /etc/hosts <<EOF
  2. # KubeSphere Harbor Host BEGIN
  3. 10.0.0.100 reg.kubesphere.com
  4. # KubeSphere Harbor Host END
  5. EOF
  6. # 添加证书
  7. $ mkdir -pv /etc/docker/certs.d/reg.kubesphere.com
  8. $ cp reg.kubesphere.com.pem /etc/docker/certs.d/reg.kubesphere.com/reg.kubesphere.com.crt
  9. $ vim /etc/docker/daemon.json
  10. {
  11. "registry-mirrors": ["https://po13h3y1.mirror.aliyuncs.com","http://hub-mirror.c.163.com","https://mirror.ccs.tencentyun.com","http://f1361db2.m.daocloud.io"],
  12. "exec-opts": ["native.cgroupdriver=systemd"],
  13. "log-driver": "json-file",
  14. "log-opts": {
  15. "max-size": "100m"
  16. },
  17. "storage-driver": "overlay2",
  18. "insecure-registries": ["reg.kubesphere.com"]
  19. }
  20. $ docker login --username="admin" --password="Harbor12345" reg.kubesphere.com

02 Docker 进阶部分 - 图11

5、验证

  1. # 拉取 Harbor 镜像仓库中的镜像
  2. $ docker pull reg.kubesphere.com/library/centos:centos7.9.2009
  3. # 推送 Harbor 镜像仓库中的镜像
  4. $ docker pull nginx
  5. $ docker tag nginx:latest reg.kubesphere.com/library/nginx:latest
  6. $ docker push reg.kubesphere.com/library/nginx:latest
  7. # 浏览器Harbor可以查看到Nginx的镜像仓库

02 Docker 进阶部分 - 图12

7.3 Harbor 主从复制

:::color1 主备

:::

02 Docker 进阶部分 - 图13

  • 简单,主挂了切到备Harbor
  • 同一时间只有一台提供服务
  • 适合少量镜像下载

:::color1 双主复制

:::

02 Docker 进阶部分 - 图14

  • 双向配置复制
  • 两台同时提供服务
  • 前面增加负载均衡器

:::color1 一主多从

:::

02 Docker 进阶部分 - 图15

  • 双向配置复制
  • 适合多地区业务、大量镜像下载需求

:::color1 Harbor 主备模式的部署

:::

前期已经将 10.0.0.100 的Harbor镜像仓库搭建完毕,现在将 10.0.0.101 的Harbor镜像仓库搭建成功

  1. # 官方站点
  2. https://github.com/docker/compose/releases
  3. # Docker Compose 存放在Git Hub,不太稳定。
  4. # 你可以也通过执行下面的命令,高速安装Docker Compose。
  5. curl -L https://get.daocloud.io/docker/compose/releases/download/v2.13.0/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose
  6. chmod +x /usr/local/bin/docker-compose
  7. # 你可以通过修改URL中的版本,可以自定义您的需要的版本。
  1. # 10.0.0.101 操作执行
  2. # https://github.com/goharbor/harbor/releases/download/v2.6.2/harbor-offline-installer-v2.6.2.tgz
  3. # scp -r root@10.0.0.100:/root/harbor-offline-installer-v2.6.2.tgz .
  4. $ tar -zxvf harbor-offline-installer-v2.6.2.tgz
  5. $ cd harbor
  6. $ cp harbor.yml.tmpl harbor.yml
  7. $ vim harbor.yml
  8. hostname: 10.0.0.101
  9. https:
  10. port:443
  11. certificate: /root/harbor/ssl/reg.kubesphere.com.pem
  12. private_key: /root/harbor/ssl/reg.kubesphere.com-key.pem
  13. harbor_admin_password: Harbor12345
  14. # HTTPS 对Harbor的主备模式没有影响
  15. # 部署Harbor HTTP
  16. $ ./prepare
  17. $ ./install.sh
  18. $ docker-compose ps
  19. Name Command State Ports
  20. -----------------------------------------------------------------------------------------------------------------------------------------------harbor-core /harbor/entrypoint.sh Up (health: starting)
  21. harbor-db /docker-entrypoint.sh 96 13 Up (health: starting)
  22. harbor-jobservice /harbor/entrypoint.sh Up (health: starting)
  23. harbor-log /bin/sh -c /usr/local/bin/ ... Up (health: starting) 127.0.0.1:1514->10514/tcp
  24. harbor-portal nginx -g daemon off; Up (health: starting)
  25. nginx nginx -g daemon off; Up (health: starting) 0.0.0.0:80->8080/tcp,:::80->8080/tcp,
  26. 0.0.0.0:443->8443/tcp,:::443->8443/tcp
  27. redis redis-server /etc/redis.conf Up (health: starting)
  28. registry /home/harbor/entrypoint.sh Up (health: starting)
  29. registryctl /home/harbor/start.sh Up (health: starting)

:::color1 登录到主的Harbor配置相应的策略

:::

  • 仓库管理配置

02 Docker 进阶部分 - 图16

02 Docker 进阶部分 - 图17

02 Docker 进阶部分 - 图18

  • 复制管理配置

02 Docker 进阶部分 - 图19

02 Docker 进阶部分 - 图20

:::color1 测试推送镜像到主Harbor的镜像仓库

:::

  1. # 拉取hello-world镜像
  2. $ docker pull hello-world
  3. $ docker tag hello-world reg.kubesphere.com/library/hello-world:v1.0
  4. $ docker push reg.kubesphere.com/library/hello-world:v1.0
  5. # 查看harbor的镜像复制情况

02 Docker 进阶部分 - 图21

:::color1 查看备Harbor的镜像仓库镜像同步成功

:::

02 Docker 进阶部分 - 图22

7.4 Harbor运维维护

Reference:

https://goharbor.io/docs/2.6.0/install-config/

https://goharbor.io/docs/2.6.0/administration/

https://goharbor.io/docs/2.6.0/working-with-projects/

  • 创建项目

02 Docker 进阶部分 - 图23

02 Docker 进阶部分 - 图24

  • 创建用户

02 Docker 进阶部分 - 图25

02 Docker 进阶部分 - 图26


容器 功能
harbor-core 配置管理中心
harbor-db PG数据库
harbor-jobservice 负责镜像复制
harbor-log 记录操作日志
harbor-portal Web管理页面和API
nginx 前端代理,负责前端页面和镜像上传/下载转发
redis 会话
registryctl 镜像存储

:::color5 容器数据持久化目录:/data[ 定时备份,data目录下有harbor-db数据库的数据 ]

日志文件目录:/var/log/harbor

必须保证 Harbor 的Docker容器运行正常:docker-compose ps

数据库做好定期备份。

:::

8 Docker 图形化界面管理

8.1 Portainer概述

Portainer 是一款轻量级的应用,它提供了图形化界面,用于方便的管理Docker环境,包括单机环境和集群环境(毫不犹豫直接使用 K8S)。用于监控和统计 Portainer是一个可视化的容器镜像的图形管理工具,利用Portainer可以轻松构建,管理和维护Docker环境。 而且完全免费,基于容器化的安装方式,方便高效部署。

官网:https://www.portainer.io/

安装文档:Install Portainer with Docker on Linux - Portainer Documentation

简述工作原理

Portainer 就是一个web程序,我们首先部署在自己的服务器上,运行成功后,我们通过浏览器访问这个应用,首先将我们的docker集群添加到这个应用,打开页面左侧有endpoint设置入口,这是设置安装docker的机器设置进去,docker提供了远程访问的接口,当然首先是我们自己在安装docker后开启,默认的端口是2375,然后将具体的机器ip:2375添加进去,添加成功后,我们就可以通过连接具体的docker机器,在可视化的界面上进行docker任务操作,比如在连接的docker机器拉取镜像,创建容器,运行容器,这些操作都是Portainer 应用通过之前设置的endpoint进行远程调用执行,这样做后,就不需要我们登录到具体的机器进行docker命令的操作。

8.2 Portainer部署

  1. # 9443 端口是 HTTPS
  2. # --restart=always 在Docker重启服务之后会自动启动
  3. $ docker run -d -p 8000:8000 -p 9000:9000 -p 9443:9443 --name portainer \
  4. --restart=always \
  5. -v /var/run/docker.sock:/var/run/docker.sock \
  6. -v portainer_data:/data \
  7. portainer/portainer

:::color5 拓展:Portainer 的 8000 端口的作用

  1. Portainer容器运行,同时需要暴露8000端口,方便Portainer通过端口8000与边缘代理进行通信
  2. 在被需要管理的端点上运行portainer-agent容器
  3. Portainer与边缘断点建立连接,进行通信

:::

:::warning

用户名,直接用默认admin

(密码记得8位,随便你写)

:::

02 Docker 进阶部分 - 图27

  • 选择”Local”的选项卡

02 Docker 进阶部分 - 图28

  • 选择local选项卡后本地docker详细信息显示

02 Docker 进阶部分 - 图29

  • 使用 Portainer 模板创建容器

02 Docker 进阶部分 - 图30

02 Docker 进阶部分 - 图31

  • Portainer 查看容器的详细信息显示[<font style="color:rgb(51, 51, 51);">由docker inspect命令做可视化界面</font>]

02 Docker 进阶部分 - 图32

8.3 Portainer 管理Docker主机

  1. # 管理其他Docker主机,需要开启Docker API:
  2. $ sudo vi /usr/lib/systemd/system/docker.service
  3. ExecStart=/usr/bin/dockerd -H tcp://0.0.0.0:2375 -H unix:///var/run/docker.sock
  4. $ sudo systemctl daemon-reload && sudo systemctl restart docker

02 Docker 进阶部分 - 图33

  • Portainer 添加 Docker 主机[ 选择Docker连接Docker的API地址即可 ]

02 Docker 进阶部分 - 图34

02 Docker 进阶部分 - 图35

  • Portainer 连接 Docker Host 就成功了。[<font style="color:#74B602;">State:UP状态即可</font>]

02 Docker 进阶部分 - 图36

:::color5 需要注意:主机的防火墙策略放通,端口是否监听,以及容器正常启动。

:::

9 单机容器编排 Docker Compose

:::color5

  1. 涉及容器的启动顺序和加载条件及要求
  2. 容器越来越多,如何统一管理起来

:::

9.1 Compose是什么?

Compose是用于定义和运行多容器的工具。通过Compose可以使用YAML文件来配置容器。然后,使用一个命令就可以从配置中创建并启动所有服务。

使用Compose大致为三步:

  • 定义Dockerfile,以便可以在任意环境运行
  • 定义应用程序启动配置文件**<font style="color:#601BDE;">docker-compose.yml</font>**
  • docker-compose启动并管理整个应用程序生命周期

官方文档: https://docs.docker.com/compose/

Docker-compose 是 Docker 官方的开源项目,负责实现对 Docker 容器集群的快速编排

Docker-compose 是 Docker 公司推出的一个工具软件,可以管理多个 Docker 容器组成一个应用。需要定义一个YAML格式的配置文件 docker-compose.yml写好多个容器之间的调用关系。然后,只要一个命令,就能同时启动/关闭这些容器。

:::color1 docker-compose 还是非常爽的,用了以后,完全不像用 docker 启动容器

最简单的理解就是把多个docker容器的启动命令写在一个脚本里,批量启动容器(写好多个容器之间的命令关系)

:::

画板

Docker-compose 能干嘛

Docker 建议我们每一个容器中只运行一个服务,因为docker容器本身占用资源极少,所以最好是将服务单独的分割开来,但是这样我们又面临了一个问题?

如果我们需要同时部署好多个服务,难道要每个服务单独写Dockerfile,然后再构建镜像,镜像容器,这样会很累,所以docker官方给我们提供了 docker-compose 多服务部署工具。

例如要实现一个Web微服务项目,除了Web服务容器本身,往往还需要再加上后端的数据库mysql服务容器,redis服务器,注册中心eureka,甚至还包括负载均衡容器等等。。。

Compose 允许用户通过一个单独的 docker-compose.yml 模板文件(YAML格式)来定义一组相关联的应用容器为一个项目(project)

可以很容易的用一个配置文件定义一个/一组多容器的应用,然后使用一条指令安装这个应用的所有依赖,完成构建。Docker-Compose解决了容器与容器之间如何管理编排的问题。

:::color1 Docker compose 是单机(本机)的多容器管理技术

K8s 是跨主机的集群部署工具

:::

Docker-Compose 的官网:https://docs.docker.com/compose/compose-file/compose-file-v3/

https://docs.docker.com/compose/install/

GitHub 项目地址:https://github.com/docker/compose

9.2 Linux安装Compose

  1. $ sudo curl -L "https://github.com/docker/compose/releases/download/v1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
  2. # curl -SL https://github.com/docker/compose/releases/download/v2.7.0/docker-compose-$(uname -s)-$(uname -m) -o /usr/local/bin/docker-compose
  3. # curl -SL https://github.com/docker/compose/releases/download/v2.7.0/docker-compose-linux-x86_64 -o /usr/local/bin/docker-compose
  4. # 若无法下载,则科学上网
  5. # sudo curl -L https://get.daocloud.io/docker/compose/releases/download/1.25.1/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose
  6. # 添加执行权限
  7. $ sudo chmod +x /usr/local/bin/docker-compose
  8. $ sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose
  9. $ docker-compose version
  10. docker-compose version 1.25.1, build a82fef07
  11. docker-py version: 4.1.0
  12. CPython version: 3.7.4
  13. OpenSSL version: OpenSSL 1.1.0l 10 Sep 2019

拓展:删除 Docker-Compose

  1. $ sudo rm -rf /usr/local/bin/docker-compose

:::color5

  1. 编写 <font style="color:#E8323C;">Dockerfile</font> 定义各个微服务应用并构建出对应的镜像文件
  2. 使用 <font style="color:#E8323C;">docker-compose.yml</font>定义一个完整业务单元,安排好整体应用中的各个容器服务
  3. 最后,执行 <font style="color:#E8323C;">docker-compose -f docker-compose.yml up -d</font> 命令来启动并运行整体应用程序,完成一键部署上线 [ 等价于一次性运行了多次 docker run …… ]
  4. docker-compose 脚本 类似于 Shell 脚本 (Docker-compose 可以使用 Shell 实现)

:::

9.3 Compose 常用选项与命令

9.3.1 Docker-Compose 常用选项和命令

常用选项:

  • -f,—file指定yaml文件,默认**<font style="color:#601BDE;">docker-compose.yml</font>**
  • -p,—project-name指定项目名称,默认是当前目录
命令 描述
build 重新构建服务
ps 列出容器
up 创建和启动容器
exec 在容器里执行命令
scale 指定一个服务容器启动数量( 指定副本数 )
down 删除容器、网络、数据卷和镜像
stop / start / restart 停止 / 启动 / 重启服务

:::color5 Compose 常用命令

  • docker-compose -h —-> 查看帮助
  • docker-compose up —-> 启动所有docker-compose服务
  • docker-compose up -d ---> 启动服务 docker-compose 服务,并后台运行
  • docker-compose down ---> 停止并删除容器、网络、卷、镜像
  • docker-compose exec yml里面的服务id —-> 进入容器实例内部 docker-compose exec docker-compose.yml文件中写的服务id /bin/bash
  • docker-compose ps —-> 展示当前 docker-compose 编排过的运行的所有容器
  • docker-compose top —-> 展示当前 docker-compose 编排过的容器进程
  • docker-compose logs yml里面的服务id —-> 检查容器输出日志
  • docker-compose config ---> 检查配置
  • docker-compose config -q ---> 检查配置,有问题才有输出
  • docker-compose restart —-> 重启服务
  • docker-compose start —-> 启动服务
  • docker-compose stop —-> 停止服务

:::

9.3.2 Docker-Compose.yml 文件常用选项

字段 描述 示例
build
dockerfile
context
构建选项
指定Dockerfile文件名
构建镜像上下文路径
build:
context: ./dir
dockerfile: Dockerfile
image 指定镜像 image: webapp:tag
command 容器中执行命令,覆盖默认命令 command: bundle exec thin -p 3000
command: [“bundle”, “exec”, “thin”, “-p”, “3000”]
container_name 指定容器名称,由于容器名称是唯一的,如果指定自定义名称,则无法scale container_name: my-web-container
environment 添加环境变量 environment:
- RACK_ENV=development
- SHOW=true
networks 加入网络,引用顶级networks下条目 networks:
- new
ports 暴露端口,与-p相同,但端口不能低于60 ports:
- “80:80”
- “6060:6060/udp”
extra_hosts 添加主机名映射,与—add-host相同 extra_hosts:
- “somehost:162.242.195.82”
- “otherhost:50.31.209.229”
volumes 挂载宿主机路径或数据卷。如果是命名卷在顶级volumes定义卷名称 volumes:
- /opt/data:/var/lib/mysql
- datavolume:/var/lib/mysql
restart 重启策略,默认no, always l on-failure unless-stopped restart: always
hostname 容器主机名 hostname: foo

9.4 docker-compose.yml 编排

  1. version: '3'
  2. services:
  3. web:
  4. image: nginx
  5. ports:
  6. - "80:80"
  7. networks:
  8. - test
  9. db:
  10. image: mysql:5.7
  11. command: --character-set-server=utf8
  12. environment:
  13. - MYSQL_ROOT_PASSWORD=123456
  14. volumes:
  15. - "mysqldata:/var/lib/mysql"
  16. networks:
  17. - test
  18. networks:
  19. test:
  20. volumes:
  21. mysqldata: {}
  1. $ docker-compose up -d
  2. $ docker-compose ps
  3. Name Command State Ports
  4. ---------------------------------------------------------------------------------------------
  5. nginx-mysql_db_1 docker-entrypoint.sh --cha ... Up 3306/tcp, 33060/tcp
  6. nginx-mysql_web_1 /docker-entrypoint.sh ngin ... Up 0.0.0.0:80->80/tcp,:::80->80/tcp
  7. # 浏览器访问:http://<IP地址>:80
  8. $ curl 127.0.0.1
  9. <!DOCTYPE html>
  10. <html>
  11. <head>
  12. <title>Welcome to nginx!</title>
  13. <style>
  14. html { color-scheme: light dark; }
  15. body { width: 35em; margin: 0 auto;
  16. font-family: Tahoma, Verdana, Arial, sans-serif; }
  17. </style>
  18. </head>
  19. <body>
  20. <h1>Welcome to nginx!</h1>
  21. <p>If you see this page, the nginx web server is successfully installed and
  22. working. Further configuration is required.</p>
  23. <p>For online documentation and support please refer to
  24. <a href="http://nginx.org/">nginx.org</a>.<br/>
  25. Commercial support is available at
  26. <a href="http://nginx.com/">nginx.com</a>.</p>
  27. <p><em>Thank you for using nginx.</em></p>
  28. </body>
  29. </html>
  30. # 指定副本数
  31. $ docker-compose scale db=2
  32. # 注意容器的端口冲突问题
  33. $ docker-compose ps
  34. Name Command State Ports
  35. ---------------------------------------------------------------------------------------------
  36. nginx-mysql_db_1 docker-entrypoint.sh --cha ... Up 3306/tcp, 33060/tcp
  37. nginx-mysql_db_2 docker-entrypoint.sh --cha ... Up 3306/tcp, 33060/tcp
  38. nginx-mysql_web_1 /docker-entrypoint.sh ngin ... Up 0.0.0.0:80->80/tcp,:::80->80/tcp
  39. # Docker-Compose 容器停止
  40. $ docker-compose stop
  41. $ docker-compose ps
  42. Name Command State Ports
  43. -------------------------------------------------------------------
  44. nginx-mysql_db_1 docker-entrypoint.sh --cha ... Exit 0
  45. nginx-mysql_db_2 docker-entrypoint.sh --cha ... Exit 1
  46. nginx-mysql_web_1 /docker-entrypoint.sh ngin ... Exit 0
  47. # Docker-Compose 容器启动
  48. $ docker-compose start
  49. $ docker-compose ps
  50. Name Command State Ports
  51. ---------------------------------------------------------------------------------------------
  52. nginx-mysql_db_1 docker-entrypoint.sh --cha ... Up 3306/tcp, 33060/tcp
  53. nginx-mysql_db_2 docker-entrypoint.sh --cha ... Up 3306/tcp, 33060/tcp
  54. nginx-mysql_web_1 /docker-entrypoint.sh ngin ... Up 0.0.0.0:80->80/tcp,:::80->80/tcp

范例:使用 -p 指定项目名

  1. # 需要 -p 指定项目名
  2. $ docker-compose -p kubespehre -f docker-compose.yml up -d
  3. $ docker-compose -p kubespehre -f docker-compose.yml ps
  4. Name Command State Ports
  5. --------------------------------------------------------------------------------------------
  6. kubespehre_db_1 docker-entrypoint.sh --cha ... Up 3306/tcp, 33060/tcp
  7. kubespehre_web_1 /docker-entrypoint.sh ngin ... Up 0.0.0.0:80->80/tcp,:::80->80/tcp

9.5 案例1:一键部署LNMP网站平台

  1. mkdir -pv mkdir compose-lnmp/{nginx,mysql,php,wwwroot}

docker-compose.yml 文件示例

  1. cat > docker-compose.yml <<EOF
  2. version: '3'
  3. services:
  4. nginx:
  5. hostname: nginx
  6. build:
  7. context: ./nginx
  8. dockerfile: Dockerfile
  9. ports:
  10. - 80:80
  11. networks:
  12. - lnmp
  13. volumes:
  14. - ./nginx/php.conf:/usr/local/nginx/conf/vhost/php.conf
  15. - ./wwwroot:/usr/local/nginx/html
  16. php:
  17. hostname: php
  18. build:
  19. context: ./php
  20. dockerfile: Dockerfile
  21. networks:
  22. - lnmp
  23. volumes:
  24. - ./wwwroot:/usr/local/nginx/html
  25. mysql:
  26. hostname: mysql
  27. image: mysql:5.7
  28. ports:
  29. - 3306:3306
  30. networks:
  31. - lnmp
  32. volumes:
  33. - ./mysql/conf:/etc/mysql/conf.d
  34. - ./mysql/data:/var/lib/mysql
  35. command: --character-set-server=utf8
  36. environment:
  37. MYSQL_ROOT_PASSWORD: 123456
  38. MYSQL_DATABASE: test
  39. MYSQL_USER: user
  40. MYSQL_PASSAORD: user123456
  41. networks:
  42. lnmp: {}
  43. EOF

:::color5 Nginx 部署目录

:::

  1. $ cd nginx
  2. # 编写Dockerfile文件
  3. $ FROM centos:centos7.9.2009
  4. LABEL maintainer www.baidu.com
  5. # RUN curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo && \
  6. # curl -o /etc/yum.repos.d/epel.repo https://mirrors.aliyun.com/repo/epel-7.repo
  7. RUN yum install -y gcc gcc-c++ make \
  8. openssl-devel pcre-devel gd-devel \
  9. iproute net-tools telnet wget curl && \
  10. yum clean all && \
  11. rm -rf /var/cache/yum/*
  12. # http://nginx.org/download/nginx-1.21.1.tar.gz 下载到Dockerfile同级目录
  13. ADD nginx-1.21.1.tar.gz /
  14. RUN cd nginx-1.21.1 && \
  15. ./configure --prefix=/usr/local/nginx \
  16. --with-http_ssl_module \
  17. --with-http_stub_status_module && \
  18. make -j 4 && make install && \
  19. mkdir /usr/local/nginx/conf/vhost && \
  20. cd / && rm -rf nginx* && \
  21. ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
  22. RUN useradd nginx
  23. ENV PATH $PATH:/usr/local/nginx/sbin
  24. COPY nginx.conf /usr/local/nginx/conf/nginx.conf
  25. WORKDIR /usr/local/nginx
  26. EXPOSE 80
  27. CMD ["nginx", "-g", "daemon off;"]
  28. # Nginx 的配置文件
  29. cat > nginx.conf <<-'EOF'
  30. user nginx;
  31. worker_processes auto;
  32. error_log logs/error.log info;
  33. pid logs/nginx.pid;
  34. events {
  35. worker_connections 4096;
  36. }
  37. http {
  38. log_format main '$remote_addr - $remote_user [$time_local] "$request" '
  39. '$status $body_bytes_sent "$http_referer" '
  40. '"$http_user_agent" "$http_x_forwarded_for"';
  41. access_log logs/access.log main;
  42. sendfile on;
  43. tcp_nopush on;
  44. tcp_nodelay on;
  45. keepalive_timeout 65;
  46. types_hash_max_size 2048;
  47. include mime.types;
  48. default_type application/octet-stream;
  49. include /usr/local/nginx/conf/vhost/*.conf;
  50. server {
  51. listen 80 default_server;
  52. listen [::]:80 default_server;
  53. server_name _;
  54. # root /usr/share/nginx/html;
  55. # include /usr/local/nginx/conf/vhost/*.conf;
  56. location / {
  57. root html;
  58. index index.html index.htm;
  59. }
  60. # location ~* \.php$ {
  61. # root html;
  62. # fastcgi_pass php:9000;
  63. # fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  64. # include fastcgi_params;
  65. # }
  66. # error_page 404 /404.html;
  67. # location = /40x.html {
  68. # }
  69. # error_page 500 502 503 504 /50x.html;
  70. # location = /50x.html {
  71. # }
  72. }
  73. }
  74. EOF
  75. # PHP 的配置文件
  76. cat > php.conf <<-'EOF'
  77. server {
  78. listen 80;
  79. server_name example.ctnrs.com;
  80. index index.php index.html;
  81. access_log logs/www.ctnrs.com_access.log;
  82. error_log logs/www.ctnrs.com_error.log;
  83. location / {
  84. root html;
  85. }
  86. location ~* \.php$ {
  87. root html;
  88. fastcgi_pass php:9000;
  89. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  90. include fastcgi_params;
  91. }
  92. }
  93. EOF
  94. # 查看目录树
  95. $ tree -p
  96. .
  97. ├── [-rw-r--r--] Dockerfile
  98. ├── [-rw-r--r--] nginx-1.21.1.tar.gz
  99. ├── [-rw-r--r--] nginx.conf
  100. └── [-rw-r--r--] php.conf
  101. 0 directories, 4 files

:::color5 PHP 部署目录

:::

  1. # 编写Dockerfile文件
  2. $ vim Dockerfile
  3. FROM centos:centos7.9.2009
  4. MAINTAINER zhongzhiwei www.kubespehre.io
  5. RUN yum install epel-release -y && \
  6. yum install -y gcc gcc-c++ make gd-devel libxml2-devel \
  7. libcurl-devel libjpeg-devel libpng-devel openssl-devel \
  8. libmcrypt-devel libxslt-devel libtidy-devel autoconf \
  9. iproute net-tools telnet wget curl && \
  10. yum clean all &&\
  11. rm -rf /var/cache/yum/*
  12. # wget http://cn2.php.net/get/php-5.6.36.tar.gz/from/this/mirror -O php-5.6.36.tar.gz
  13. ADD php-5.6.36.tar.gz /
  14. RUN cd php-5.6.36 && \
  15. ./configure --prefix=/usr/local/php \
  16. --with-config-file-path=/usr/local/php/etc \
  17. --enable-fpm --enable-opcache \
  18. --with-mysql --with-mysqli --with-pdo-mysql \
  19. --with-openssl --with-zlib --with-curl --with-gd \
  20. --with-jpeg-dir --with-png-dir --with-freetype-dir \
  21. --enable-mbstring --with-mcrypt --enable-hash && \
  22. make -j 4 && make install && \
  23. cp php.ini-production /usr/local/php/etc/php.ini && \
  24. cp sapi/fpm/php-fpm.conf /usr/local/php/etc/php-fpm.conf && \
  25. sed -i "90a \daemonize = no" /usr/local/php/etc/php-fpm.conf && \
  26. mkdir -p /usr/local/php/log && \
  27. cd / && rm -rf php* && \
  28. ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
  29. ENV PATH $PATH:/usr/local/php/sbin
  30. # COPY php.ini /usr/local/php/etc/
  31. # COPY php-fpm.conf /usr/local/php/etc/
  32. # 设置工作目录
  33. WORKDIR /usr/local/php
  34. EXPOSE 9000
  35. CMD ["php-fpm"]
  36. # php-fpm.conf 配置文件
  37. cat > php-fpm.conf <<EOF
  38. ;;;;;;;;;;;;;;;;;;;;;
  39. ; FPM Configuration ;
  40. ;;;;;;;;;;;;;;;;;;;;;
  41. ; All relative paths in this configuration file are relative to PHP's install
  42. ; prefix (/usr/local/php). This prefix can be dynamically changed by using the
  43. ; '-p' argument from the command line.
  44. ; Include one or more files. If glob(3) exists, it is used to include a bunch of
  45. ; files from a glob(3) pattern. This directive can be used everywhere in the
  46. ; file.
  47. ; Relative path can also be used. They will be prefixed by:
  48. ; - the global prefix if it's been set (-p argument)
  49. ; - /usr/local/php otherwise
  50. ;include=etc/fpm.d/*.conf
  51. ;;;;;;;;;;;;;;;;;;
  52. ; Global Options ;
  53. ;;;;;;;;;;;;;;;;;;
  54. [global]
  55. ; Pid file
  56. ; Note: the default prefix is /usr/local/php/var
  57. ; Default Value: none
  58. ;pid = run/php-fpm.pid
  59. ; Error log file
  60. ; If it's set to "syslog", log is sent to syslogd instead of being written
  61. ; in a local file.
  62. ; Note: the default prefix is /usr/local/php/var
  63. ; Default Value: log/php-fpm.log
  64. ;error_log = log/php-fpm.log
  65. ; syslog_facility is used to specify what type of program is logging the
  66. ; message. This lets syslogd specify that messages from different facilities
  67. ; will be handled differently.
  68. ; See syslog(3) for possible values (ex daemon equiv LOG_DAEMON)
  69. ; Default Value: daemon
  70. ;syslog.facility = daemon
  71. ; syslog_ident is prepended to every message. If you have multiple FPM
  72. ; instances running on the same server, you can change the default value
  73. ; which must suit common needs.
  74. ; Default Value: php-fpm
  75. ;syslog.ident = php-fpm
  76. ; Log level
  77. ; Possible Values: alert, error, warning, notice, debug
  78. ; Default Value: notice
  79. ;log_level = notice
  80. ; If this number of child processes exit with SIGSEGV or SIGBUS within the time
  81. ; interval set by emergency_restart_interval then FPM will restart. A value
  82. ; of '0' means 'Off'.
  83. ; Default Value: 0
  84. ;emergency_restart_threshold = 0
  85. ; Interval of time used by emergency_restart_interval to determine when
  86. ; a graceful restart will be initiated. This can be useful to work around
  87. ; accidental corruptions in an accelerator's shared memory.
  88. ; Available Units: s(econds), m(inutes), h(ours), or d(ays)
  89. ; Default Unit: seconds
  90. ; Default Value: 0
  91. ;emergency_restart_interval = 0
  92. ; Time limit for child processes to wait for a reaction on signals from master.
  93. ; Available units: s(econds), m(inutes), h(ours), or d(ays)
  94. ; Default Unit: seconds
  95. ; Default Value: 0
  96. ;process_control_timeout = 0
  97. ; The maximum number of processes FPM will fork. This has been design to control
  98. ; the global number of processes when using dynamic PM within a lot of pools.
  99. ; Use it with caution.
  100. ; Note: A value of 0 indicates no limit
  101. ; Default Value: 0
  102. ; process.max = 128
  103. ; Specify the nice(2) priority to apply to the master process (only if set)
  104. ; The value can vary from -19 (highest priority) to 20 (lower priority)
  105. ; Note: - It will only work if the FPM master process is launched as root
  106. ; - The pool process will inherit the master process priority
  107. ; unless it specified otherwise
  108. ; Default Value: no set
  109. ; process.priority = -19
  110. ; Send FPM to background. Set to 'no' to keep FPM in foreground for debugging.
  111. ; Default Value: yes
  112. ;daemonize = yes
  113. daemonize = no
  114. ; Set open file descriptor rlimit for the master process.
  115. ; Default Value: system defined value
  116. ;rlimit_files = 1024
  117. ; Set max core size rlimit for the master process.
  118. ; Possible Values: 'unlimited' or an integer greater or equal to 0
  119. ; Default Value: system defined value
  120. ;rlimit_core = 0
  121. ; Specify the event mechanism FPM will use. The following is available:
  122. ; - select (any POSIX os)
  123. ; - poll (any POSIX os)
  124. ; - epoll (linux >= 2.5.44)
  125. ; - kqueue (FreeBSD >= 4.1, OpenBSD >= 2.9, NetBSD >= 2.0)
  126. ; - /dev/poll (Solaris >= 7)
  127. ; - port (Solaris >= 10)
  128. ; Default Value: not set (auto detection)
  129. ;events.mechanism = epoll
  130. ; When FPM is build with systemd integration, specify the interval,
  131. ; in second, between health report notification to systemd.
  132. ; Set to 0 to disable.
  133. ; Available Units: s(econds), m(inutes), h(ours)
  134. ; Default Unit: seconds
  135. ; Default value: 10
  136. ;systemd_interval = 10
  137. ;;;;;;;;;;;;;;;;;;;;
  138. ; Pool Definitions ;
  139. ;;;;;;;;;;;;;;;;;;;;
  140. ; Multiple pools of child processes may be started with different listening
  141. ; ports and different management options. The name of the pool will be
  142. ; used in logs and stats. There is no limitation on the number of pools which
  143. ; FPM can handle. Your system will tell you anyway :)
  144. ; Start a new pool named 'www'.
  145. ; the variable $pool can we used in any directive and will be replaced by the
  146. ; pool name ('www' here)
  147. [www]
  148. ; Per pool prefix
  149. ; It only applies on the following directives:
  150. ; - 'access.log'
  151. ; - 'slowlog'
  152. ; - 'listen' (unixsocket)
  153. ; - 'chroot'
  154. ; - 'chdir'
  155. ; - 'php_values'
  156. ; - 'php_admin_values'
  157. ; When not set, the global prefix (or /usr/local/php) applies instead.
  158. ; Note: This directive can also be relative to the global prefix.
  159. ; Default Value: none
  160. ;prefix = /path/to/pools/$pool
  161. ; Unix user/group of processes
  162. ; Note: The user is mandatory. If the group is not set, the default user's group
  163. ; will be used.
  164. user = nobody
  165. group = nobody
  166. ; The address on which to accept FastCGI requests.
  167. ; Valid syntaxes are:
  168. ; 'ip.add.re.ss:port' - to listen on a TCP socket to a specific IPv4 address on
  169. ; a specific port;
  170. ; '[ip:6:addr:ess]:port' - to listen on a TCP socket to a specific IPv6 address on
  171. ; a specific port;
  172. ; 'port' - to listen on a TCP socket to all IPv4 addresses on a
  173. ; specific port;
  174. ; '[::]:port' - to listen on a TCP socket to all addresses
  175. ; (IPv6 and IPv4-mapped) on a specific port;
  176. ; '/path/to/unix/socket' - to listen on a unix socket.
  177. ; Note: This value is mandatory.
  178. listen = 127.0.0.1:9000
  179. ; Set listen(2) backlog.
  180. ; Default Value: 65535 (-1 on FreeBSD and OpenBSD)
  181. ;listen.backlog = 65535
  182. ; Set permissions for unix socket, if one is used. In Linux, read/write
  183. ; permissions must be set in order to allow connections from a web server. Many
  184. ; BSD-derived systems allow connections regardless of permissions.
  185. ; Default Values: user and group are set as the running user
  186. ; mode is set to 0660
  187. ;listen.owner = nobody
  188. ;listen.group = nobody
  189. ;listen.mode = 0660
  190. ; When POSIX Access Control Lists are supported you can set them using
  191. ; these options, value is a comma separated list of user/group names.
  192. ; When set, listen.owner and listen.group are ignored
  193. ;listen.acl_users =
  194. ;listen.acl_groups =
  195. ; List of addresses (IPv4/IPv6) of FastCGI clients which are allowed to connect.
  196. ; Equivalent to the FCGI_WEB_SERVER_ADDRS environment variable in the original
  197. ; PHP FCGI (5.2.2+). Makes sense only with a tcp listening socket. Each address
  198. ; must be separated by a comma. If this value is left blank, connections will be
  199. ; accepted from any ip address.
  200. ; Default Value: any
  201. ;listen.allowed_clients = 127.0.0.1
  202. ; Specify the nice(2) priority to apply to the pool processes (only if set)
  203. ; The value can vary from -19 (highest priority) to 20 (lower priority)
  204. ; Note: - It will only work if the FPM master process is launched as root
  205. ; - The pool processes will inherit the master process priority
  206. ; unless it specified otherwise
  207. ; Default Value: no set
  208. ; process.priority = -19
  209. ; Set the process dumpable flag (PR_SET_DUMPABLE prctl) even if the process user
  210. ; or group is differrent than the master process user. It allows to create process
  211. ; core dump and ptrace the process for the pool user.
  212. ; Default Value: no
  213. ; process.dumpable = yes
  214. ; Choose how the process manager will control the number of child processes.
  215. ; Possible Values:
  216. ; static - a fixed number (pm.max_children) of child processes;
  217. ; dynamic - the number of child processes are set dynamically based on the
  218. ; following directives. With this process management, there will be
  219. ; always at least 1 children.
  220. ; pm.max_children - the maximum number of children that can
  221. ; be alive at the same time.
  222. ; pm.start_servers - the number of children created on startup.
  223. ; pm.min_spare_servers - the minimum number of children in 'idle'
  224. ; state (waiting to process). If the number
  225. ; of 'idle' processes is less than this
  226. ; number then some children will be created.
  227. ; pm.max_spare_servers - the maximum number of children in 'idle'
  228. ; state (waiting to process). If the number
  229. ; of 'idle' processes is greater than this
  230. ; number then some children will be killed.
  231. ; ondemand - no children are created at startup. Children will be forked when
  232. ; new requests will connect. The following parameter are used:
  233. ; pm.max_children - the maximum number of children that
  234. ; can be alive at the same time.
  235. ; pm.process_idle_timeout - The number of seconds after which
  236. ; an idle process will be killed.
  237. ; Note: This value is mandatory.
  238. pm = dynamic
  239. ; The number of child processes to be created when pm is set to 'static' and the
  240. ; maximum number of child processes when pm is set to 'dynamic' or 'ondemand'.
  241. ; This value sets the limit on the number of simultaneous requests that will be
  242. ; served. Equivalent to the ApacheMaxClients directive with mpm_prefork.
  243. ; Equivalent to the PHP_FCGI_CHILDREN environment variable in the original PHP
  244. ; CGI. The below defaults are based on a server without much resources. Don't
  245. ; forget to tweak pm.* to fit your needs.
  246. ; Note: Used when pm is set to 'static', 'dynamic' or 'ondemand'
  247. ; Note: This value is mandatory.
  248. pm.max_children = 5
  249. ; The number of child processes created on startup.
  250. ; Note: Used only when pm is set to 'dynamic'
  251. ; Default Value: min_spare_servers + (max_spare_servers - min_spare_servers) / 2
  252. pm.start_servers = 2
  253. ; The desired minimum number of idle server processes.
  254. ; Note: Used only when pm is set to 'dynamic'
  255. ; Note: Mandatory when pm is set to 'dynamic'
  256. pm.min_spare_servers = 1
  257. ; The desired maximum number of idle server processes.
  258. ; Note: Used only when pm is set to 'dynamic'
  259. ; Note: Mandatory when pm is set to 'dynamic'
  260. pm.max_spare_servers = 3
  261. ; The number of seconds after which an idle process will be killed.
  262. ; Note: Used only when pm is set to 'ondemand'
  263. ; Default Value: 10s
  264. ;pm.process_idle_timeout = 10s;
  265. ; The number of requests each child process should execute before respawning.
  266. ; This can be useful to work around memory leaks in 3rd party libraries. For
  267. ; endless request processing specify '0'. Equivalent to PHP_FCGI_MAX_REQUESTS.
  268. ; Default Value: 0
  269. ;pm.max_requests = 500
  270. ; The URI to view the FPM status page. If this value is not set, no URI will be
  271. ; recognized as a status page. It shows the following informations:
  272. ; pool - the name of the pool;
  273. ; process manager - static, dynamic or ondemand;
  274. ; start time - the date and time FPM has started;
  275. ; start since - number of seconds since FPM has started;
  276. ; accepted conn - the number of request accepted by the pool;
  277. ; listen queue - the number of request in the queue of pending
  278. ; connections (see backlog in listen(2));
  279. ; max listen queue - the maximum number of requests in the queue
  280. ; of pending connections since FPM has started;
  281. ; listen queue len - the size of the socket queue of pending connections;
  282. ; idle processes - the number of idle processes;
  283. ; active processes - the number of active processes;
  284. ; total processes - the number of idle + active processes;
  285. ; max active processes - the maximum number of active processes since FPM
  286. ; has started;
  287. ; max children reached - number of times, the process limit has been reached,
  288. ; when pm tries to start more children (works only for
  289. ; pm 'dynamic' and 'ondemand');
  290. ; Value are updated in real time.
  291. ; Example output:
  292. ; pool: www
  293. ; process manager: static
  294. ; start time: 01/Jul/2011:17:53:49 +0200
  295. ; start since: 62636
  296. ; accepted conn: 190460
  297. ; listen queue: 0
  298. ; max listen queue: 1
  299. ; listen queue len: 42
  300. ; idle processes: 4
  301. ; active processes: 11
  302. ; total processes: 15
  303. ; max active processes: 12
  304. ; max children reached: 0
  305. ;
  306. ; By default the status page output is formatted as text/plain. Passing either
  307. ; 'html', 'xml' or 'json' in the query string will return the corresponding
  308. ; output syntax. Example:
  309. ; http://www.foo.bar/status
  310. ; http://www.foo.bar/status?json
  311. ; http://www.foo.bar/status?html
  312. ; http://www.foo.bar/status?xml
  313. ;
  314. ; By default the status page only outputs short status. Passing 'full' in the
  315. ; query string will also return status for each pool process.
  316. ; Example:
  317. ; http://www.foo.bar/status?full
  318. ; http://www.foo.bar/status?json&full
  319. ; http://www.foo.bar/status?html&full
  320. ; http://www.foo.bar/status?xml&full
  321. ; The Full status returns for each process:
  322. ; pid - the PID of the process;
  323. ; state - the state of the process (Idle, Running, ...);
  324. ; start time - the date and time the process has started;
  325. ; start since - the number of seconds since the process has started;
  326. ; requests - the number of requests the process has served;
  327. ; request duration - the duration in µs of the requests;
  328. ; request method - the request method (GET, POST, ...);
  329. ; request URI - the request URI with the query string;
  330. ; content length - the content length of the request (only with POST);
  331. ; user - the user (PHP_AUTH_USER) (or '-' if not set);
  332. ; script - the main script called (or '-' if not set);
  333. ; last request cpu - the %cpu the last request consumed
  334. ; it's always 0 if the process is not in Idle state
  335. ; because CPU calculation is done when the request
  336. ; processing has terminated;
  337. ; last request memory - the max amount of memory the last request consumed
  338. ; it's always 0 if the process is not in Idle state
  339. ; because memory calculation is done when the request
  340. ; processing has terminated;
  341. ; If the process is in Idle state, then informations are related to the
  342. ; last request the process has served. Otherwise informations are related to
  343. ; the current request being served.
  344. ; Example output:
  345. ; ************************
  346. ; pid: 31330
  347. ; state: Running
  348. ; start time: 01/Jul/2011:17:53:49 +0200
  349. ; start since: 63087
  350. ; requests: 12808
  351. ; request duration: 1250261
  352. ; request method: GET
  353. ; request URI: /test_mem.php?N=10000
  354. ; content length: 0
  355. ; user: -
  356. ; script: /home/fat/web/docs/php/test_mem.php
  357. ; last request cpu: 0.00
  358. ; last request memory: 0
  359. ;
  360. ; Note: There is a real-time FPM status monitoring sample web page available
  361. ; It's available in: /usr/local/php/share/php/fpm/status.html
  362. ;
  363. ; Note: The value must start with a leading slash (/). The value can be
  364. ; anything, but it may not be a good idea to use the .php extension or it
  365. ; may conflict with a real PHP file.
  366. ; Default Value: not set
  367. ;pm.status_path = /status
  368. ; The ping URI to call the monitoring page of FPM. If this value is not set, no
  369. ; URI will be recognized as a ping page. This could be used to test from outside
  370. ; that FPM is alive and responding, or to
  371. ; - create a graph of FPM availability (rrd or such);
  372. ; - remove a server from a group if it is not responding (load balancing);
  373. ; - trigger alerts for the operating team (24/7).
  374. ; Note: The value must start with a leading slash (/). The value can be
  375. ; anything, but it may not be a good idea to use the .php extension or it
  376. ; may conflict with a real PHP file.
  377. ; Default Value: not set
  378. ;ping.path = /ping
  379. ; This directive may be used to customize the response of a ping request. The
  380. ; response is formatted as text/plain with a 200 response code.
  381. ; Default Value: pong
  382. ;ping.response = pong
  383. ; The access log file
  384. ; Default: not set
  385. ;access.log = log/$pool.access.log
  386. ; The access log format.
  387. ; The following syntax is allowed
  388. ; %%: the '%' character
  389. ; %C: %CPU used by the request
  390. ; it can accept the following format:
  391. ; - %{user}C for user CPU only
  392. ; - %{system}C for system CPU only
  393. ; - %{total}C for user + system CPU (default)
  394. ; %d: time taken to serve the request
  395. ; it can accept the following format:
  396. ; - %{seconds}d (default)
  397. ; - %{miliseconds}d
  398. ; - %{mili}d
  399. ; - %{microseconds}d
  400. ; - %{micro}d
  401. ; %e: an environment variable (same as $_ENV or $_SERVER)
  402. ; it must be associated with embraces to specify the name of the env
  403. ; variable. Some exemples:
  404. ; - server specifics like: %{REQUEST_METHOD}e or %{SERVER_PROTOCOL}e
  405. ; - HTTP headers like: %{HTTP_HOST}e or %{HTTP_USER_AGENT}e
  406. ; %f: script filename
  407. ; %l: content-length of the request (for POST request only)
  408. ; %m: request method
  409. ; %M: peak of memory allocated by PHP
  410. ; it can accept the following format:
  411. ; - %{bytes}M (default)
  412. ; - %{kilobytes}M
  413. ; - %{kilo}M
  414. ; - %{megabytes}M
  415. ; - %{mega}M
  416. ; %n: pool name
  417. ; %o: output header
  418. ; it must be associated with embraces to specify the name of the header:
  419. ; - %{Content-Type}o
  420. ; - %{X-Powered-By}o
  421. ; - %{Transfert-Encoding}o
  422. ; - ....
  423. ; %p: PID of the child that serviced the request
  424. ; %P: PID of the parent of the child that serviced the request
  425. ; %q: the query string
  426. ; %Q: the '?' character if query string exists
  427. ; %r: the request URI (without the query string, see %q and %Q)
  428. ; %R: remote IP address
  429. ; %s: status (response code)
  430. ; %t: server time the request was received
  431. ; it can accept a strftime(3) format:
  432. ; %d/%b/%Y:%H:%M:%S %z (default)
  433. ; %T: time the log has been written (the request has finished)
  434. ; it can accept a strftime(3) format:
  435. ; %d/%b/%Y:%H:%M:%S %z (default)
  436. ; %u: remote user
  437. ;
  438. ; Default: "%R - %u %t \"%m %r\" %s"
  439. ;access.format = "%R - %u %t \"%m %r%Q%q\" %s %f %{mili}d %{kilo}M %C%%"
  440. ; The log file for slow requests
  441. ; Default Value: not set
  442. ; Note: slowlog is mandatory if request_slowlog_timeout is set
  443. ;slowlog = log/$pool.log.slow
  444. ; The timeout for serving a single request after which a PHP backtrace will be
  445. ; dumped to the 'slowlog' file. A value of '0s' means 'off'.
  446. ; Available units: s(econds)(default), m(inutes), h(ours), or d(ays)
  447. ; Default Value: 0
  448. ;request_slowlog_timeout = 0
  449. ; The timeout for serving a single request after which the worker process will
  450. ; be killed. This option should be used when the 'max_execution_time' ini option
  451. ; does not stop script execution for some reason. A value of '0' means 'off'.
  452. ; Available units: s(econds)(default), m(inutes), h(ours), or d(ays)
  453. ; Default Value: 0
  454. ;request_terminate_timeout = 0
  455. ; Set open file descriptor rlimit.
  456. ; Default Value: system defined value
  457. ;rlimit_files = 1024
  458. ; Set max core size rlimit.
  459. ; Possible Values: 'unlimited' or an integer greater or equal to 0
  460. ; Default Value: system defined value
  461. ;rlimit_core = 0
  462. ; Chroot to this directory at the start. This value must be defined as an
  463. ; absolute path. When this value is not set, chroot is not used.
  464. ; Note: you can prefix with '$prefix' to chroot to the pool prefix or one
  465. ; of its subdirectories. If the pool prefix is not set, the global prefix
  466. ; will be used instead.
  467. ; Note: chrooting is a great security feature and should be used whenever
  468. ; possible. However, all PHP paths will be relative to the chroot
  469. ; (error_log, sessions.save_path, ...).
  470. ; Default Value: not set
  471. ;chroot =
  472. ; Chdir to this directory at the start.
  473. ; Note: relative path can be used.
  474. ; Default Value: current directory or / when chroot
  475. ;chdir = /var/www
  476. ; Redirect worker stdout and stderr into main error log. If not set, stdout and
  477. ; stderr will be redirected to /dev/null according to FastCGI specs.
  478. ; Note: on highloaded environement, this can cause some delay in the page
  479. ; process time (several ms).
  480. ; Default Value: no
  481. ;catch_workers_output = yes
  482. ; Clear environment in FPM workers
  483. ; Prevents arbitrary environment variables from reaching FPM worker processes
  484. ; by clearing the environment in workers before env vars specified in this
  485. ; pool configuration are added.
  486. ; Setting to "no" will make all environment variables available to PHP code
  487. ; via getenv(), $_ENV and $_SERVER.
  488. ; Default Value: yes
  489. ;clear_env = no
  490. ; Limits the extensions of the main script FPM will allow to parse. This can
  491. ; prevent configuration mistakes on the web server side. You should only limit
  492. ; FPM to .php extensions to prevent malicious users to use other extensions to
  493. ; exectute php code.
  494. ; Note: set an empty value to allow all extensions.
  495. ; Default Value: .php
  496. ;security.limit_extensions = .php .php3 .php4 .php5
  497. ; Pass environment variables like LD_LIBRARY_PATH. All $VARIABLEs are taken from
  498. ; the current environment.
  499. ; Default Value: clean env
  500. ;env[HOSTNAME] = $HOSTNAME
  501. ;env[PATH] = /usr/local/bin:/usr/bin:/bin
  502. ;env[TMP] = /tmp
  503. ;env[TMPDIR] = /tmp
  504. ;env[TEMP] = /tmp
  505. ; Additional php.ini defines, specific to this pool of workers. These settings
  506. ; overwrite the values previously defined in the php.ini. The directives are the
  507. ; same as the PHP SAPI:
  508. ; php_value/php_flag - you can set classic ini defines which can
  509. ; be overwritten from PHP call 'ini_set'.
  510. ; php_admin_value/php_admin_flag - these directives won't be overwritten by
  511. ; PHP call 'ini_set'
  512. ; For php_*flag, valid values are on, off, 1, 0, true, false, yes or no.
  513. ; Defining 'extension' will load the corresponding shared extension from
  514. ; extension_dir. Defining 'disable_functions' or 'disable_classes' will not
  515. ; overwrite previously defined php.ini values, but will append the new value
  516. ; instead.
  517. ; Note: path INI options can be relative and will be expanded with the prefix
  518. ; (pool, global or /usr/local/php)
  519. ; Default Value: nothing is defined by default except the values in php.ini and
  520. ; specified at startup with the -d argument
  521. ;php_admin_value[sendmail_path] = /usr/sbin/sendmail -t -i -f www@my.domain.com
  522. ;php_flag[display_errors] = off
  523. ;php_admin_value[error_log] = /var/log/fpm-php.www.log
  524. ;php_admin_flag[log_errors] = on
  525. ;php_admin_value[memory_limit] = 32M
  526. EOF
  527. cat > php.ini <<EOF
  528. [PHP]
  529. ;;;;;;;;;;;;;;;;;;;
  530. ; About php.ini ;
  531. ;;;;;;;;;;;;;;;;;;;
  532. ; PHP's initialization file, generally called php.ini, is responsible for
  533. ; configuring many of the aspects of PHP's behavior.
  534. ; PHP attempts to find and load this configuration from a number of locations.
  535. ; The following is a summary of its search order:
  536. ; 1. SAPI module specific location.
  537. ; 2. The PHPRC environment variable. (As of PHP 5.2.0)
  538. ; 3. A number of predefined registry keys on Windows (As of PHP 5.2.0)
  539. ; 4. Current working directory (except CLI)
  540. ; 5. The web server's directory (for SAPI modules), or directory of PHP
  541. ; (otherwise in Windows)
  542. ; 6. The directory from the --with-config-file-path compile time option, or the
  543. ; Windows directory (C:\windows or C:\winnt)
  544. ; See the PHP docs for more specific information.
  545. ; http://php.net/configuration.file
  546. ; The syntax of the file is extremely simple. Whitespace and lines
  547. ; beginning with a semicolon are silently ignored (as you probably guessed).
  548. ; Section headers (e.g. [Foo]) are also silently ignored, even though
  549. ; they might mean something in the future.
  550. ; Directives following the section heading [PATH=/www/mysite] only
  551. ; apply to PHP files in the /www/mysite directory. Directives
  552. ; following the section heading [HOST=www.example.com] only apply to
  553. ; PHP files served from www.example.com. Directives set in these
  554. ; special sections cannot be overridden by user-defined INI files or
  555. ; at runtime. Currently, [PATH=] and [HOST=] sections only work under
  556. ; CGI/FastCGI.
  557. ; http://php.net/ini.sections
  558. ; Directives are specified using the following syntax:
  559. ; directive = value
  560. ; Directive names are *case sensitive* - foo=bar is different from FOO=bar.
  561. ; Directives are variables used to configure PHP or PHP extensions.
  562. ; There is no name validation. If PHP can't find an expected
  563. ; directive because it is not set or is mistyped, a default value will be used.
  564. ; The value can be a string, a number, a PHP constant (e.g. E_ALL or M_PI), one
  565. ; of the INI constants (On, Off, True, False, Yes, No and None) or an expression
  566. ; (e.g. E_ALL & ~E_NOTICE), a quoted string ("bar"), or a reference to a
  567. ; previously set variable or directive (e.g. ${foo})
  568. ; Expressions in the INI file are limited to bitwise operators and parentheses:
  569. ; | bitwise OR
  570. ; ^ bitwise XOR
  571. ; & bitwise AND
  572. ; ~ bitwise NOT
  573. ; ! boolean NOT
  574. ; Boolean flags can be turned on using the values 1, On, True or Yes.
  575. ; They can be turned off using the values 0, Off, False or No.
  576. ; An empty string can be denoted by simply not writing anything after the equal
  577. ; sign, or by using the None keyword:
  578. ; foo = ; sets foo to an empty string
  579. ; foo = None ; sets foo to an empty string
  580. ; foo = "None" ; sets foo to the string 'None'
  581. ; If you use constants in your value, and these constants belong to a
  582. ; dynamically loaded extension (either a PHP extension or a Zend extension),
  583. ; you may only use these constants *after* the line that loads the extension.
  584. ;;;;;;;;;;;;;;;;;;;
  585. ; About this file ;
  586. ;;;;;;;;;;;;;;;;;;;
  587. ; PHP comes packaged with two INI files. One that is recommended to be used
  588. ; in production environments and one that is recommended to be used in
  589. ; development environments.
  590. ; php.ini-production contains settings which hold security, performance and
  591. ; best practices at its core. But please be aware, these settings may break
  592. ; compatibility with older or less security conscience applications. We
  593. ; recommending using the production ini in production and testing environments.
  594. ; php.ini-development is very similar to its production variant, except it is
  595. ; much more verbose when it comes to errors. We recommend using the
  596. ; development version only in development environments, as errors shown to
  597. ; application users can inadvertently leak otherwise secure information.
  598. ; This is php.ini-production INI file.
  599. ;;;;;;;;;;;;;;;;;;;
  600. ; Quick Reference ;
  601. ;;;;;;;;;;;;;;;;;;;
  602. ; The following are all the settings which are different in either the production
  603. ; or development versions of the INIs with respect to PHP's default behavior.
  604. ; Please see the actual settings later in the document for more details as to why
  605. ; we recommend these changes in PHP's behavior.
  606. ; display_errors
  607. ; Default Value: On
  608. ; Development Value: On
  609. ; Production Value: Off
  610. ; display_startup_errors
  611. ; Default Value: Off
  612. ; Development Value: On
  613. ; Production Value: Off
  614. ; error_reporting
  615. ; Default Value: E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED
  616. ; Development Value: E_ALL
  617. ; Production Value: E_ALL & ~E_DEPRECATED & ~E_STRICT
  618. ; html_errors
  619. ; Default Value: On
  620. ; Development Value: On
  621. ; Production value: On
  622. ; log_errors
  623. ; Default Value: Off
  624. ; Development Value: On
  625. ; Production Value: On
  626. ; max_input_time
  627. ; Default Value: -1 (Unlimited)
  628. ; Development Value: 60 (60 seconds)
  629. ; Production Value: 60 (60 seconds)
  630. ; output_buffering
  631. ; Default Value: Off
  632. ; Development Value: 4096
  633. ; Production Value: 4096
  634. ; register_argc_argv
  635. ; Default Value: On
  636. ; Development Value: Off
  637. ; Production Value: Off
  638. ; request_order
  639. ; Default Value: None
  640. ; Development Value: "GP"
  641. ; Production Value: "GP"
  642. ; session.gc_divisor
  643. ; Default Value: 100
  644. ; Development Value: 1000
  645. ; Production Value: 1000
  646. ; session.hash_bits_per_character
  647. ; Default Value: 4
  648. ; Development Value: 5
  649. ; Production Value: 5
  650. ; short_open_tag
  651. ; Default Value: On
  652. ; Development Value: Off
  653. ; Production Value: Off
  654. ; track_errors
  655. ; Default Value: Off
  656. ; Development Value: On
  657. ; Production Value: Off
  658. ; url_rewriter.tags
  659. ; Default Value: "a=href,area=href,frame=src,form=,fieldset="
  660. ; Development Value: "a=href,area=href,frame=src,input=src,form=fakeentry"
  661. ; Production Value: "a=href,area=href,frame=src,input=src,form=fakeentry"
  662. ; variables_order
  663. ; Default Value: "EGPCS"
  664. ; Development Value: "GPCS"
  665. ; Production Value: "GPCS"
  666. ;;;;;;;;;;;;;;;;;;;;
  667. ; php.ini Options ;
  668. ;;;;;;;;;;;;;;;;;;;;
  669. ; Name for user-defined php.ini (.htaccess) files. Default is ".user.ini"
  670. ;user_ini.filename = ".user.ini"
  671. ; To disable this feature set this option to empty value
  672. ;user_ini.filename =
  673. ; TTL for user-defined php.ini files (time-to-live) in seconds. Default is 300 seconds (5 minutes)
  674. ;user_ini.cache_ttl = 300
  675. ;;;;;;;;;;;;;;;;;;;;
  676. ; Language Options ;
  677. ;;;;;;;;;;;;;;;;;;;;
  678. ; Enable the PHP scripting language engine under Apache.
  679. ; http://php.net/engine
  680. engine = On
  681. ; This directive determines whether or not PHP will recognize code between
  682. ; <? and ?> tags as PHP source which should be processed as such. It is
  683. ; generally recommended that <?php and ?> should be used and that this feature
  684. ; should be disabled, as enabling it may result in issues when generating XML
  685. ; documents, however this remains supported for backward compatibility reasons.
  686. ; Note that this directive does not control the <?= shorthand tag, which can be
  687. ; used regardless of this directive.
  688. ; Default Value: On
  689. ; Development Value: Off
  690. ; Production Value: Off
  691. ; http://php.net/short-open-tag
  692. short_open_tag = Off
  693. ; Allow ASP-style <% %> tags.
  694. ; http://php.net/asp-tags
  695. asp_tags = Off
  696. ; The number of significant digits displayed in floating point numbers.
  697. ; http://php.net/precision
  698. precision = 14
  699. ; Output buffering is a mechanism for controlling how much output data
  700. ; (excluding headers and cookies) PHP should keep internally before pushing that
  701. ; data to the client. If your application's output exceeds this setting, PHP
  702. ; will send that data in chunks of roughly the size you specify.
  703. ; Turning on this setting and managing its maximum buffer size can yield some
  704. ; interesting side-effects depending on your application and web server.
  705. ; You may be able to send headers and cookies after you've already sent output
  706. ; through print or echo. You also may see performance benefits if your server is
  707. ; emitting less packets due to buffered output versus PHP streaming the output
  708. ; as it gets it. On production servers, 4096 bytes is a good setting for performance
  709. ; reasons.
  710. ; Note: Output buffering can also be controlled via Output Buffering Control
  711. ; functions.
  712. ; Possible Values:
  713. ; On = Enabled and buffer is unlimited. (Use with caution)
  714. ; Off = Disabled
  715. ; Integer = Enables the buffer and sets its maximum size in bytes.
  716. ; Note: This directive is hardcoded to Off for the CLI SAPI
  717. ; Default Value: Off
  718. ; Development Value: 4096
  719. ; Production Value: 4096
  720. ; http://php.net/output-buffering
  721. output_buffering = 4096
  722. ; You can redirect all of the output of your scripts to a function. For
  723. ; example, if you set output_handler to "mb_output_handler", character
  724. ; encoding will be transparently converted to the specified encoding.
  725. ; Setting any output handler automatically turns on output buffering.
  726. ; Note: People who wrote portable scripts should not depend on this ini
  727. ; directive. Instead, explicitly set the output handler using ob_start().
  728. ; Using this ini directive may cause problems unless you know what script
  729. ; is doing.
  730. ; Note: You cannot use both "mb_output_handler" with "ob_iconv_handler"
  731. ; and you cannot use both "ob_gzhandler" and "zlib.output_compression".
  732. ; Note: output_handler must be empty if this is set 'On' !!!!
  733. ; Instead you must use zlib.output_handler.
  734. ; http://php.net/output-handler
  735. ;output_handler =
  736. ; Transparent output compression using the zlib library
  737. ; Valid values for this option are 'off', 'on', or a specific buffer size
  738. ; to be used for compression (default is 4KB)
  739. ; Note: Resulting chunk size may vary due to nature of compression. PHP
  740. ; outputs chunks that are few hundreds bytes each as a result of
  741. ; compression. If you prefer a larger chunk size for better
  742. ; performance, enable output_buffering in addition.
  743. ; Note: You need to use zlib.output_handler instead of the standard
  744. ; output_handler, or otherwise the output will be corrupted.
  745. ; http://php.net/zlib.output-compression
  746. zlib.output_compression = Off
  747. ; http://php.net/zlib.output-compression-level
  748. ;zlib.output_compression_level = -1
  749. ; You cannot specify additional output handlers if zlib.output_compression
  750. ; is activated here. This setting does the same as output_handler but in
  751. ; a different order.
  752. ; http://php.net/zlib.output-handler
  753. ;zlib.output_handler =
  754. ; Implicit flush tells PHP to tell the output layer to flush itself
  755. ; automatically after every output block. This is equivalent to calling the
  756. ; PHP function flush() after each and every call to print() or echo() and each
  757. ; and every HTML block. Turning this option on has serious performance
  758. ; implications and is generally recommended for debugging purposes only.
  759. ; http://php.net/implicit-flush
  760. ; Note: This directive is hardcoded to On for the CLI SAPI
  761. implicit_flush = Off
  762. ; The unserialize callback function will be called (with the undefined class'
  763. ; name as parameter), if the unserializer finds an undefined class
  764. ; which should be instantiated. A warning appears if the specified function is
  765. ; not defined, or if the function doesn't include/implement the missing class.
  766. ; So only set this entry, if you really want to implement such a
  767. ; callback-function.
  768. unserialize_callback_func =
  769. ; When floats & doubles are serialized store serialize_precision significant
  770. ; digits after the floating point. The default value ensures that when floats
  771. ; are decoded with unserialize, the data will remain the same.
  772. serialize_precision = 17
  773. ; open_basedir, if set, limits all file operations to the defined directory
  774. ; and below. This directive makes most sense if used in a per-directory
  775. ; or per-virtualhost web server configuration file.
  776. ; http://php.net/open-basedir
  777. ;open_basedir =
  778. ; This directive allows you to disable certain functions for security reasons.
  779. ; It receives a comma-delimited list of function names.
  780. ; http://php.net/disable-functions
  781. disable_functions =
  782. ; This directive allows you to disable certain classes for security reasons.
  783. ; It receives a comma-delimited list of class names.
  784. ; http://php.net/disable-classes
  785. disable_classes =
  786. ; Colors for Syntax Highlighting mode. Anything that's acceptable in
  787. ; <span style="color: ???????"> would work.
  788. ; http://php.net/syntax-highlighting
  789. ;highlight.string = #DD0000
  790. ;highlight.comment = #FF9900
  791. ;highlight.keyword = #007700
  792. ;highlight.default = #0000BB
  793. ;highlight.html = #000000
  794. ; If enabled, the request will be allowed to complete even if the user aborts
  795. ; the request. Consider enabling it if executing long requests, which may end up
  796. ; being interrupted by the user or a browser timing out. PHP's default behavior
  797. ; is to disable this feature.
  798. ; http://php.net/ignore-user-abort
  799. ;ignore_user_abort = On
  800. ; Determines the size of the realpath cache to be used by PHP. This value should
  801. ; be increased on systems where PHP opens many files to reflect the quantity of
  802. ; the file operations performed.
  803. ; http://php.net/realpath-cache-size
  804. ;realpath_cache_size = 16k
  805. ; Duration of time, in seconds for which to cache realpath information for a given
  806. ; file or directory. For systems with rarely changing files, consider increasing this
  807. ; value.
  808. ; http://php.net/realpath-cache-ttl
  809. ;realpath_cache_ttl = 120
  810. ; Enables or disables the circular reference collector.
  811. ; http://php.net/zend.enable-gc
  812. zend.enable_gc = On
  813. ; If enabled, scripts may be written in encodings that are incompatible with
  814. ; the scanner. CP936, Big5, CP949 and Shift_JIS are the examples of such
  815. ; encodings. To use this feature, mbstring extension must be enabled.
  816. ; Default: Off
  817. ;zend.multibyte = Off
  818. ; Allows to set the default encoding for the scripts. This value will be used
  819. ; unless "declare(encoding=...)" directive appears at the top of the script.
  820. ; Only affects if zend.multibyte is set.
  821. ; Default: ""
  822. ;zend.script_encoding =
  823. ;;;;;;;;;;;;;;;;;
  824. ; Miscellaneous ;
  825. ;;;;;;;;;;;;;;;;;
  826. ; Decides whether PHP may expose the fact that it is installed on the server
  827. ; (e.g. by adding its signature to the Web server header). It is no security
  828. ; threat in any way, but it makes it possible to determine whether you use PHP
  829. ; on your server or not.
  830. ; http://php.net/expose-php
  831. expose_php = On
  832. ;;;;;;;;;;;;;;;;;;;
  833. ; Resource Limits ;
  834. ;;;;;;;;;;;;;;;;;;;
  835. ; Maximum execution time of each script, in seconds
  836. ; http://php.net/max-execution-time
  837. ; Note: This directive is hardcoded to 0 for the CLI SAPI
  838. max_execution_time = 30
  839. ; Maximum amount of time each script may spend parsing request data. It's a good
  840. ; idea to limit this time on productions servers in order to eliminate unexpectedly
  841. ; long running scripts.
  842. ; Note: This directive is hardcoded to -1 for the CLI SAPI
  843. ; Default Value: -1 (Unlimited)
  844. ; Development Value: 60 (60 seconds)
  845. ; Production Value: 60 (60 seconds)
  846. ; http://php.net/max-input-time
  847. max_input_time = 60
  848. ; Maximum input variable nesting level
  849. ; http://php.net/max-input-nesting-level
  850. ;max_input_nesting_level = 64
  851. ; How many GET/POST/COOKIE input variables may be accepted
  852. ; max_input_vars = 1000
  853. ; Maximum amount of memory a script may consume (128MB)
  854. ; http://php.net/memory-limit
  855. memory_limit = 128M
  856. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  857. ; Error handling and logging ;
  858. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  859. ; This directive informs PHP of which errors, warnings and notices you would like
  860. ; it to take action for. The recommended way of setting values for this
  861. ; directive is through the use of the error level constants and bitwise
  862. ; operators. The error level constants are below here for convenience as well as
  863. ; some common settings and their meanings.
  864. ; By default, PHP is set to take action on all errors, notices and warnings EXCEPT
  865. ; those related to E_NOTICE and E_STRICT, which together cover best practices and
  866. ; recommended coding standards in PHP. For performance reasons, this is the
  867. ; recommend error reporting setting. Your production server shouldn't be wasting
  868. ; resources complaining about best practices and coding standards. That's what
  869. ; development servers and development settings are for.
  870. ; Note: The php.ini-development file has this setting as E_ALL. This
  871. ; means it pretty much reports everything which is exactly what you want during
  872. ; development and early testing.
  873. ;
  874. ; Error Level Constants:
  875. ; E_ALL - All errors and warnings (includes E_STRICT as of PHP 5.4.0)
  876. ; E_ERROR - fatal run-time errors
  877. ; E_RECOVERABLE_ERROR - almost fatal run-time errors
  878. ; E_WARNING - run-time warnings (non-fatal errors)
  879. ; E_PARSE - compile-time parse errors
  880. ; E_NOTICE - run-time notices (these are warnings which often result
  881. ; from a bug in your code, but it's possible that it was
  882. ; intentional (e.g., using an uninitialized variable and
  883. ; relying on the fact it is automatically initialized to an
  884. ; empty string)
  885. ; E_STRICT - run-time notices, enable to have PHP suggest changes
  886. ; to your code which will ensure the best interoperability
  887. ; and forward compatibility of your code
  888. ; E_CORE_ERROR - fatal errors that occur during PHP's initial startup
  889. ; E_CORE_WARNING - warnings (non-fatal errors) that occur during PHP's
  890. ; initial startup
  891. ; E_COMPILE_ERROR - fatal compile-time errors
  892. ; E_COMPILE_WARNING - compile-time warnings (non-fatal errors)
  893. ; E_USER_ERROR - user-generated error message
  894. ; E_USER_WARNING - user-generated warning message
  895. ; E_USER_NOTICE - user-generated notice message
  896. ; E_DEPRECATED - warn about code that will not work in future versions
  897. ; of PHP
  898. ; E_USER_DEPRECATED - user-generated deprecation warnings
  899. ;
  900. ; Common Values:
  901. ; E_ALL (Show all errors, warnings and notices including coding standards.)
  902. ; E_ALL & ~E_NOTICE (Show all errors, except for notices)
  903. ; E_ALL & ~E_NOTICE & ~E_STRICT (Show all errors, except for notices and coding standards warnings.)
  904. ; E_COMPILE_ERROR|E_RECOVERABLE_ERROR|E_ERROR|E_CORE_ERROR (Show only errors)
  905. ; Default Value: E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED
  906. ; Development Value: E_ALL
  907. ; Production Value: E_ALL & ~E_DEPRECATED & ~E_STRICT
  908. ; http://php.net/error-reporting
  909. error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT
  910. ; This directive controls whether or not and where PHP will output errors,
  911. ; notices and warnings too. Error output is very useful during development, but
  912. ; it could be very dangerous in production environments. Depending on the code
  913. ; which is triggering the error, sensitive information could potentially leak
  914. ; out of your application such as database usernames and passwords or worse.
  915. ; For production environments, we recommend logging errors rather than
  916. ; sending them to STDOUT.
  917. ; Possible Values:
  918. ; Off = Do not display any errors
  919. ; stderr = Display errors to STDERR (affects only CGI/CLI binaries!)
  920. ; On or stdout = Display errors to STDOUT
  921. ; Default Value: On
  922. ; Development Value: On
  923. ; Production Value: Off
  924. ; http://php.net/display-errors
  925. display_errors = Off
  926. ; The display of errors which occur during PHP's startup sequence are handled
  927. ; separately from display_errors. PHP's default behavior is to suppress those
  928. ; errors from clients. Turning the display of startup errors on can be useful in
  929. ; debugging configuration problems. We strongly recommend you
  930. ; set this to 'off' for production servers.
  931. ; Default Value: Off
  932. ; Development Value: On
  933. ; Production Value: Off
  934. ; http://php.net/display-startup-errors
  935. display_startup_errors = Off
  936. ; Besides displaying errors, PHP can also log errors to locations such as a
  937. ; server-specific log, STDERR, or a location specified by the error_log
  938. ; directive found below. While errors should not be displayed on productions
  939. ; servers they should still be monitored and logging is a great way to do that.
  940. ; Default Value: Off
  941. ; Development Value: On
  942. ; Production Value: On
  943. ; http://php.net/log-errors
  944. log_errors = On
  945. ; Set maximum length of log_errors. In error_log information about the source is
  946. ; added. The default is 1024 and 0 allows to not apply any maximum length at all.
  947. ; http://php.net/log-errors-max-len
  948. log_errors_max_len = 1024
  949. ; Do not log repeated messages. Repeated errors must occur in same file on same
  950. ; line unless ignore_repeated_source is set true.
  951. ; http://php.net/ignore-repeated-errors
  952. ignore_repeated_errors = Off
  953. ; Ignore source of message when ignoring repeated messages. When this setting
  954. ; is On you will not log errors with repeated messages from different files or
  955. ; source lines.
  956. ; http://php.net/ignore-repeated-source
  957. ignore_repeated_source = Off
  958. ; If this parameter is set to Off, then memory leaks will not be shown (on
  959. ; stdout or in the log). This has only effect in a debug compile, and if
  960. ; error reporting includes E_WARNING in the allowed list
  961. ; http://php.net/report-memleaks
  962. report_memleaks = On
  963. ; This setting is on by default.
  964. ;report_zend_debug = 0
  965. ; Store the last error/warning message in $php_errormsg (boolean). Setting this value
  966. ; to On can assist in debugging and is appropriate for development servers. It should
  967. ; however be disabled on production servers.
  968. ; Default Value: Off
  969. ; Development Value: On
  970. ; Production Value: Off
  971. ; http://php.net/track-errors
  972. track_errors = Off
  973. ; Turn off normal error reporting and emit XML-RPC error XML
  974. ; http://php.net/xmlrpc-errors
  975. ;xmlrpc_errors = 0
  976. ; An XML-RPC faultCode
  977. ;xmlrpc_error_number = 0
  978. ; When PHP displays or logs an error, it has the capability of formatting the
  979. ; error message as HTML for easier reading. This directive controls whether
  980. ; the error message is formatted as HTML or not.
  981. ; Note: This directive is hardcoded to Off for the CLI SAPI
  982. ; Default Value: On
  983. ; Development Value: On
  984. ; Production value: On
  985. ; http://php.net/html-errors
  986. html_errors = On
  987. ; If html_errors is set to On *and* docref_root is not empty, then PHP
  988. ; produces clickable error messages that direct to a page describing the error
  989. ; or function causing the error in detail.
  990. ; You can download a copy of the PHP manual from http://php.net/docs
  991. ; and change docref_root to the base URL of your local copy including the
  992. ; leading '/'. You must also specify the file extension being used including
  993. ; the dot. PHP's default behavior is to leave these settings empty, in which
  994. ; case no links to documentation are generated.
  995. ; Note: Never use this feature for production boxes.
  996. ; http://php.net/docref-root
  997. ; Examples
  998. ;docref_root = "/phpmanual/"
  999. ; http://php.net/docref-ext
  1000. ;docref_ext = .html
  1001. ; String to output before an error message. PHP's default behavior is to leave
  1002. ; this setting blank.
  1003. ; http://php.net/error-prepend-string
  1004. ; Example:
  1005. ;error_prepend_string = "<span style='color: #ff0000'>"
  1006. ; String to output after an error message. PHP's default behavior is to leave
  1007. ; this setting blank.
  1008. ; http://php.net/error-append-string
  1009. ; Example:
  1010. ;error_append_string = "</span>"
  1011. ; Log errors to specified file. PHP's default behavior is to leave this value
  1012. ; empty.
  1013. ; http://php.net/error-log
  1014. ; Example:
  1015. ;error_log = php_errors.log
  1016. ; Log errors to syslog (Event Log on Windows).
  1017. ;error_log = syslog
  1018. ;windows.show_crt_warning
  1019. ; Default value: 0
  1020. ; Development value: 0
  1021. ; Production value: 0
  1022. ;;;;;;;;;;;;;;;;;
  1023. ; Data Handling ;
  1024. ;;;;;;;;;;;;;;;;;
  1025. ; The separator used in PHP generated URLs to separate arguments.
  1026. ; PHP's default setting is "&".
  1027. ; http://php.net/arg-separator.output
  1028. ; Example:
  1029. ;arg_separator.output = "&amp;"
  1030. ; List of separator(s) used by PHP to parse input URLs into variables.
  1031. ; PHP's default setting is "&".
  1032. ; NOTE: Every character in this directive is considered as separator!
  1033. ; http://php.net/arg-separator.input
  1034. ; Example:
  1035. ;arg_separator.input = ";&"
  1036. ; This directive determines which super global arrays are registered when PHP
  1037. ; starts up. G,P,C,E & S are abbreviations for the following respective super
  1038. ; globals: GET, POST, COOKIE, ENV and SERVER. There is a performance penalty
  1039. ; paid for the registration of these arrays and because ENV is not as commonly
  1040. ; used as the others, ENV is not recommended on productions servers. You
  1041. ; can still get access to the environment variables through getenv() should you
  1042. ; need to.
  1043. ; Default Value: "EGPCS"
  1044. ; Development Value: "GPCS"
  1045. ; Production Value: "GPCS";
  1046. ; http://php.net/variables-order
  1047. variables_order = "GPCS"
  1048. ; This directive determines which super global data (G,P & C) should be
  1049. ; registered into the super global array REQUEST. If so, it also determines
  1050. ; the order in which that data is registered. The values for this directive
  1051. ; are specified in the same manner as the variables_order directive,
  1052. ; EXCEPT one. Leaving this value empty will cause PHP to use the value set
  1053. ; in the variables_order directive. It does not mean it will leave the super
  1054. ; globals array REQUEST empty.
  1055. ; Default Value: None
  1056. ; Development Value: "GP"
  1057. ; Production Value: "GP"
  1058. ; http://php.net/request-order
  1059. request_order = "GP"
  1060. ; This directive determines whether PHP registers $argv & $argc each time it
  1061. ; runs. $argv contains an array of all the arguments passed to PHP when a script
  1062. ; is invoked. $argc contains an integer representing the number of arguments
  1063. ; that were passed when the script was invoked. These arrays are extremely
  1064. ; useful when running scripts from the command line. When this directive is
  1065. ; enabled, registering these variables consumes CPU cycles and memory each time
  1066. ; a script is executed. For performance reasons, this feature should be disabled
  1067. ; on production servers.
  1068. ; Note: This directive is hardcoded to On for the CLI SAPI
  1069. ; Default Value: On
  1070. ; Development Value: Off
  1071. ; Production Value: Off
  1072. ; http://php.net/register-argc-argv
  1073. register_argc_argv = Off
  1074. ; When enabled, the ENV, REQUEST and SERVER variables are created when they're
  1075. ; first used (Just In Time) instead of when the script starts. If these
  1076. ; variables are not used within a script, having this directive on will result
  1077. ; in a performance gain. The PHP directive register_argc_argv must be disabled
  1078. ; for this directive to have any affect.
  1079. ; http://php.net/auto-globals-jit
  1080. auto_globals_jit = On
  1081. ; Whether PHP will read the POST data.
  1082. ; This option is enabled by default.
  1083. ; Most likely, you won't want to disable this option globally. It causes $_POST
  1084. ; and $_FILES to always be empty; the only way you will be able to read the
  1085. ; POST data will be through the php://input stream wrapper. This can be useful
  1086. ; to proxy requests or to process the POST data in a memory efficient fashion.
  1087. ; http://php.net/enable-post-data-reading
  1088. ;enable_post_data_reading = Off
  1089. ; Maximum size of POST data that PHP will accept.
  1090. ; Its value may be 0 to disable the limit. It is ignored if POST data reading
  1091. ; is disabled through enable_post_data_reading.
  1092. ; http://php.net/post-max-size
  1093. post_max_size = 8M
  1094. ; Automatically add files before PHP document.
  1095. ; http://php.net/auto-prepend-file
  1096. auto_prepend_file =
  1097. ; Automatically add files after PHP document.
  1098. ; http://php.net/auto-append-file
  1099. auto_append_file =
  1100. ; By default, PHP will output a media type using the Content-Type header. To
  1101. ; disable this, simply set it to be empty.
  1102. ;
  1103. ; PHP's built-in default media type is set to text/html.
  1104. ; http://php.net/default-mimetype
  1105. default_mimetype = "text/html"
  1106. ; PHP's default character set is set to UTF-8.
  1107. ; http://php.net/default-charset
  1108. default_charset = "UTF-8"
  1109. ; PHP internal character encoding is set to empty.
  1110. ; If empty, default_charset is used.
  1111. ; http://php.net/internal-encoding
  1112. ;internal_encoding =
  1113. ; PHP input character encoding is set to empty.
  1114. ; If empty, default_charset is used.
  1115. ; http://php.net/input-encoding
  1116. ;input_encoding =
  1117. ; PHP output character encoding is set to empty.
  1118. ; If empty, default_charset is used.
  1119. ; See also output_buffer.
  1120. ; http://php.net/output-encoding
  1121. ;output_encoding =
  1122. ; Always populate the $HTTP_RAW_POST_DATA variable. PHP's default behavior is
  1123. ; to disable this feature and it will be removed in a future version.
  1124. ; If post reading is disabled through enable_post_data_reading,
  1125. ; $HTTP_RAW_POST_DATA is *NOT* populated.
  1126. ; http://php.net/always-populate-raw-post-data
  1127. ;always_populate_raw_post_data = -1
  1128. ;;;;;;;;;;;;;;;;;;;;;;;;;
  1129. ; Paths and Directories ;
  1130. ;;;;;;;;;;;;;;;;;;;;;;;;;
  1131. ; UNIX: "/path1:/path2"
  1132. ;include_path = ".:/php/includes"
  1133. ;
  1134. ; Windows: "\path1;\path2"
  1135. ;include_path = ".;c:\php\includes"
  1136. ;
  1137. ; PHP's default setting for include_path is ".;/path/to/php/pear"
  1138. ; http://php.net/include-path
  1139. ; The root of the PHP pages, used only if nonempty.
  1140. ; if PHP was not compiled with FORCE_REDIRECT, you SHOULD set doc_root
  1141. ; if you are running php as a CGI under any web server (other than IIS)
  1142. ; see documentation for security issues. The alternate is to use the
  1143. ; cgi.force_redirect configuration below
  1144. ; http://php.net/doc-root
  1145. doc_root =
  1146. ; The directory under which PHP opens the script using /~username used only
  1147. ; if nonempty.
  1148. ; http://php.net/user-dir
  1149. user_dir =
  1150. ; Directory in which the loadable extensions (modules) reside.
  1151. ; http://php.net/extension-dir
  1152. ; extension_dir = "./"
  1153. ; On windows:
  1154. ; extension_dir = "ext"
  1155. ; Directory where the temporary files should be placed.
  1156. ; Defaults to the system default (see sys_get_temp_dir)
  1157. ; sys_temp_dir = "/tmp"
  1158. ; Whether or not to enable the dl() function. The dl() function does NOT work
  1159. ; properly in multithreaded servers, such as IIS or Zeus, and is automatically
  1160. ; disabled on them.
  1161. ; http://php.net/enable-dl
  1162. enable_dl = Off
  1163. ; cgi.force_redirect is necessary to provide security running PHP as a CGI under
  1164. ; most web servers. Left undefined, PHP turns this on by default. You can
  1165. ; turn it off here AT YOUR OWN RISK
  1166. ; **You CAN safely turn this off for IIS, in fact, you MUST.**
  1167. ; http://php.net/cgi.force-redirect
  1168. ;cgi.force_redirect = 1
  1169. ; if cgi.nph is enabled it will force cgi to always sent Status: 200 with
  1170. ; every request. PHP's default behavior is to disable this feature.
  1171. ;cgi.nph = 1
  1172. ; if cgi.force_redirect is turned on, and you are not running under Apache or Netscape
  1173. ; (iPlanet) web servers, you MAY need to set an environment variable name that PHP
  1174. ; will look for to know it is OK to continue execution. Setting this variable MAY
  1175. ; cause security issues, KNOW WHAT YOU ARE DOING FIRST.
  1176. ; http://php.net/cgi.redirect-status-env
  1177. ;cgi.redirect_status_env =
  1178. ; cgi.fix_pathinfo provides *real* PATH_INFO/PATH_TRANSLATED support for CGI. PHP's
  1179. ; previous behaviour was to set PATH_TRANSLATED to SCRIPT_FILENAME, and to not grok
  1180. ; what PATH_INFO is. For more information on PATH_INFO, see the cgi specs. Setting
  1181. ; this to 1 will cause PHP CGI to fix its paths to conform to the spec. A setting
  1182. ; of zero causes PHP to behave as before. Default is 1. You should fix your scripts
  1183. ; to use SCRIPT_FILENAME rather than PATH_TRANSLATED.
  1184. ; http://php.net/cgi.fix-pathinfo
  1185. ;cgi.fix_pathinfo=1
  1186. ; if cgi.discard_path is enabled, the PHP CGI binary can safely be placed outside
  1187. ; of the web tree and people will not be able to circumvent .htaccess security.
  1188. ; http://php.net/cgi.dicard-path
  1189. ;cgi.discard_path=1
  1190. ; FastCGI under IIS (on WINNT based OS) supports the ability to impersonate
  1191. ; security tokens of the calling client. This allows IIS to define the
  1192. ; security context that the request runs under. mod_fastcgi under Apache
  1193. ; does not currently support this feature (03/17/2002)
  1194. ; Set to 1 if running under IIS. Default is zero.
  1195. ; http://php.net/fastcgi.impersonate
  1196. ;fastcgi.impersonate = 1
  1197. ; Disable logging through FastCGI connection. PHP's default behavior is to enable
  1198. ; this feature.
  1199. ;fastcgi.logging = 0
  1200. ; cgi.rfc2616_headers configuration option tells PHP what type of headers to
  1201. ; use when sending HTTP response code. If set to 0, PHP sends Status: header that
  1202. ; is supported by Apache. When this option is set to 1, PHP will send
  1203. ; RFC2616 compliant header.
  1204. ; Default is zero.
  1205. ; http://php.net/cgi.rfc2616-headers
  1206. ;cgi.rfc2616_headers = 0
  1207. ; cgi.check_shebang_line controls whether CGI PHP checks for line starting with #!
  1208. ; (shebang) at the top of the running script. This line might be needed if the
  1209. ; script support running both as stand-alone script and via PHP CGI<. PHP in CGI
  1210. ; mode skips this line and ignores its content if this directive is turned on.
  1211. ; http://php.net/cgi.check-shebang-line
  1212. ;cgi.check_shebang_line=1
  1213. ;;;;;;;;;;;;;;;;
  1214. ; File Uploads ;
  1215. ;;;;;;;;;;;;;;;;
  1216. ; Whether to allow HTTP file uploads.
  1217. ; http://php.net/file-uploads
  1218. file_uploads = On
  1219. ; Temporary directory for HTTP uploaded files (will use system default if not
  1220. ; specified).
  1221. ; http://php.net/upload-tmp-dir
  1222. ;upload_tmp_dir =
  1223. ; Maximum allowed size for uploaded files.
  1224. ; http://php.net/upload-max-filesize
  1225. upload_max_filesize = 2M
  1226. ; Maximum number of files that can be uploaded via a single request
  1227. max_file_uploads = 20
  1228. ;;;;;;;;;;;;;;;;;;
  1229. ; Fopen wrappers ;
  1230. ;;;;;;;;;;;;;;;;;;
  1231. ; Whether to allow the treatment of URLs (like http:// or ftp://) as files.
  1232. ; http://php.net/allow-url-fopen
  1233. allow_url_fopen = On
  1234. ; Whether to allow include/require to open URLs (like http:// or ftp://) as files.
  1235. ; http://php.net/allow-url-include
  1236. allow_url_include = Off
  1237. ; Define the anonymous ftp password (your email address). PHP's default setting
  1238. ; for this is empty.
  1239. ; http://php.net/from
  1240. ;from="john@doe.com"
  1241. ; Define the User-Agent string. PHP's default setting for this is empty.
  1242. ; http://php.net/user-agent
  1243. ;user_agent="PHP"
  1244. ; Default timeout for socket based streams (seconds)
  1245. ; http://php.net/default-socket-timeout
  1246. default_socket_timeout = 60
  1247. ; If your scripts have to deal with files from Macintosh systems,
  1248. ; or you are running on a Mac and need to deal with files from
  1249. ; unix or win32 systems, setting this flag will cause PHP to
  1250. ; automatically detect the EOL character in those files so that
  1251. ; fgets() and file() will work regardless of the source of the file.
  1252. ; http://php.net/auto-detect-line-endings
  1253. ;auto_detect_line_endings = Off
  1254. ;;;;;;;;;;;;;;;;;;;;;;
  1255. ; Dynamic Extensions ;
  1256. ;;;;;;;;;;;;;;;;;;;;;;
  1257. ; If you wish to have an extension loaded automatically, use the following
  1258. ; syntax:
  1259. ;
  1260. ; extension=modulename.extension
  1261. ;
  1262. ; For example, on Windows:
  1263. ;
  1264. ; extension=msql.dll
  1265. ;
  1266. ; ... or under UNIX:
  1267. ;
  1268. ; extension=msql.so
  1269. ;
  1270. ; ... or with a path:
  1271. ;
  1272. ; extension=/path/to/extension/msql.so
  1273. ;
  1274. ; If you only provide the name of the extension, PHP will look for it in its
  1275. ; default extension directory.
  1276. ;
  1277. ; Windows Extensions
  1278. ; Note that ODBC support is built in, so no dll is needed for it.
  1279. ; Note that many DLL files are located in the extensions/ (PHP 4) ext/ (PHP 5)
  1280. ; extension folders as well as the separate PECL DLL download (PHP 5).
  1281. ; Be sure to appropriately set the extension_dir directive.
  1282. ;
  1283. ;extension=php_bz2.dll
  1284. ;extension=php_curl.dll
  1285. ;extension=php_fileinfo.dll
  1286. ;extension=php_gd2.dll
  1287. ;extension=php_gettext.dll
  1288. ;extension=php_gmp.dll
  1289. ;extension=php_intl.dll
  1290. ;extension=php_imap.dll
  1291. ;extension=php_interbase.dll
  1292. ;extension=php_ldap.dll
  1293. ;extension=php_mbstring.dll
  1294. ;extension=php_exif.dll ; Must be after mbstring as it depends on it
  1295. ;extension=php_mysql.dll
  1296. ;extension=php_mysqli.dll
  1297. ;extension=php_oci8_12c.dll ; Use with Oracle Database 12c Instant Client
  1298. ;extension=php_openssl.dll
  1299. ;extension=php_pdo_firebird.dll
  1300. ;extension=php_pdo_mysql.dll
  1301. ;extension=php_pdo_oci.dll
  1302. ;extension=php_pdo_odbc.dll
  1303. ;extension=php_pdo_pgsql.dll
  1304. ;extension=php_pdo_sqlite.dll
  1305. ;extension=php_pgsql.dll
  1306. ;extension=php_shmop.dll
  1307. ; The MIBS data available in the PHP distribution must be installed.
  1308. ; See http://www.php.net/manual/en/snmp.installation.php
  1309. ;extension=php_snmp.dll
  1310. ;extension=php_soap.dll
  1311. ;extension=php_sockets.dll
  1312. ;extension=php_sqlite3.dll
  1313. ;extension=php_sybase_ct.dll
  1314. ;extension=php_tidy.dll
  1315. ;extension=php_xmlrpc.dll
  1316. ;extension=php_xsl.dll
  1317. ;;;;;;;;;;;;;;;;;;;
  1318. ; Module Settings ;
  1319. ;;;;;;;;;;;;;;;;;;;
  1320. [CLI Server]
  1321. ; Whether the CLI web server uses ANSI color coding in its terminal output.
  1322. cli_server.color = On
  1323. [Date]
  1324. ; Defines the default timezone used by the date functions
  1325. ; http://php.net/date.timezone
  1326. ;date.timezone =
  1327. ; http://php.net/date.default-latitude
  1328. ;date.default_latitude = 31.7667
  1329. ; http://php.net/date.default-longitude
  1330. ;date.default_longitude = 35.2333
  1331. ; http://php.net/date.sunrise-zenith
  1332. ;date.sunrise_zenith = 90.583333
  1333. ; http://php.net/date.sunset-zenith
  1334. ;date.sunset_zenith = 90.583333
  1335. [filter]
  1336. ; http://php.net/filter.default
  1337. ;filter.default = unsafe_raw
  1338. ; http://php.net/filter.default-flags
  1339. ;filter.default_flags =
  1340. [iconv]
  1341. ; Use of this INI entry is deprecated, use global input_encoding instead.
  1342. ; If empty, default_charset or input_encoding or iconv.input_encoding is used.
  1343. ; The precedence is: default_charset < intput_encoding < iconv.input_encoding
  1344. ;iconv.input_encoding =
  1345. ; Use of this INI entry is deprecated, use global internal_encoding instead.
  1346. ; If empty, default_charset or internal_encoding or iconv.internal_encoding is used.
  1347. ; The precedence is: default_charset < internal_encoding < iconv.internal_encoding
  1348. ;iconv.internal_encoding =
  1349. ; Use of this INI entry is deprecated, use global output_encoding instead.
  1350. ; If empty, default_charset or output_encoding or iconv.output_encoding is used.
  1351. ; The precedence is: default_charset < output_encoding < iconv.output_encoding
  1352. ; To use an output encoding conversion, iconv's output handler must be set
  1353. ; otherwise output encoding conversion cannot be performed.
  1354. ;iconv.output_encoding =
  1355. [intl]
  1356. ;intl.default_locale =
  1357. ; This directive allows you to produce PHP errors when some error
  1358. ; happens within intl functions. The value is the level of the error produced.
  1359. ; Default is 0, which does not produce any errors.
  1360. ;intl.error_level = E_WARNING
  1361. ;intl.use_exceptions = 0
  1362. [sqlite3]
  1363. ;sqlite3.extension_dir =
  1364. [Pcre]
  1365. ;PCRE library backtracking limit.
  1366. ; http://php.net/pcre.backtrack-limit
  1367. ;pcre.backtrack_limit=100000
  1368. ;PCRE library recursion limit.
  1369. ;Please note that if you set this value to a high number you may consume all
  1370. ;the available process stack and eventually crash PHP (due to reaching the
  1371. ;stack size limit imposed by the Operating System).
  1372. ; http://php.net/pcre.recursion-limit
  1373. ;pcre.recursion_limit=100000
  1374. [Pdo]
  1375. ; Whether to pool ODBC connections. Can be one of "strict", "relaxed" or "off"
  1376. ; http://php.net/pdo-odbc.connection-pooling
  1377. ;pdo_odbc.connection_pooling=strict
  1378. ;pdo_odbc.db2_instance_name
  1379. [Pdo_mysql]
  1380. ; If mysqlnd is used: Number of cache slots for the internal result set cache
  1381. ; http://php.net/pdo_mysql.cache_size
  1382. pdo_mysql.cache_size = 2000
  1383. ; Default socket name for local MySQL connects. If empty, uses the built-in
  1384. ; MySQL defaults.
  1385. ; http://php.net/pdo_mysql.default-socket
  1386. pdo_mysql.default_socket=
  1387. [Phar]
  1388. ; http://php.net/phar.readonly
  1389. ;phar.readonly = On
  1390. ; http://php.net/phar.require-hash
  1391. ;phar.require_hash = On
  1392. ;phar.cache_list =
  1393. [mail function]
  1394. ; For Win32 only.
  1395. ; http://php.net/smtp
  1396. SMTP = localhost
  1397. ; http://php.net/smtp-port
  1398. smtp_port = 25
  1399. ; For Win32 only.
  1400. ; http://php.net/sendmail-from
  1401. ;sendmail_from = me@example.com
  1402. ; For Unix only. You may supply arguments as well (default: "sendmail -t -i").
  1403. ; http://php.net/sendmail-path
  1404. ;sendmail_path =
  1405. ; Force the addition of the specified parameters to be passed as extra parameters
  1406. ; to the sendmail binary. These parameters will always replace the value of
  1407. ; the 5th parameter to mail().
  1408. ;mail.force_extra_parameters =
  1409. ; Add X-PHP-Originating-Script: that will include uid of the script followed by the filename
  1410. mail.add_x_header = On
  1411. ; The path to a log file that will log all mail() calls. Log entries include
  1412. ; the full path of the script, line number, To address and headers.
  1413. ;mail.log =
  1414. ; Log mail to syslog (Event Log on Windows).
  1415. ;mail.log = syslog
  1416. [SQL]
  1417. ; http://php.net/sql.safe-mode
  1418. sql.safe_mode = Off
  1419. [ODBC]
  1420. ; http://php.net/odbc.default-db
  1421. ;odbc.default_db = Not yet implemented
  1422. ; http://php.net/odbc.default-user
  1423. ;odbc.default_user = Not yet implemented
  1424. ; http://php.net/odbc.default-pw
  1425. ;odbc.default_pw = Not yet implemented
  1426. ; Controls the ODBC cursor model.
  1427. ; Default: SQL_CURSOR_STATIC (default).
  1428. ;odbc.default_cursortype
  1429. ; Allow or prevent persistent links.
  1430. ; http://php.net/odbc.allow-persistent
  1431. odbc.allow_persistent = On
  1432. ; Check that a connection is still valid before reuse.
  1433. ; http://php.net/odbc.check-persistent
  1434. odbc.check_persistent = On
  1435. ; Maximum number of persistent links. -1 means no limit.
  1436. ; http://php.net/odbc.max-persistent
  1437. odbc.max_persistent = -1
  1438. ; Maximum number of links (persistent + non-persistent). -1 means no limit.
  1439. ; http://php.net/odbc.max-links
  1440. odbc.max_links = -1
  1441. ; Handling of LONG fields. Returns number of bytes to variables. 0 means
  1442. ; passthru.
  1443. ; http://php.net/odbc.defaultlrl
  1444. odbc.defaultlrl = 4096
  1445. ; Handling of binary data. 0 means passthru, 1 return as is, 2 convert to char.
  1446. ; See the documentation on odbc_binmode and odbc_longreadlen for an explanation
  1447. ; of odbc.defaultlrl and odbc.defaultbinmode
  1448. ; http://php.net/odbc.defaultbinmode
  1449. odbc.defaultbinmode = 1
  1450. ;birdstep.max_links = -1
  1451. [Interbase]
  1452. ; Allow or prevent persistent links.
  1453. ibase.allow_persistent = 1
  1454. ; Maximum number of persistent links. -1 means no limit.
  1455. ibase.max_persistent = -1
  1456. ; Maximum number of links (persistent + non-persistent). -1 means no limit.
  1457. ibase.max_links = -1
  1458. ; Default database name for ibase_connect().
  1459. ;ibase.default_db =
  1460. ; Default username for ibase_connect().
  1461. ;ibase.default_user =
  1462. ; Default password for ibase_connect().
  1463. ;ibase.default_password =
  1464. ; Default charset for ibase_connect().
  1465. ;ibase.default_charset =
  1466. ; Default timestamp format.
  1467. ibase.timestampformat = "%Y-%m-%d %H:%M:%S"
  1468. ; Default date format.
  1469. ibase.dateformat = "%Y-%m-%d"
  1470. ; Default time format.
  1471. ibase.timeformat = "%H:%M:%S"
  1472. [MySQL]
  1473. ; Allow accessing, from PHP's perspective, local files with LOAD DATA statements
  1474. ; http://php.net/mysql.allow_local_infile
  1475. mysql.allow_local_infile = On
  1476. ; Allow or prevent persistent links.
  1477. ; http://php.net/mysql.allow-persistent
  1478. mysql.allow_persistent = On
  1479. ; If mysqlnd is used: Number of cache slots for the internal result set cache
  1480. ; http://php.net/mysql.cache_size
  1481. mysql.cache_size = 2000
  1482. ; Maximum number of persistent links. -1 means no limit.
  1483. ; http://php.net/mysql.max-persistent
  1484. mysql.max_persistent = -1
  1485. ; Maximum number of links (persistent + non-persistent). -1 means no limit.
  1486. ; http://php.net/mysql.max-links
  1487. mysql.max_links = -1
  1488. ; Default port number for mysql_connect(). If unset, mysql_connect() will use
  1489. ; the $MYSQL_TCP_PORT or the mysql-tcp entry in /etc/services or the
  1490. ; compile-time value defined MYSQL_PORT (in that order). Win32 will only look
  1491. ; at MYSQL_PORT.
  1492. ; http://php.net/mysql.default-port
  1493. mysql.default_port =
  1494. ; Default socket name for local MySQL connects. If empty, uses the built-in
  1495. ; MySQL defaults.
  1496. ; http://php.net/mysql.default-socket
  1497. mysql.default_socket =
  1498. ; Default host for mysql_connect() (doesn't apply in safe mode).
  1499. ; http://php.net/mysql.default-host
  1500. mysql.default_host =
  1501. ; Default user for mysql_connect() (doesn't apply in safe mode).
  1502. ; http://php.net/mysql.default-user
  1503. mysql.default_user =
  1504. ; Default password for mysql_connect() (doesn't apply in safe mode).
  1505. ; Note that this is generally a *bad* idea to store passwords in this file.
  1506. ; *Any* user with PHP access can run 'echo get_cfg_var("mysql.default_password")
  1507. ; and reveal this password! And of course, any users with read access to this
  1508. ; file will be able to reveal the password as well.
  1509. ; http://php.net/mysql.default-password
  1510. mysql.default_password =
  1511. ; Maximum time (in seconds) for connect timeout. -1 means no limit
  1512. ; http://php.net/mysql.connect-timeout
  1513. mysql.connect_timeout = 60
  1514. ; Trace mode. When trace_mode is active (=On), warnings for table/index scans and
  1515. ; SQL-Errors will be displayed.
  1516. ; http://php.net/mysql.trace-mode
  1517. mysql.trace_mode = Off
  1518. [MySQLi]
  1519. ; Maximum number of persistent links. -1 means no limit.
  1520. ; http://php.net/mysqli.max-persistent
  1521. mysqli.max_persistent = -1
  1522. ; Allow accessing, from PHP's perspective, local files with LOAD DATA statements
  1523. ; http://php.net/mysqli.allow_local_infile
  1524. ;mysqli.allow_local_infile = On
  1525. ; Allow or prevent persistent links.
  1526. ; http://php.net/mysqli.allow-persistent
  1527. mysqli.allow_persistent = On
  1528. ; Maximum number of links. -1 means no limit.
  1529. ; http://php.net/mysqli.max-links
  1530. mysqli.max_links = -1
  1531. ; If mysqlnd is used: Number of cache slots for the internal result set cache
  1532. ; http://php.net/mysqli.cache_size
  1533. mysqli.cache_size = 2000
  1534. ; Default port number for mysqli_connect(). If unset, mysqli_connect() will use
  1535. ; the $MYSQL_TCP_PORT or the mysql-tcp entry in /etc/services or the
  1536. ; compile-time value defined MYSQL_PORT (in that order). Win32 will only look
  1537. ; at MYSQL_PORT.
  1538. ; http://php.net/mysqli.default-port
  1539. mysqli.default_port = 3306
  1540. ; Default socket name for local MySQL connects. If empty, uses the built-in
  1541. ; MySQL defaults.
  1542. ; http://php.net/mysqli.default-socket
  1543. mysqli.default_socket =
  1544. ; Default host for mysql_connect() (doesn't apply in safe mode).
  1545. ; http://php.net/mysqli.default-host
  1546. mysqli.default_host =
  1547. ; Default user for mysql_connect() (doesn't apply in safe mode).
  1548. ; http://php.net/mysqli.default-user
  1549. mysqli.default_user =
  1550. ; Default password for mysqli_connect() (doesn't apply in safe mode).
  1551. ; Note that this is generally a *bad* idea to store passwords in this file.
  1552. ; *Any* user with PHP access can run 'echo get_cfg_var("mysqli.default_pw")
  1553. ; and reveal this password! And of course, any users with read access to this
  1554. ; file will be able to reveal the password as well.
  1555. ; http://php.net/mysqli.default-pw
  1556. mysqli.default_pw =
  1557. ; Allow or prevent reconnect
  1558. mysqli.reconnect = Off
  1559. [mysqlnd]
  1560. ; Enable / Disable collection of general statistics by mysqlnd which can be
  1561. ; used to tune and monitor MySQL operations.
  1562. ; http://php.net/mysqlnd.collect_statistics
  1563. mysqlnd.collect_statistics = On
  1564. ; Enable / Disable collection of memory usage statistics by mysqlnd which can be
  1565. ; used to tune and monitor MySQL operations.
  1566. ; http://php.net/mysqlnd.collect_memory_statistics
  1567. mysqlnd.collect_memory_statistics = Off
  1568. ; Records communication from all extensions using mysqlnd to the specified log
  1569. ; file.
  1570. ; http://php.net/mysqlnd.debug
  1571. ;mysqlnd.debug =
  1572. ; Defines which queries will be logged.
  1573. ; http://php.net/mysqlnd.log_mask
  1574. ;mysqlnd.log_mask = 0
  1575. ; Default size of the mysqlnd memory pool, which is used by result sets.
  1576. ; http://php.net/mysqlnd.mempool_default_size
  1577. ;mysqlnd.mempool_default_size = 16000
  1578. ; Size of a pre-allocated buffer used when sending commands to MySQL in bytes.
  1579. ; http://php.net/mysqlnd.net_cmd_buffer_size
  1580. ;mysqlnd.net_cmd_buffer_size = 2048
  1581. ; Size of a pre-allocated buffer used for reading data sent by the server in
  1582. ; bytes.
  1583. ; http://php.net/mysqlnd.net_read_buffer_size
  1584. ;mysqlnd.net_read_buffer_size = 32768
  1585. ; Timeout for network requests in seconds.
  1586. ; http://php.net/mysqlnd.net_read_timeout
  1587. ;mysqlnd.net_read_timeout = 31536000
  1588. ; SHA-256 Authentication Plugin related. File with the MySQL server public RSA
  1589. ; key.
  1590. ; http://php.net/mysqlnd.sha256_server_public_key
  1591. ;mysqlnd.sha256_server_public_key =
  1592. [OCI8]
  1593. ; Connection: Enables privileged connections using external
  1594. ; credentials (OCI_SYSOPER, OCI_SYSDBA)
  1595. ; http://php.net/oci8.privileged-connect
  1596. ;oci8.privileged_connect = Off
  1597. ; Connection: The maximum number of persistent OCI8 connections per
  1598. ; process. Using -1 means no limit.
  1599. ; http://php.net/oci8.max-persistent
  1600. ;oci8.max_persistent = -1
  1601. ; Connection: The maximum number of seconds a process is allowed to
  1602. ; maintain an idle persistent connection. Using -1 means idle
  1603. ; persistent connections will be maintained forever.
  1604. ; http://php.net/oci8.persistent-timeout
  1605. ;oci8.persistent_timeout = -1
  1606. ; Connection: The number of seconds that must pass before issuing a
  1607. ; ping during oci_pconnect() to check the connection validity. When
  1608. ; set to 0, each oci_pconnect() will cause a ping. Using -1 disables
  1609. ; pings completely.
  1610. ; http://php.net/oci8.ping-interval
  1611. ;oci8.ping_interval = 60
  1612. ; Connection: Set this to a user chosen connection class to be used
  1613. ; for all pooled server requests with Oracle 11g Database Resident
  1614. ; Connection Pooling (DRCP). To use DRCP, this value should be set to
  1615. ; the same string for all web servers running the same application,
  1616. ; the database pool must be configured, and the connection string must
  1617. ; specify to use a pooled server.
  1618. ;oci8.connection_class =
  1619. ; High Availability: Using On lets PHP receive Fast Application
  1620. ; Notification (FAN) events generated when a database node fails. The
  1621. ; database must also be configured to post FAN events.
  1622. ;oci8.events = Off
  1623. ; Tuning: This option enables statement caching, and specifies how
  1624. ; many statements to cache. Using 0 disables statement caching.
  1625. ; http://php.net/oci8.statement-cache-size
  1626. ;oci8.statement_cache_size = 20
  1627. ; Tuning: Enables statement prefetching and sets the default number of
  1628. ; rows that will be fetched automatically after statement execution.
  1629. ; http://php.net/oci8.default-prefetch
  1630. ;oci8.default_prefetch = 100
  1631. ; Compatibility. Using On means oci_close() will not close
  1632. ; oci_connect() and oci_new_connect() connections.
  1633. ; http://php.net/oci8.old-oci-close-semantics
  1634. ;oci8.old_oci_close_semantics = Off
  1635. [PostgreSQL]
  1636. ; Allow or prevent persistent links.
  1637. ; http://php.net/pgsql.allow-persistent
  1638. pgsql.allow_persistent = On
  1639. ; Detect broken persistent links always with pg_pconnect().
  1640. ; Auto reset feature requires a little overheads.
  1641. ; http://php.net/pgsql.auto-reset-persistent
  1642. pgsql.auto_reset_persistent = Off
  1643. ; Maximum number of persistent links. -1 means no limit.
  1644. ; http://php.net/pgsql.max-persistent
  1645. pgsql.max_persistent = -1
  1646. ; Maximum number of links (persistent+non persistent). -1 means no limit.
  1647. ; http://php.net/pgsql.max-links
  1648. pgsql.max_links = -1
  1649. ; Ignore PostgreSQL backends Notice message or not.
  1650. ; Notice message logging require a little overheads.
  1651. ; http://php.net/pgsql.ignore-notice
  1652. pgsql.ignore_notice = 0
  1653. ; Log PostgreSQL backends Notice message or not.
  1654. ; Unless pgsql.ignore_notice=0, module cannot log notice message.
  1655. ; http://php.net/pgsql.log-notice
  1656. pgsql.log_notice = 0
  1657. [Sybase-CT]
  1658. ; Allow or prevent persistent links.
  1659. ; http://php.net/sybct.allow-persistent
  1660. sybct.allow_persistent = On
  1661. ; Maximum number of persistent links. -1 means no limit.
  1662. ; http://php.net/sybct.max-persistent
  1663. sybct.max_persistent = -1
  1664. ; Maximum number of links (persistent + non-persistent). -1 means no limit.
  1665. ; http://php.net/sybct.max-links
  1666. sybct.max_links = -1
  1667. ; Minimum server message severity to display.
  1668. ; http://php.net/sybct.min-server-severity
  1669. sybct.min_server_severity = 10
  1670. ; Minimum client message severity to display.
  1671. ; http://php.net/sybct.min-client-severity
  1672. sybct.min_client_severity = 10
  1673. ; Set per-context timeout
  1674. ; http://php.net/sybct.timeout
  1675. ;sybct.timeout=
  1676. ;sybct.packet_size
  1677. ; The maximum time in seconds to wait for a connection attempt to succeed before returning failure.
  1678. ; Default: one minute
  1679. ;sybct.login_timeout=
  1680. ; The name of the host you claim to be connecting from, for display by sp_who.
  1681. ; Default: none
  1682. ;sybct.hostname=
  1683. ; Allows you to define how often deadlocks are to be retried. -1 means "forever".
  1684. ; Default: 0
  1685. ;sybct.deadlock_retry_count=
  1686. [bcmath]
  1687. ; Number of decimal digits for all bcmath functions.
  1688. ; http://php.net/bcmath.scale
  1689. bcmath.scale = 0
  1690. [browscap]
  1691. ; http://php.net/browscap
  1692. ;browscap = extra/browscap.ini
  1693. [Session]
  1694. ; Handler used to store/retrieve data.
  1695. ; http://php.net/session.save-handler
  1696. session.save_handler = files
  1697. ; Argument passed to save_handler. In the case of files, this is the path
  1698. ; where data files are stored. Note: Windows users have to change this
  1699. ; variable in order to use PHP's session functions.
  1700. ;
  1701. ; The path can be defined as:
  1702. ;
  1703. ; session.save_path = "N;/path"
  1704. ;
  1705. ; where N is an integer. Instead of storing all the session files in
  1706. ; /path, what this will do is use subdirectories N-levels deep, and
  1707. ; store the session data in those directories. This is useful if
  1708. ; your OS has problems with many files in one directory, and is
  1709. ; a more efficient layout for servers that handle many sessions.
  1710. ;
  1711. ; NOTE 1: PHP will not create this directory structure automatically.
  1712. ; You can use the script in the ext/session dir for that purpose.
  1713. ; NOTE 2: See the section on garbage collection below if you choose to
  1714. ; use subdirectories for session storage
  1715. ;
  1716. ; The file storage module creates files using mode 600 by default.
  1717. ; You can change that by using
  1718. ;
  1719. ; session.save_path = "N;MODE;/path"
  1720. ;
  1721. ; where MODE is the octal representation of the mode. Note that this
  1722. ; does not overwrite the process's umask.
  1723. ; http://php.net/session.save-path
  1724. ;session.save_path = "/tmp"
  1725. ; Whether to use strict session mode.
  1726. ; Strict session mode does not accept uninitialized session ID and regenerate
  1727. ; session ID if browser sends uninitialized session ID. Strict mode protects
  1728. ; applications from session fixation via session adoption vulnerability. It is
  1729. ; disabled by default for maximum compatibility, but enabling it is encouraged.
  1730. ; https://wiki.php.net/rfc/strict_sessions
  1731. session.use_strict_mode = 0
  1732. ; Whether to use cookies.
  1733. ; http://php.net/session.use-cookies
  1734. session.use_cookies = 1
  1735. ; http://php.net/session.cookie-secure
  1736. ;session.cookie_secure =
  1737. ; This option forces PHP to fetch and use a cookie for storing and maintaining
  1738. ; the session id. We encourage this operation as it's very helpful in combating
  1739. ; session hijacking when not specifying and managing your own session id. It is
  1740. ; not the be-all and end-all of session hijacking defense, but it's a good start.
  1741. ; http://php.net/session.use-only-cookies
  1742. session.use_only_cookies = 1
  1743. ; Name of the session (used as cookie name).
  1744. ; http://php.net/session.name
  1745. session.name = PHPSESSID
  1746. ; Initialize session on request startup.
  1747. ; http://php.net/session.auto-start
  1748. session.auto_start = 0
  1749. ; Lifetime in seconds of cookie or, if 0, until browser is restarted.
  1750. ; http://php.net/session.cookie-lifetime
  1751. session.cookie_lifetime = 0
  1752. ; The path for which the cookie is valid.
  1753. ; http://php.net/session.cookie-path
  1754. session.cookie_path = /
  1755. ; The domain for which the cookie is valid.
  1756. ; http://php.net/session.cookie-domain
  1757. session.cookie_domain =
  1758. ; Whether or not to add the httpOnly flag to the cookie, which makes it inaccessible to browser scripting languages such as JavaScript.
  1759. ; http://php.net/session.cookie-httponly
  1760. session.cookie_httponly =
  1761. ; Handler used to serialize data. php is the standard serializer of PHP.
  1762. ; http://php.net/session.serialize-handler
  1763. session.serialize_handler = php
  1764. ; Defines the probability that the 'garbage collection' process is started
  1765. ; on every session initialization. The probability is calculated by using
  1766. ; gc_probability/gc_divisor. Where session.gc_probability is the numerator
  1767. ; and gc_divisor is the denominator in the equation. Setting this value to 1
  1768. ; when the session.gc_divisor value is 100 will give you approximately a 1% chance
  1769. ; the gc will run on any give request.
  1770. ; Default Value: 1
  1771. ; Development Value: 1
  1772. ; Production Value: 1
  1773. ; http://php.net/session.gc-probability
  1774. session.gc_probability = 1
  1775. ; Defines the probability that the 'garbage collection' process is started on every
  1776. ; session initialization. The probability is calculated by using the following equation:
  1777. ; gc_probability/gc_divisor. Where session.gc_probability is the numerator and
  1778. ; session.gc_divisor is the denominator in the equation. Setting this value to 1
  1779. ; when the session.gc_divisor value is 100 will give you approximately a 1% chance
  1780. ; the gc will run on any give request. Increasing this value to 1000 will give you
  1781. ; a 0.1% chance the gc will run on any give request. For high volume production servers,
  1782. ; this is a more efficient approach.
  1783. ; Default Value: 100
  1784. ; Development Value: 1000
  1785. ; Production Value: 1000
  1786. ; http://php.net/session.gc-divisor
  1787. session.gc_divisor = 1000
  1788. ; After this number of seconds, stored data will be seen as 'garbage' and
  1789. ; cleaned up by the garbage collection process.
  1790. ; http://php.net/session.gc-maxlifetime
  1791. session.gc_maxlifetime = 1440
  1792. ; NOTE: If you are using the subdirectory option for storing session files
  1793. ; (see session.save_path above), then garbage collection does *not*
  1794. ; happen automatically. You will need to do your own garbage
  1795. ; collection through a shell script, cron entry, or some other method.
  1796. ; For example, the following script would is the equivalent of
  1797. ; setting session.gc_maxlifetime to 1440 (1440 seconds = 24 minutes):
  1798. ; find /path/to/sessions -cmin +24 -type f | xargs rm
  1799. ; Check HTTP Referer to invalidate externally stored URLs containing ids.
  1800. ; HTTP_REFERER has to contain this substring for the session to be
  1801. ; considered as valid.
  1802. ; http://php.net/session.referer-check
  1803. session.referer_check =
  1804. ; How many bytes to read from the file.
  1805. ; http://php.net/session.entropy-length
  1806. ;session.entropy_length = 32
  1807. ; Specified here to create the session id.
  1808. ; http://php.net/session.entropy-file
  1809. ; Defaults to /dev/urandom
  1810. ; On systems that don't have /dev/urandom but do have /dev/arandom, this will default to /dev/arandom
  1811. ; If neither are found at compile time, the default is no entropy file.
  1812. ; On windows, setting the entropy_length setting will activate the
  1813. ; Windows random source (using the CryptoAPI)
  1814. ;session.entropy_file = /dev/urandom
  1815. ; Set to {nocache,private,public,} to determine HTTP caching aspects
  1816. ; or leave this empty to avoid sending anti-caching headers.
  1817. ; http://php.net/session.cache-limiter
  1818. session.cache_limiter = nocache
  1819. ; Document expires after n minutes.
  1820. ; http://php.net/session.cache-expire
  1821. session.cache_expire = 180
  1822. ; trans sid support is disabled by default.
  1823. ; Use of trans sid may risk your users' security.
  1824. ; Use this option with caution.
  1825. ; - User may send URL contains active session ID
  1826. ; to other person via. email/irc/etc.
  1827. ; - URL that contains active session ID may be stored
  1828. ; in publicly accessible computer.
  1829. ; - User may access your site with the same session ID
  1830. ; always using URL stored in browser's history or bookmarks.
  1831. ; http://php.net/session.use-trans-sid
  1832. session.use_trans_sid = 0
  1833. ; Select a hash function for use in generating session ids.
  1834. ; Possible Values
  1835. ; 0 (MD5 128 bits)
  1836. ; 1 (SHA-1 160 bits)
  1837. ; This option may also be set to the name of any hash function supported by
  1838. ; the hash extension. A list of available hashes is returned by the hash_algos()
  1839. ; function.
  1840. ; http://php.net/session.hash-function
  1841. session.hash_function = 0
  1842. ; Define how many bits are stored in each character when converting
  1843. ; the binary hash data to something readable.
  1844. ; Possible values:
  1845. ; 4 (4 bits: 0-9, a-f)
  1846. ; 5 (5 bits: 0-9, a-v)
  1847. ; 6 (6 bits: 0-9, a-z, A-Z, "-", ",")
  1848. ; Default Value: 4
  1849. ; Development Value: 5
  1850. ; Production Value: 5
  1851. ; http://php.net/session.hash-bits-per-character
  1852. session.hash_bits_per_character = 5
  1853. ; The URL rewriter will look for URLs in a defined set of HTML tags.
  1854. ; form/fieldset are special; if you include them here, the rewriter will
  1855. ; add a hidden <input> field with the info which is otherwise appended
  1856. ; to URLs. If you want XHTML conformity, remove the form entry.
  1857. ; Note that all valid entries require a "=", even if no value follows.
  1858. ; Default Value: "a=href,area=href,frame=src,form=,fieldset="
  1859. ; Development Value: "a=href,area=href,frame=src,input=src,form=fakeentry"
  1860. ; Production Value: "a=href,area=href,frame=src,input=src,form=fakeentry"
  1861. ; http://php.net/url-rewriter.tags
  1862. url_rewriter.tags = "a=href,area=href,frame=src,input=src,form=fakeentry"
  1863. ; Enable upload progress tracking in $_SESSION
  1864. ; Default Value: On
  1865. ; Development Value: On
  1866. ; Production Value: On
  1867. ; http://php.net/session.upload-progress.enabled
  1868. ;session.upload_progress.enabled = On
  1869. ; Cleanup the progress information as soon as all POST data has been read
  1870. ; (i.e. upload completed).
  1871. ; Default Value: On
  1872. ; Development Value: On
  1873. ; Production Value: On
  1874. ; http://php.net/session.upload-progress.cleanup
  1875. ;session.upload_progress.cleanup = On
  1876. ; A prefix used for the upload progress key in $_SESSION
  1877. ; Default Value: "upload_progress_"
  1878. ; Development Value: "upload_progress_"
  1879. ; Production Value: "upload_progress_"
  1880. ; http://php.net/session.upload-progress.prefix
  1881. ;session.upload_progress.prefix = "upload_progress_"
  1882. ; The index name (concatenated with the prefix) in $_SESSION
  1883. ; containing the upload progress information
  1884. ; Default Value: "PHP_SESSION_UPLOAD_PROGRESS"
  1885. ; Development Value: "PHP_SESSION_UPLOAD_PROGRESS"
  1886. ; Production Value: "PHP_SESSION_UPLOAD_PROGRESS"
  1887. ; http://php.net/session.upload-progress.name
  1888. ;session.upload_progress.name = "PHP_SESSION_UPLOAD_PROGRESS"
  1889. ; How frequently the upload progress should be updated.
  1890. ; Given either in percentages (per-file), or in bytes
  1891. ; Default Value: "1%"
  1892. ; Development Value: "1%"
  1893. ; Production Value: "1%"
  1894. ; http://php.net/session.upload-progress.freq
  1895. ;session.upload_progress.freq = "1%"
  1896. ; The minimum delay between updates, in seconds
  1897. ; Default Value: 1
  1898. ; Development Value: 1
  1899. ; Production Value: 1
  1900. ; http://php.net/session.upload-progress.min-freq
  1901. ;session.upload_progress.min_freq = "1"
  1902. [MSSQL]
  1903. ; Allow or prevent persistent links.
  1904. mssql.allow_persistent = On
  1905. ; Maximum number of persistent links. -1 means no limit.
  1906. mssql.max_persistent = -1
  1907. ; Maximum number of links (persistent+non persistent). -1 means no limit.
  1908. mssql.max_links = -1
  1909. ; Minimum error severity to display.
  1910. mssql.min_error_severity = 10
  1911. ; Minimum message severity to display.
  1912. mssql.min_message_severity = 10
  1913. ; Compatibility mode with old versions of PHP 3.0.
  1914. mssql.compatibility_mode = Off
  1915. ; Connect timeout
  1916. ;mssql.connect_timeout = 5
  1917. ; Query timeout
  1918. ;mssql.timeout = 60
  1919. ; Valid range 0 - 2147483647. Default = 4096.
  1920. ;mssql.textlimit = 4096
  1921. ; Valid range 0 - 2147483647. Default = 4096.
  1922. ;mssql.textsize = 4096
  1923. ; Limits the number of records in each batch. 0 = all records in one batch.
  1924. ;mssql.batchsize = 0
  1925. ; Specify how datetime and datetim4 columns are returned
  1926. ; On => Returns data converted to SQL server settings
  1927. ; Off => Returns values as YYYY-MM-DD hh:mm:ss
  1928. ;mssql.datetimeconvert = On
  1929. ; Use NT authentication when connecting to the server
  1930. mssql.secure_connection = Off
  1931. ; Specify max number of processes. -1 = library default
  1932. ; msdlib defaults to 25
  1933. ; FreeTDS defaults to 4096
  1934. ;mssql.max_procs = -1
  1935. ; Specify client character set.
  1936. ; If empty or not set the client charset from freetds.conf is used
  1937. ; This is only used when compiled with FreeTDS
  1938. ;mssql.charset = "ISO-8859-1"
  1939. [Assertion]
  1940. ; Assert(expr); active by default.
  1941. ; http://php.net/assert.active
  1942. ;assert.active = On
  1943. ; Issue a PHP warning for each failed assertion.
  1944. ; http://php.net/assert.warning
  1945. ;assert.warning = On
  1946. ; Don't bail out by default.
  1947. ; http://php.net/assert.bail
  1948. ;assert.bail = Off
  1949. ; User-function to be called if an assertion fails.
  1950. ; http://php.net/assert.callback
  1951. ;assert.callback = 0
  1952. ; Eval the expression with current error_reporting(). Set to true if you want
  1953. ; error_reporting(0) around the eval().
  1954. ; http://php.net/assert.quiet-eval
  1955. ;assert.quiet_eval = 0
  1956. [COM]
  1957. ; path to a file containing GUIDs, IIDs or filenames of files with TypeLibs
  1958. ; http://php.net/com.typelib-file
  1959. ;com.typelib_file =
  1960. ; allow Distributed-COM calls
  1961. ; http://php.net/com.allow-dcom
  1962. ;com.allow_dcom = true
  1963. ; autoregister constants of a components typlib on com_load()
  1964. ; http://php.net/com.autoregister-typelib
  1965. ;com.autoregister_typelib = true
  1966. ; register constants casesensitive
  1967. ; http://php.net/com.autoregister-casesensitive
  1968. ;com.autoregister_casesensitive = false
  1969. ; show warnings on duplicate constant registrations
  1970. ; http://php.net/com.autoregister-verbose
  1971. ;com.autoregister_verbose = true
  1972. ; The default character set code-page to use when passing strings to and from COM objects.
  1973. ; Default: system ANSI code page
  1974. ;com.code_page=
  1975. [mbstring]
  1976. ; language for internal character representation.
  1977. ; This affects mb_send_mail() and mbstrig.detect_order.
  1978. ; http://php.net/mbstring.language
  1979. ;mbstring.language = Japanese
  1980. ; Use of this INI entry is deprecated, use global internal_encoding instead.
  1981. ; internal/script encoding.
  1982. ; Some encoding cannot work as internal encoding. (e.g. SJIS, BIG5, ISO-2022-*)
  1983. ; If empty, default_charset or internal_encoding or iconv.internal_encoding is used.
  1984. ; The precedence is: default_charset < internal_encoding < iconv.internal_encoding
  1985. ;mbstring.internal_encoding =
  1986. ; Use of this INI entry is deprecated, use global input_encoding instead.
  1987. ; http input encoding.
  1988. ; mbstring.encoding_traslation = On is needed to use this setting.
  1989. ; If empty, default_charset or input_encoding or mbstring.input is used.
  1990. ; The precedence is: default_charset < intput_encoding < mbsting.http_input
  1991. ; http://php.net/mbstring.http-input
  1992. ;mbstring.http_input =
  1993. ; Use of this INI entry is deprecated, use global output_encoding instead.
  1994. ; http output encoding.
  1995. ; mb_output_handler must be registered as output buffer to function.
  1996. ; If empty, default_charset or output_encoding or mbstring.http_output is used.
  1997. ; The precedence is: default_charset < output_encoding < mbstring.http_output
  1998. ; To use an output encoding conversion, mbstring's output handler must be set
  1999. ; otherwise output encoding conversion cannot be performed.
  2000. ; http://php.net/mbstring.http-output
  2001. ;mbstring.http_output =
  2002. ; enable automatic encoding translation according to
  2003. ; mbstring.internal_encoding setting. Input chars are
  2004. ; converted to internal encoding by setting this to On.
  2005. ; Note: Do _not_ use automatic encoding translation for
  2006. ; portable libs/applications.
  2007. ; http://php.net/mbstring.encoding-translation
  2008. ;mbstring.encoding_translation = Off
  2009. ; automatic encoding detection order.
  2010. ; "auto" detect order is changed according to mbstring.language
  2011. ; http://php.net/mbstring.detect-order
  2012. ;mbstring.detect_order = auto
  2013. ; substitute_character used when character cannot be converted
  2014. ; one from another
  2015. ; http://php.net/mbstring.substitute-character
  2016. ;mbstring.substitute_character = none
  2017. ; overload(replace) single byte functions by mbstring functions.
  2018. ; mail(), ereg(), etc are overloaded by mb_send_mail(), mb_ereg(),
  2019. ; etc. Possible values are 0,1,2,4 or combination of them.
  2020. ; For example, 7 for overload everything.
  2021. ; 0: No overload
  2022. ; 1: Overload mail() function
  2023. ; 2: Overload str*() functions
  2024. ; 4: Overload ereg*() functions
  2025. ; http://php.net/mbstring.func-overload
  2026. ;mbstring.func_overload = 0
  2027. ; enable strict encoding detection.
  2028. ; Default: Off
  2029. ;mbstring.strict_detection = On
  2030. ; This directive specifies the regex pattern of content types for which mb_output_handler()
  2031. ; is activated.
  2032. ; Default: mbstring.http_output_conv_mimetype=^(text/|application/xhtml\+xml)
  2033. ;mbstring.http_output_conv_mimetype=
  2034. [gd]
  2035. ; Tell the jpeg decode to ignore warnings and try to create
  2036. ; a gd image. The warning will then be displayed as notices
  2037. ; disabled by default
  2038. ; http://php.net/gd.jpeg-ignore-warning
  2039. ;gd.jpeg_ignore_warning = 0
  2040. [exif]
  2041. ; Exif UNICODE user comments are handled as UCS-2BE/UCS-2LE and JIS as JIS.
  2042. ; With mbstring support this will automatically be converted into the encoding
  2043. ; given by corresponding encode setting. When empty mbstring.internal_encoding
  2044. ; is used. For the decode settings you can distinguish between motorola and
  2045. ; intel byte order. A decode setting cannot be empty.
  2046. ; http://php.net/exif.encode-unicode
  2047. ;exif.encode_unicode = ISO-8859-15
  2048. ; http://php.net/exif.decode-unicode-motorola
  2049. ;exif.decode_unicode_motorola = UCS-2BE
  2050. ; http://php.net/exif.decode-unicode-intel
  2051. ;exif.decode_unicode_intel = UCS-2LE
  2052. ; http://php.net/exif.encode-jis
  2053. ;exif.encode_jis =
  2054. ; http://php.net/exif.decode-jis-motorola
  2055. ;exif.decode_jis_motorola = JIS
  2056. ; http://php.net/exif.decode-jis-intel
  2057. ;exif.decode_jis_intel = JIS
  2058. [Tidy]
  2059. ; The path to a default tidy configuration file to use when using tidy
  2060. ; http://php.net/tidy.default-config
  2061. ;tidy.default_config = /usr/local/lib/php/default.tcfg
  2062. ; Should tidy clean and repair output automatically?
  2063. ; WARNING: Do not use this option if you are generating non-html content
  2064. ; such as dynamic images
  2065. ; http://php.net/tidy.clean-output
  2066. tidy.clean_output = Off
  2067. [soap]
  2068. ; Enables or disables WSDL caching feature.
  2069. ; http://php.net/soap.wsdl-cache-enabled
  2070. soap.wsdl_cache_enabled=1
  2071. ; Sets the directory name where SOAP extension will put cache files.
  2072. ; http://php.net/soap.wsdl-cache-dir
  2073. soap.wsdl_cache_dir="/tmp"
  2074. ; (time to live) Sets the number of second while cached file will be used
  2075. ; instead of original one.
  2076. ; http://php.net/soap.wsdl-cache-ttl
  2077. soap.wsdl_cache_ttl=86400
  2078. ; Sets the size of the cache limit. (Max. number of WSDL files to cache)
  2079. soap.wsdl_cache_limit = 5
  2080. [sysvshm]
  2081. ; A default size of the shared memory segment
  2082. ;sysvshm.init_mem = 10000
  2083. [ldap]
  2084. ; Sets the maximum number of open links or -1 for unlimited.
  2085. ldap.max_links = -1
  2086. [mcrypt]
  2087. ; For more information about mcrypt settings see http://php.net/mcrypt-module-open
  2088. ; Directory where to load mcrypt algorithms
  2089. ; Default: Compiled in into libmcrypt (usually /usr/local/lib/libmcrypt)
  2090. ;mcrypt.algorithms_dir=
  2091. ; Directory where to load mcrypt modes
  2092. ; Default: Compiled in into libmcrypt (usually /usr/local/lib/libmcrypt)
  2093. ;mcrypt.modes_dir=
  2094. [dba]
  2095. ;dba.default_handler=
  2096. [opcache]
  2097. ; Determines if Zend OPCache is enabled
  2098. ;opcache.enable=0
  2099. ; Determines if Zend OPCache is enabled for the CLI version of PHP
  2100. ;opcache.enable_cli=0
  2101. ; The OPcache shared memory storage size.
  2102. ;opcache.memory_consumption=64
  2103. ; The amount of memory for interned strings in Mbytes.
  2104. ;opcache.interned_strings_buffer=4
  2105. ; The maximum number of keys (scripts) in the OPcache hash table.
  2106. ; Only numbers between 200 and 100000 are allowed.
  2107. ;opcache.max_accelerated_files=2000
  2108. ; The maximum percentage of "wasted" memory until a restart is scheduled.
  2109. ;opcache.max_wasted_percentage=5
  2110. ; When this directive is enabled, the OPcache appends the current working
  2111. ; directory to the script key, thus eliminating possible collisions between
  2112. ; files with the same name (basename). Disabling the directive improves
  2113. ; performance, but may break existing applications.
  2114. ;opcache.use_cwd=1
  2115. ; When disabled, you must reset the OPcache manually or restart the
  2116. ; webserver for changes to the filesystem to take effect.
  2117. ;opcache.validate_timestamps=1
  2118. ; How often (in seconds) to check file timestamps for changes to the shared
  2119. ; memory storage allocation. ("1" means validate once per second, but only
  2120. ; once per request. "0" means always validate)
  2121. ;opcache.revalidate_freq=2
  2122. ; Enables or disables file search in include_path optimization
  2123. ;opcache.revalidate_path=0
  2124. ; If disabled, all PHPDoc comments are dropped from the code to reduce the
  2125. ; size of the optimized code.
  2126. ;opcache.save_comments=1
  2127. ; If disabled, PHPDoc comments are not loaded from SHM, so "Doc Comments"
  2128. ; may be always stored (save_comments=1), but not loaded by applications
  2129. ; that don't need them anyway.
  2130. ;opcache.load_comments=1
  2131. ; If enabled, a fast shutdown sequence is used for the accelerated code
  2132. ;opcache.fast_shutdown=0
  2133. ; Allow file existence override (file_exists, etc.) performance feature.
  2134. ;opcache.enable_file_override=0
  2135. ; A bitmask, where each bit enables or disables the appropriate OPcache
  2136. ; passes
  2137. ;opcache.optimization_level=0xffffffff
  2138. ;opcache.inherited_hack=1
  2139. ;opcache.dups_fix=0
  2140. ; The location of the OPcache blacklist file (wildcards allowed).
  2141. ; Each OPcache blacklist file is a text file that holds the names of files
  2142. ; that should not be accelerated. The file format is to add each filename
  2143. ; to a new line. The filename may be a full path or just a file prefix
  2144. ; (i.e., /var/www/x blacklists all the files and directories in /var/www
  2145. ; that start with 'x'). Line starting with a ; are ignored (comments).
  2146. ;opcache.blacklist_filename=
  2147. ; Allows exclusion of large files from being cached. By default all files
  2148. ; are cached.
  2149. ;opcache.max_file_size=0
  2150. ; Check the cache checksum each N requests.
  2151. ; The default value of "0" means that the checks are disabled.
  2152. ;opcache.consistency_checks=0
  2153. ; How long to wait (in seconds) for a scheduled restart to begin if the cache
  2154. ; is not being accessed.
  2155. ;opcache.force_restart_timeout=180
  2156. ; OPcache error_log file name. Empty string assumes "stderr".
  2157. ;opcache.error_log=
  2158. ; All OPcache errors go to the Web server log.
  2159. ; By default, only fatal errors (level 0) or errors (level 1) are logged.
  2160. ; You can also enable warnings (level 2), info messages (level 3) or
  2161. ; debug messages (level 4).
  2162. ;opcache.log_verbosity_level=1
  2163. ; Preferred Shared Memory back-end. Leave empty and let the system decide.
  2164. ;opcache.preferred_memory_model=
  2165. ; Protect the shared memory from unexpected writing during script execution.
  2166. ; Useful for internal debugging only.
  2167. ;opcache.protect_memory=0
  2168. ; Validate cached file permissions.
  2169. ; opcache.validate_permission=0
  2170. ; Prevent name collisions in chroot'ed environment.
  2171. ; opcache.validate_root=0
  2172. [curl]
  2173. ; A default value for the CURLOPT_CAINFO option. This is required to be an
  2174. ; absolute path.
  2175. ;curl.cainfo =
  2176. [openssl]
  2177. ; The location of a Certificate Authority (CA) file on the local filesystem
  2178. ; to use when verifying the identity of SSL/TLS peers. Most users should
  2179. ; not specify a value for this directive as PHP will attempt to use the
  2180. ; OS-managed cert stores in its absence. If specified, this value may still
  2181. ; be overridden on a per-stream basis via the "cafile" SSL stream context
  2182. ; option.
  2183. ;openssl.cafile=
  2184. ; If openssl.cafile is not specified or if the CA file is not found, the
  2185. ; directory pointed to by openssl.capath is searched for a suitable
  2186. ; certificate. This value must be a correctly hashed certificate directory.
  2187. ; Most users should not specify a value for this directive as PHP will
  2188. ; attempt to use the OS-managed cert stores in its absence. If specified,
  2189. ; this value may still be overridden on a per-stream basis via the "capath"
  2190. ; SSL stream context option.
  2191. ;openssl.capath=
  2192. ; Local Variables:
  2193. ; tab-width: 4
  2194. ; End:
  2195. EOF
# 查看目录树
$ tree -p 
.
├── [-rw-r--r--]  Dockerfile
├── [-rw-r--r--]  php-5.6.36.tar.gz
├── [-rw-r--r--]  php-fpm.conf
└── [-rw-r--r--]  php.ini

0 directories, 4 files

:::color5 MySQL 的部署目录

:::

# data 数据的持久化
$ cd mysql && mkdir -pv {conf,data}

# conf/my.cnf
$ cat > conf/my.cnf <<EOF
[mysqld]
user = mysql
port = 3306
datadir = /var/lib/mysql
socket  = /var/lib/mysql/mysql.sock
pid-file  = /var/run/mysql/mysql.pid
log_error = /var/log/mysql/error.log
# character_set_server = utf8
# character_set_client = utf8
max_connections = 3600
EOF

# 查看目录树
$ tree -p 
.
├── [drwxr-xr-x]  conf
│   └── [-rw-r--r--]  my.cnf
└── [drwxr-xr-x]  data

2 directories, 1 file

:::color5 wwwroot 的部署目录

:::

echo "<?php phpinfo();?>" > wwwroot/index.php
# 写入该文件即可

:::color5 Docker-Compose 项目的整体目录树

:::

$ tree -p 
.
├── [-rw-r--r--]  docker-compose.yml
├── [drwxr-xr-x]  mysql
│   ├── [drwxr-xr-x]  conf
│   │   └── [-rw-r--r--]  my.cnf
│   └── [drwxr-xr-x]  data
├── [drwxr-xr-x]  nginx
│   ├── [-rw-r--r--]  Dockerfile
│   ├── [-rw-r--r--]  nginx-1.21.1.tar.gz
│   ├── [-rw-r--r--]  nginx.conf
│   └── [-rw-r--r--]  php.conf
├── [drwxr-xr-x]  php
│   ├── [-rw-r--r--]  Dockerfile
│   ├── [-rw-r--r--]  php-5.6.36.tar.gz
│   ├── [-rw-r--r--]  php-fpm.conf
│   └── [-rw-r--r--]  php.ini
└── [drwxr-xr-x]  wwwroot
    └── [-rw-r--r--]  index.php

6 directories, 11 files
# 运行Docker-Compose项目
$ docker-compose up -d 
$ docker-compose build

# 查看Docker-Compose项目进程情况
$ docker-compose ps 
        Name                      Command               State                          Ports                       
-------------------------------------------------------------------------------------------------------------------
compose-lnmp_mysql_1   docker-entrypoint.sh --cha ...   Up      0.0.0.0:3306->3306/tcp,:::3306->3306/tcp, 33060/tcp
compose-lnmp_nginx_1   nginx -g daemon off;             Up      0.0.0.0:80->80/tcp,:::80->80/tcp                   
compose-lnmp_php_1     php-fpm                          Up      9000/tcp          
$ curl 127.0.0.1/index.php
<?php phpinfo();?>

# 将wordpress的压缩包解压到 wwwroot 目录下

  • Nginx 部署

Nginx Dockerfile

FROM centos:6

MAINTAINER <zhongzhiwei zhongzhiwei@kubesphere.io>
# 获取最新Yum源信息 & 下载相应软件
RUN curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-vault-6.10.repo && \
yum install -y gcc gcc-c++ make openssh-server pcre-devel openssl zlib-devel

ADD http://nginx.org/download/nginx-1.12.2.tar.gz /tmp
RUN cd /tmp && \
    tar -zxvf nginx-1.12.2.tar.gz && \
    cd nginx-1.12.2 && \
    ./configure --prefix=/usr/local/nginx && \
    make -j 4 && make install

RUN useradd nginx

# nginx.conf 配置文件内容
# user nginx;
# worker_processes auto;
# error_log /var/log/nginx/error.log;
# pid /run/nginx.pid;
# 
# events {
#     worker_connections 1024;
# }
# 
# http {
#     log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
#                       '$status $body_bytes_sent "$http_referer" '
#                       '"$http_user_agent" "$http_x_forwarded_for"';
# 
#     access_log  logs/access.log  main;
# 
#     sendfile            on;
#     tcp_nopush          on;
#     tcp_nodelay         on;
#     keepalive_timeout   65;
#     types_hash_max_size 4096;
# 
#     include /etc/nginx/conf.d/*.conf;
# 
#     server {
#         listen       80;
#         listen       [::]:80;
#         server_name  localhost;
#         root         html;
# 
#         index index.html index.php;
#         location ~ \.php$ {
#             root html;
# 
#             fastcgi_pass php-cgi:9000;
#             fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
#             include fastcgi_params;
#         }
#     }
# }
COPY nginx.conf /usr/local/nginx/conf

# 声明容器服务端口
EXPOSE 80

# 启动Nginx服务
CMD ["/usr/local/nginx/sbin/nginx", "-g", "daemon off;"]

Nginx 配置文件

user nginx;
worker_processes auto;
error_log logs/error.log info;
pid       logs/nginx.pid;

events {
    worker_connections 1024;
}

http {
    log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
                      '$status $body_bytes_sent "$http_referer" '
                      '"$http_user_agent" "$http_x_forwarded_for"';

    access_log  logs/access.log  main;

    sendfile            on;
    tcp_nopush          on;
    tcp_nodelay         on;
    keepalive_timeout   65;
    types_hash_max_size 4096;

    # include /etc/nginx/conf.d/*.conf;

    server {
        listen       80;
        listen       [::]:80;
        server_name  localhost;
        root         html;

        index index.html index.php;
        location ~ \.php$ {
            root html;
            fastcgi_pass php-cgi:9000;
            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
            include fastcgi_params;
        }
    }
}
  • MySQL 部署

MySQL 配置文件

mkdir conf && cd conf && vim my.cnf
[mysqld]
user = mysql
port = 3306
datadir = /var/lib/mysql
socket  = /var/lib/mysql/mysql.sock
pid-file  = /var/run/mysql/mysql.pid
log_error = /var/log/mysql/error.log
character_set_server = utf8mb4
character_set_client = utf8mb4
max_connections = 3600
  • php 部署

php Dockerfile

FROM centos:6

MAINTAINER <zhongzhiwei zhongzhiwei@kubesphere.io>

# 获取最新Yum源信息 & 下载相应软件
RUN curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-vault-6.10.repo && \
    yum install -y gcc gcc-c++ gd-devel libxml2-devel libcurl-devel libjpeg-devel libpng-devel openssl-devel

ADD http://docs.php.net/distributions/php-5.6.31.tar.gz /tmp/
RUN cd /tmp/php-5.6.31 && \ 
    ./configure --prefix=/usr/local/php \
    --with-config-file-path=/usr/local/php/etc \
    --with-mysql --with-mysqli \
    --with-openssl --with-ziib --with-curl --with-gd \
    --with-jpeg-dir --with-png-dir --with-iconv \
    --enable-fpm --enable-zip --enable-mbstring && \
    make -j 4 && \
    make install && \
    cp /usr/local/php/etc/php-fpm.conf.default /usr/local/php/etc/php-fpm.conf && \
    sed -i "s/127.0.0.1/0.0.0.0/" /usr/local/php/etc/php-fpm.conf && \
    cp ./sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm && \
    chmod +x /etc/init.d/php-fpm

# rm -rf /tmp /php-5.6.31
COPY php.ini /usr/local/php/etc 
CMD /etc/init.d/php-fpm start && tail -F /var/log/messages
# 声明容器服务端口
EXPOSE 9000

php 配置文件[ 设置时区为上海时区 ]

[PHP]

;;;;;;;;;;;;;;;;;;;
; About php.ini   ;
;;;;;;;;;;;;;;;;;;;
; PHP's initialization file, generally called php.ini, is responsible for
; configuring many of the aspects of PHP's behavior.

; PHP attempts to find and load this configuration from a number of locations.
; The following is a summary of its search order:
; 1. SAPI module specific location.
; 2. The PHPRC environment variable. (As of PHP 5.2.0)
; 3. A number of predefined registry keys on Windows (As of PHP 5.2.0)
; 4. Current working directory (except CLI)
; 5. The web server's directory (for SAPI modules), or directory of PHP
; (otherwise in Windows)
; 6. The directory from the --with-config-file-path compile time option, or the
; Windows directory (C:\windows or C:\winnt)
; See the PHP docs for more specific information.
; http://php.net/configuration.file

; The syntax of the file is extremely simple.  Whitespace and lines
; beginning with a semicolon are silently ignored (as you probably guessed).
; Section headers (e.g. [Foo]) are also silently ignored, even though
; they might mean something in the future.

; Directives following the section heading [PATH=/www/mysite] only
; apply to PHP files in the /www/mysite directory.  Directives
; following the section heading [HOST=www.example.com] only apply to
; PHP files served from www.example.com.  Directives set in these
; special sections cannot be overridden by user-defined INI files or
; at runtime. Currently, [PATH=] and [HOST=] sections only work under
; CGI/FastCGI.
; http://php.net/ini.sections

; Directives are specified using the following syntax:
; directive = value
; Directive names are *case sensitive* - foo=bar is different from FOO=bar.
; Directives are variables used to configure PHP or PHP extensions.
; There is no name validation.  If PHP can't find an expected
; directive because it is not set or is mistyped, a default value will be used.

; The value can be a string, a number, a PHP constant (e.g. E_ALL or M_PI), one
; of the INI constants (On, Off, True, False, Yes, No and None) or an expression
; (e.g. E_ALL & ~E_NOTICE), a quoted string ("bar"), or a reference to a
; previously set variable or directive (e.g. ${foo})

; Expressions in the INI file are limited to bitwise operators and parentheses:
; |  bitwise OR
; ^  bitwise XOR
; &  bitwise AND
; ~  bitwise NOT
; !  boolean NOT

; Boolean flags can be turned on using the values 1, On, True or Yes.
; They can be turned off using the values 0, Off, False or No.

; An empty string can be denoted by simply not writing anything after the equal
; sign, or by using the None keyword:

;  foo =         ; sets foo to an empty string
;  foo = None    ; sets foo to an empty string
;  foo = "None"  ; sets foo to the string 'None'

; If you use constants in your value, and these constants belong to a
; dynamically loaded extension (either a PHP extension or a Zend extension),
; you may only use these constants *after* the line that loads the extension.

;;;;;;;;;;;;;;;;;;;
; About this file ;
;;;;;;;;;;;;;;;;;;;
; PHP comes packaged with two INI files. One that is recommended to be used
; in production environments and one that is recommended to be used in
; development environments.

; php.ini-production contains settings which hold security, performance and
; best practices at its core. But please be aware, these settings may break
; compatibility with older or less security conscience applications. We
; recommending using the production ini in production and testing environments.

; php.ini-development is very similar to its production variant, except it is
; much more verbose when it comes to errors. We recommend using the
; development version only in development environments, as errors shown to
; application users can inadvertently leak otherwise secure information.

; This is php.ini-development INI file.

;;;;;;;;;;;;;;;;;;;
; Quick Reference ;
;;;;;;;;;;;;;;;;;;;
; The following are all the settings which are different in either the production
; or development versions of the INIs with respect to PHP's default behavior.
; Please see the actual settings later in the document for more details as to why
; we recommend these changes in PHP's behavior.

; display_errors
;   Default Value: On
;   Development Value: On
;   Production Value: Off

; display_startup_errors
;   Default Value: Off
;   Development Value: On
;   Production Value: Off

; error_reporting
;   Default Value: E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED
;   Development Value: E_ALL
;   Production Value: E_ALL & ~E_DEPRECATED & ~E_STRICT

; html_errors
;   Default Value: On
;   Development Value: On
;   Production value: On

; log_errors
;   Default Value: Off
;   Development Value: On
;   Production Value: On

; max_input_time
;   Default Value: -1 (Unlimited)
;   Development Value: 60 (60 seconds)
;   Production Value: 60 (60 seconds)

; output_buffering
;   Default Value: Off
;   Development Value: 4096
;   Production Value: 4096

; register_argc_argv
;   Default Value: On
;   Development Value: Off
;   Production Value: Off

; request_order
;   Default Value: None
;   Development Value: "GP"
;   Production Value: "GP"

; session.gc_divisor
;   Default Value: 100
;   Development Value: 1000
;   Production Value: 1000

; session.hash_bits_per_character
;   Default Value: 4
;   Development Value: 5
;   Production Value: 5

; short_open_tag
;   Default Value: On
;   Development Value: Off
;   Production Value: Off

; track_errors
;   Default Value: Off
;   Development Value: On
;   Production Value: Off

; url_rewriter.tags
;   Default Value: "a=href,area=href,frame=src,form=,fieldset="
;   Development Value: "a=href,area=href,frame=src,input=src,form=fakeentry"
;   Production Value: "a=href,area=href,frame=src,input=src,form=fakeentry"

; variables_order
;   Default Value: "EGPCS"
;   Development Value: "GPCS"
;   Production Value: "GPCS"

;;;;;;;;;;;;;;;;;;;;
; php.ini Options  ;
;;;;;;;;;;;;;;;;;;;;
; Name for user-defined php.ini (.htaccess) files. Default is ".user.ini"
;user_ini.filename = ".user.ini"

; To disable this feature set this option to empty value
;user_ini.filename =

; TTL for user-defined php.ini files (time-to-live) in seconds. Default is 300 seconds (5 minutes)
;user_ini.cache_ttl = 300

;;;;;;;;;;;;;;;;;;;;
; Language Options ;
;;;;;;;;;;;;;;;;;;;;

; Enable the PHP scripting language engine under Apache.
; http://php.net/engine
engine = On

; This directive determines whether or not PHP will recognize code between
; <? and ?> tags as PHP source which should be processed as such. It is
; generally recommended that <?php and ?> should be used and that this feature
; should be disabled, as enabling it may result in issues when generating XML
; documents, however this remains supported for backward compatibility reasons.
; Note that this directive does not control the <?= shorthand tag, which can be
; used regardless of this directive.
; Default Value: On
; Development Value: Off
; Production Value: Off
; http://php.net/short-open-tag
short_open_tag = Off

; Allow ASP-style <% %> tags.
; http://php.net/asp-tags
asp_tags = Off

; The number of significant digits displayed in floating point numbers.
; http://php.net/precision
precision = 14

; Output buffering is a mechanism for controlling how much output data
; (excluding headers and cookies) PHP should keep internally before pushing that
; data to the client. If your application's output exceeds this setting, PHP
; will send that data in chunks of roughly the size you specify.
; Turning on this setting and managing its maximum buffer size can yield some
; interesting side-effects depending on your application and web server.
; You may be able to send headers and cookies after you've already sent output
; through print or echo. You also may see performance benefits if your server is
; emitting less packets due to buffered output versus PHP streaming the output
; as it gets it. On production servers, 4096 bytes is a good setting for performance
; reasons.
; Note: Output buffering can also be controlled via Output Buffering Control
;   functions.
; Possible Values:
;   On = Enabled and buffer is unlimited. (Use with caution)
;   Off = Disabled
;   Integer = Enables the buffer and sets its maximum size in bytes.
; Note: This directive is hardcoded to Off for the CLI SAPI
; Default Value: Off
; Development Value: 4096
; Production Value: 4096
; http://php.net/output-buffering
output_buffering = 4096

; You can redirect all of the output of your scripts to a function.  For
; example, if you set output_handler to "mb_output_handler", character
; encoding will be transparently converted to the specified encoding.
; Setting any output handler automatically turns on output buffering.
; Note: People who wrote portable scripts should not depend on this ini
;   directive. Instead, explicitly set the output handler using ob_start().
;   Using this ini directive may cause problems unless you know what script
;   is doing.
; Note: You cannot use both "mb_output_handler" with "ob_iconv_handler"
;   and you cannot use both "ob_gzhandler" and "zlib.output_compression".
; Note: output_handler must be empty if this is set 'On' !!!!
;   Instead you must use zlib.output_handler.
; http://php.net/output-handler
;output_handler =

; Transparent output compression using the zlib library
; Valid values for this option are 'off', 'on', or a specific buffer size
; to be used for compression (default is 4KB)
; Note: Resulting chunk size may vary due to nature of compression. PHP
;   outputs chunks that are few hundreds bytes each as a result of
;   compression. If you prefer a larger chunk size for better
;   performance, enable output_buffering in addition.
; Note: You need to use zlib.output_handler instead of the standard
;   output_handler, or otherwise the output will be corrupted.
; http://php.net/zlib.output-compression
zlib.output_compression = Off

; http://php.net/zlib.output-compression-level
;zlib.output_compression_level = -1

; You cannot specify additional output handlers if zlib.output_compression
; is activated here. This setting does the same as output_handler but in
; a different order.
; http://php.net/zlib.output-handler
;zlib.output_handler =

; Implicit flush tells PHP to tell the output layer to flush itself
; automatically after every output block.  This is equivalent to calling the
; PHP function flush() after each and every call to print() or echo() and each
; and every HTML block.  Turning this option on has serious performance
; implications and is generally recommended for debugging purposes only.
; http://php.net/implicit-flush
; Note: This directive is hardcoded to On for the CLI SAPI
implicit_flush = Off

; The unserialize callback function will be called (with the undefined class'
; name as parameter), if the unserializer finds an undefined class
; which should be instantiated. A warning appears if the specified function is
; not defined, or if the function doesn't include/implement the missing class.
; So only set this entry, if you really want to implement such a
; callback-function.
unserialize_callback_func =

; When floats & doubles are serialized store serialize_precision significant
; digits after the floating point. The default value ensures that when floats
; are decoded with unserialize, the data will remain the same.
serialize_precision = 17

; open_basedir, if set, limits all file operations to the defined directory
; and below.  This directive makes most sense if used in a per-directory
; or per-virtualhost web server configuration file.
; http://php.net/open-basedir
;open_basedir =

; This directive allows you to disable certain functions for security reasons.
; It receives a comma-delimited list of function names.
; http://php.net/disable-functions
disable_functions =

; This directive allows you to disable certain classes for security reasons.
; It receives a comma-delimited list of class names.
; http://php.net/disable-classes
disable_classes =

; Colors for Syntax Highlighting mode.  Anything that's acceptable in
; <span style="color: ???????"> would work.
; http://php.net/syntax-highlighting
;highlight.string  = #DD0000
;highlight.comment = #FF9900
;highlight.keyword = #007700
;highlight.default = #0000BB
;highlight.html    = #000000

; If enabled, the request will be allowed to complete even if the user aborts
; the request. Consider enabling it if executing long requests, which may end up
; being interrupted by the user or a browser timing out. PHP's default behavior
; is to disable this feature.
; http://php.net/ignore-user-abort
;ignore_user_abort = On

; Determines the size of the realpath cache to be used by PHP. This value should
; be increased on systems where PHP opens many files to reflect the quantity of
; the file operations performed.
; http://php.net/realpath-cache-size
;realpath_cache_size = 16k

; Duration of time, in seconds for which to cache realpath information for a given
; file or directory. For systems with rarely changing files, consider increasing this
; value.
; http://php.net/realpath-cache-ttl
;realpath_cache_ttl = 120

; Enables or disables the circular reference collector.
; http://php.net/zend.enable-gc
zend.enable_gc = On

; If enabled, scripts may be written in encodings that are incompatible with
; the scanner.  CP936, Big5, CP949 and Shift_JIS are the examples of such
; encodings.  To use this feature, mbstring extension must be enabled.
; Default: Off
;zend.multibyte = Off

; Allows to set the default encoding for the scripts.  This value will be used
; unless "declare(encoding=...)" directive appears at the top of the script.
; Only affects if zend.multibyte is set.
; Default: ""
;zend.script_encoding =

;;;;;;;;;;;;;;;;;
; Miscellaneous ;
;;;;;;;;;;;;;;;;;

; Decides whether PHP may expose the fact that it is installed on the server
; (e.g. by adding its signature to the Web server header).  It is no security
; threat in any way, but it makes it possible to determine whether you use PHP
; on your server or not.
; http://php.net/expose-php
expose_php = On

;;;;;;;;;;;;;;;;;;;
; Resource Limits ;
;;;;;;;;;;;;;;;;;;;

; Maximum execution time of each script, in seconds
; http://php.net/max-execution-time
; Note: This directive is hardcoded to 0 for the CLI SAPI
max_execution_time = 30

; Maximum amount of time each script may spend parsing request data. It's a good
; idea to limit this time on productions servers in order to eliminate unexpectedly
; long running scripts.
; Note: This directive is hardcoded to -1 for the CLI SAPI
; Default Value: -1 (Unlimited)
; Development Value: 60 (60 seconds)
; Production Value: 60 (60 seconds)
; http://php.net/max-input-time
max_input_time = 60

; Maximum input variable nesting level
; http://php.net/max-input-nesting-level
;max_input_nesting_level = 64

; How many GET/POST/COOKIE input variables may be accepted
; max_input_vars = 1000

; Maximum amount of memory a script may consume (128MB)
; http://php.net/memory-limit
memory_limit = 128M

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Error handling and logging ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

; This directive informs PHP of which errors, warnings and notices you would like
; it to take action for. The recommended way of setting values for this
; directive is through the use of the error level constants and bitwise
; operators. The error level constants are below here for convenience as well as
; some common settings and their meanings.
; By default, PHP is set to take action on all errors, notices and warnings EXCEPT
; those related to E_NOTICE and E_STRICT, which together cover best practices and
; recommended coding standards in PHP. For performance reasons, this is the
; recommend error reporting setting. Your production server shouldn't be wasting
; resources complaining about best practices and coding standards. That's what
; development servers and development settings are for.
; Note: The php.ini-development file has this setting as E_ALL. This
; means it pretty much reports everything which is exactly what you want during
; development and early testing.
;
; Error Level Constants:
; E_ALL             - All errors and warnings (includes E_STRICT as of PHP 5.4.0)
; E_ERROR           - fatal run-time errors
; E_RECOVERABLE_ERROR  - almost fatal run-time errors
; E_WARNING         - run-time warnings (non-fatal errors)
; E_PARSE           - compile-time parse errors
; E_NOTICE          - run-time notices (these are warnings which often result
;                     from a bug in your code, but it's possible that it was
;                     intentional (e.g., using an uninitialized variable and
;                     relying on the fact it is automatically initialized to an
;                     empty string)
; E_STRICT          - run-time notices, enable to have PHP suggest changes
;                     to your code which will ensure the best interoperability
;                     and forward compatibility of your code
; E_CORE_ERROR      - fatal errors that occur during PHP's initial startup
; E_CORE_WARNING    - warnings (non-fatal errors) that occur during PHP's
;                     initial startup
; E_COMPILE_ERROR   - fatal compile-time errors
; E_COMPILE_WARNING - compile-time warnings (non-fatal errors)
; E_USER_ERROR      - user-generated error message
; E_USER_WARNING    - user-generated warning message
; E_USER_NOTICE     - user-generated notice message
; E_DEPRECATED      - warn about code that will not work in future versions
;                     of PHP
; E_USER_DEPRECATED - user-generated deprecation warnings
;
; Common Values:
;   E_ALL (Show all errors, warnings and notices including coding standards.)
;   E_ALL & ~E_NOTICE  (Show all errors, except for notices)
;   E_ALL & ~E_NOTICE & ~E_STRICT  (Show all errors, except for notices and coding standards warnings.)
;   E_COMPILE_ERROR|E_RECOVERABLE_ERROR|E_ERROR|E_CORE_ERROR  (Show only errors)
; Default Value: E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED
; Development Value: E_ALL
; Production Value: E_ALL & ~E_DEPRECATED & ~E_STRICT
; http://php.net/error-reporting
error_reporting = E_ALL

; This directive controls whether or not and where PHP will output errors,
; notices and warnings too. Error output is very useful during development, but
; it could be very dangerous in production environments. Depending on the code
; which is triggering the error, sensitive information could potentially leak
; out of your application such as database usernames and passwords or worse.
; For production environments, we recommend logging errors rather than
; sending them to STDOUT.
; Possible Values:
;   Off = Do not display any errors
;   stderr = Display errors to STDERR (affects only CGI/CLI binaries!)
;   On or stdout = Display errors to STDOUT
; Default Value: On
; Development Value: On
; Production Value: Off
; http://php.net/display-errors
display_errors = On

; The display of errors which occur during PHP's startup sequence are handled
; separately from display_errors. PHP's default behavior is to suppress those
; errors from clients. Turning the display of startup errors on can be useful in
; debugging configuration problems. We strongly recommend you
; set this to 'off' for production servers.
; Default Value: Off
; Development Value: On
; Production Value: Off
; http://php.net/display-startup-errors
display_startup_errors = On

; Besides displaying errors, PHP can also log errors to locations such as a
; server-specific log, STDERR, or a location specified by the error_log
; directive found below. While errors should not be displayed on productions
; servers they should still be monitored and logging is a great way to do that.
; Default Value: Off
; Development Value: On
; Production Value: On
; http://php.net/log-errors
log_errors = On

; Set maximum length of log_errors. In error_log information about the source is
; added. The default is 1024 and 0 allows to not apply any maximum length at all.
; http://php.net/log-errors-max-len
log_errors_max_len = 1024

; Do not log repeated messages. Repeated errors must occur in same file on same
; line unless ignore_repeated_source is set true.
; http://php.net/ignore-repeated-errors
ignore_repeated_errors = Off

; Ignore source of message when ignoring repeated messages. When this setting
; is On you will not log errors with repeated messages from different files or
; source lines.
; http://php.net/ignore-repeated-source
ignore_repeated_source = Off

; If this parameter is set to Off, then memory leaks will not be shown (on
; stdout or in the log). This has only effect in a debug compile, and if
; error reporting includes E_WARNING in the allowed list
; http://php.net/report-memleaks
report_memleaks = On

; This setting is on by default.
;report_zend_debug = 0

; Store the last error/warning message in $php_errormsg (boolean). Setting this value
; to On can assist in debugging and is appropriate for development servers. It should
; however be disabled on production servers.
; Default Value: Off
; Development Value: On
; Production Value: Off
; http://php.net/track-errors
track_errors = On

; Turn off normal error reporting and emit XML-RPC error XML
; http://php.net/xmlrpc-errors
;xmlrpc_errors = 0

; An XML-RPC faultCode
;xmlrpc_error_number = 0

; When PHP displays or logs an error, it has the capability of formatting the
; error message as HTML for easier reading. This directive controls whether
; the error message is formatted as HTML or not.
; Note: This directive is hardcoded to Off for the CLI SAPI
; Default Value: On
; Development Value: On
; Production value: On
; http://php.net/html-errors
html_errors = On

; If html_errors is set to On *and* docref_root is not empty, then PHP
; produces clickable error messages that direct to a page describing the error
; or function causing the error in detail.
; You can download a copy of the PHP manual from http://php.net/docs
; and change docref_root to the base URL of your local copy including the
; leading '/'. You must also specify the file extension being used including
; the dot. PHP's default behavior is to leave these settings empty, in which
; case no links to documentation are generated.
; Note: Never use this feature for production boxes.
; http://php.net/docref-root
; Examples
;docref_root = "/phpmanual/"

; http://php.net/docref-ext
;docref_ext = .html

; String to output before an error message. PHP's default behavior is to leave
; this setting blank.
; http://php.net/error-prepend-string
; Example:
;error_prepend_string = "<span style='color: #ff0000'>"

; String to output after an error message. PHP's default behavior is to leave
; this setting blank.
; http://php.net/error-append-string
; Example:
;error_append_string = "</span>"

; Log errors to specified file. PHP's default behavior is to leave this value
; empty.
; http://php.net/error-log
; Example:
;error_log = php_errors.log
; Log errors to syslog (Event Log on Windows).
;error_log = syslog

;windows.show_crt_warning
; Default value: 0
; Development value: 0
; Production value: 0

;;;;;;;;;;;;;;;;;
; Data Handling ;
;;;;;;;;;;;;;;;;;

; The separator used in PHP generated URLs to separate arguments.
; PHP's default setting is "&".
; http://php.net/arg-separator.output
; Example:
;arg_separator.output = "&amp;"

; List of separator(s) used by PHP to parse input URLs into variables.
; PHP's default setting is "&".
; NOTE: Every character in this directive is considered as separator!
; http://php.net/arg-separator.input
; Example:
;arg_separator.input = ";&"

; This directive determines which super global arrays are registered when PHP
; starts up. G,P,C,E & S are abbreviations for the following respective super
; globals: GET, POST, COOKIE, ENV and SERVER. There is a performance penalty
; paid for the registration of these arrays and because ENV is not as commonly
; used as the others, ENV is not recommended on productions servers. You
; can still get access to the environment variables through getenv() should you
; need to.
; Default Value: "EGPCS"
; Development Value: "GPCS"
; Production Value: "GPCS";
; http://php.net/variables-order
variables_order = "GPCS"

; This directive determines which super global data (G,P & C) should be
; registered into the super global array REQUEST. If so, it also determines
; the order in which that data is registered. The values for this directive
; are specified in the same manner as the variables_order directive,
; EXCEPT one. Leaving this value empty will cause PHP to use the value set
; in the variables_order directive. It does not mean it will leave the super
; globals array REQUEST empty.
; Default Value: None
; Development Value: "GP"
; Production Value: "GP"
; http://php.net/request-order
request_order = "GP"

; This directive determines whether PHP registers $argv & $argc each time it
; runs. $argv contains an array of all the arguments passed to PHP when a script
; is invoked. $argc contains an integer representing the number of arguments
; that were passed when the script was invoked. These arrays are extremely
; useful when running scripts from the command line. When this directive is
; enabled, registering these variables consumes CPU cycles and memory each time
; a script is executed. For performance reasons, this feature should be disabled
; on production servers.
; Note: This directive is hardcoded to On for the CLI SAPI
; Default Value: On
; Development Value: Off
; Production Value: Off
; http://php.net/register-argc-argv
register_argc_argv = Off

; When enabled, the ENV, REQUEST and SERVER variables are created when they're
; first used (Just In Time) instead of when the script starts. If these
; variables are not used within a script, having this directive on will result
; in a performance gain. The PHP directive register_argc_argv must be disabled
; for this directive to have any affect.
; http://php.net/auto-globals-jit
auto_globals_jit = On

; Whether PHP will read the POST data.
; This option is enabled by default.
; Most likely, you won't want to disable this option globally. It causes $_POST
; and $_FILES to always be empty; the only way you will be able to read the
; POST data will be through the php://input stream wrapper. This can be useful
; to proxy requests or to process the POST data in a memory efficient fashion.
; http://php.net/enable-post-data-reading
;enable_post_data_reading = Off

; Maximum size of POST data that PHP will accept.
; Its value may be 0 to disable the limit. It is ignored if POST data reading
; is disabled through enable_post_data_reading.
; http://php.net/post-max-size
post_max_size = 8M

; Automatically add files before PHP document.
; http://php.net/auto-prepend-file
auto_prepend_file =

; Automatically add files after PHP document.
; http://php.net/auto-append-file
auto_append_file =

; By default, PHP will output a media type using the Content-Type header. To
; disable this, simply set it to be empty.
;
; PHP's built-in default media type is set to text/html.
; http://php.net/default-mimetype
default_mimetype = "text/html"

; PHP's default character set is set to UTF-8.
; http://php.net/default-charset
default_charset = "UTF-8"

; PHP internal character encoding is set to empty.
; If empty, default_charset is used.
; http://php.net/internal-encoding
;internal_encoding =

; PHP input character encoding is set to empty.
; If empty, default_charset is used.
; http://php.net/input-encoding
;input_encoding =

; PHP output character encoding is set to empty.
; If empty, default_charset is used.
; See also output_buffer.
; http://php.net/output-encoding
;output_encoding =

; Always populate the $HTTP_RAW_POST_DATA variable. PHP's default behavior is
; to disable this feature and it will be removed in a future version.
; If post reading is disabled through enable_post_data_reading,
; $HTTP_RAW_POST_DATA is *NOT* populated.
; http://php.net/always-populate-raw-post-data
;always_populate_raw_post_data = -1

;;;;;;;;;;;;;;;;;;;;;;;;;
; Paths and Directories ;
;;;;;;;;;;;;;;;;;;;;;;;;;

; UNIX: "/path1:/path2"
;include_path = ".:/php/includes"
;
; Windows: "\path1;\path2"
;include_path = ".;c:\php\includes"
;
; PHP's default setting for include_path is ".;/path/to/php/pear"
; http://php.net/include-path

; The root of the PHP pages, used only if nonempty.
; if PHP was not compiled with FORCE_REDIRECT, you SHOULD set doc_root
; if you are running php as a CGI under any web server (other than IIS)
; see documentation for security issues.  The alternate is to use the
; cgi.force_redirect configuration below
; http://php.net/doc-root
doc_root =

; The directory under which PHP opens the script using /~username used only
; if nonempty.
; http://php.net/user-dir
user_dir =

; Directory in which the loadable extensions (modules) reside.
; http://php.net/extension-dir
; extension_dir = "./"
; On windows:
; extension_dir = "ext"

; Directory where the temporary files should be placed.
; Defaults to the system default (see sys_get_temp_dir)
; sys_temp_dir = "/tmp"

; Whether or not to enable the dl() function.  The dl() function does NOT work
; properly in multithreaded servers, such as IIS or Zeus, and is automatically
; disabled on them.
; http://php.net/enable-dl
enable_dl = Off

; cgi.force_redirect is necessary to provide security running PHP as a CGI under
; most web servers.  Left undefined, PHP turns this on by default.  You can
; turn it off here AT YOUR OWN RISK
; **You CAN safely turn this off for IIS, in fact, you MUST.**
; http://php.net/cgi.force-redirect
;cgi.force_redirect = 1

; if cgi.nph is enabled it will force cgi to always sent Status: 200 with
; every request. PHP's default behavior is to disable this feature.
;cgi.nph = 1

; if cgi.force_redirect is turned on, and you are not running under Apache or Netscape
; (iPlanet) web servers, you MAY need to set an environment variable name that PHP
; will look for to know it is OK to continue execution.  Setting this variable MAY
; cause security issues, KNOW WHAT YOU ARE DOING FIRST.
; http://php.net/cgi.redirect-status-env
;cgi.redirect_status_env =

; cgi.fix_pathinfo provides *real* PATH_INFO/PATH_TRANSLATED support for CGI.  PHP's
; previous behaviour was to set PATH_TRANSLATED to SCRIPT_FILENAME, and to not grok
; what PATH_INFO is.  For more information on PATH_INFO, see the cgi specs.  Setting
; this to 1 will cause PHP CGI to fix its paths to conform to the spec.  A setting
; of zero causes PHP to behave as before.  Default is 1.  You should fix your scripts
; to use SCRIPT_FILENAME rather than PATH_TRANSLATED.
; http://php.net/cgi.fix-pathinfo
;cgi.fix_pathinfo=1

; if cgi.discard_path is enabled, the PHP CGI binary can safely be placed outside
; of the web tree and people will not be able to circumvent .htaccess security.
; http://php.net/cgi.dicard-path
;cgi.discard_path=1

; FastCGI under IIS (on WINNT based OS) supports the ability to impersonate
; security tokens of the calling client.  This allows IIS to define the
; security context that the request runs under.  mod_fastcgi under Apache
; does not currently support this feature (03/17/2002)
; Set to 1 if running under IIS.  Default is zero.
; http://php.net/fastcgi.impersonate
;fastcgi.impersonate = 1

; Disable logging through FastCGI connection. PHP's default behavior is to enable
; this feature.
;fastcgi.logging = 0

; cgi.rfc2616_headers configuration option tells PHP what type of headers to
; use when sending HTTP response code. If set to 0, PHP sends Status: header that
; is supported by Apache. When this option is set to 1, PHP will send
; RFC2616 compliant header.
; Default is zero.
; http://php.net/cgi.rfc2616-headers
;cgi.rfc2616_headers = 0

; cgi.check_shebang_line controls whether CGI PHP checks for line starting with #!
; (shebang) at the top of the running script. This line might be needed if the
; script support running both as stand-alone script and via PHP CGI<. PHP in CGI
; mode skips this line and ignores its content if this directive is turned on.
; http://php.net/cgi.check-shebang-line
;cgi.check_shebang_line=1

;;;;;;;;;;;;;;;;
; File Uploads ;
;;;;;;;;;;;;;;;;

; Whether to allow HTTP file uploads.
; http://php.net/file-uploads
file_uploads = On

; Temporary directory for HTTP uploaded files (will use system default if not
; specified).
; http://php.net/upload-tmp-dir
;upload_tmp_dir =

; Maximum allowed size for uploaded files.
; http://php.net/upload-max-filesize
upload_max_filesize = 2M

; Maximum number of files that can be uploaded via a single request
max_file_uploads = 20

;;;;;;;;;;;;;;;;;;
; Fopen wrappers ;
;;;;;;;;;;;;;;;;;;

; Whether to allow the treatment of URLs (like http:// or ftp://) as files.
; http://php.net/allow-url-fopen
allow_url_fopen = On

; Whether to allow include/require to open URLs (like http:// or ftp://) as files.
; http://php.net/allow-url-include
allow_url_include = Off

; Define the anonymous ftp password (your email address). PHP's default setting
; for this is empty.
; http://php.net/from
;from="john@doe.com"

; Define the User-Agent string. PHP's default setting for this is empty.
; http://php.net/user-agent
;user_agent="PHP"

; Default timeout for socket based streams (seconds)
; http://php.net/default-socket-timeout
default_socket_timeout = 60

; If your scripts have to deal with files from Macintosh systems,
; or you are running on a Mac and need to deal with files from
; unix or win32 systems, setting this flag will cause PHP to
; automatically detect the EOL character in those files so that
; fgets() and file() will work regardless of the source of the file.
; http://php.net/auto-detect-line-endings
;auto_detect_line_endings = Off

;;;;;;;;;;;;;;;;;;;;;;
; Dynamic Extensions ;
;;;;;;;;;;;;;;;;;;;;;;

; If you wish to have an extension loaded automatically, use the following
; syntax:
;
;   extension=modulename.extension
;
; For example, on Windows:
;
;   extension=msql.dll
;
; ... or under UNIX:
;
;   extension=msql.so
;
; ... or with a path:
;
;   extension=/path/to/extension/msql.so
;
; If you only provide the name of the extension, PHP will look for it in its
; default extension directory.
;
; Windows Extensions
; Note that ODBC support is built in, so no dll is needed for it.
; Note that many DLL files are located in the extensions/ (PHP 4) ext/ (PHP 5)
; extension folders as well as the separate PECL DLL download (PHP 5).
; Be sure to appropriately set the extension_dir directive.
;
;extension=php_bz2.dll
;extension=php_curl.dll
;extension=php_fileinfo.dll
;extension=php_gd2.dll
;extension=php_gettext.dll
;extension=php_gmp.dll
;extension=php_intl.dll
;extension=php_imap.dll
;extension=php_interbase.dll
;extension=php_ldap.dll
;extension=php_mbstring.dll
;extension=php_exif.dll      ; Must be after mbstring as it depends on it
;extension=php_mysql.dll
;extension=php_mysqli.dll
;extension=php_oci8_12c.dll  ; Use with Oracle Database 12c Instant Client
;extension=php_openssl.dll
;extension=php_pdo_firebird.dll
;extension=php_pdo_mysql.dll
;extension=php_pdo_oci.dll
;extension=php_pdo_odbc.dll
;extension=php_pdo_pgsql.dll
;extension=php_pdo_sqlite.dll
;extension=php_pgsql.dll
;extension=php_shmop.dll

; The MIBS data available in the PHP distribution must be installed. 
; See http://www.php.net/manual/en/snmp.installation.php 
;extension=php_snmp.dll

;extension=php_soap.dll
;extension=php_sockets.dll
;extension=php_sqlite3.dll
;extension=php_sybase_ct.dll
;extension=php_tidy.dll
;extension=php_xmlrpc.dll
;extension=php_xsl.dll

;;;;;;;;;;;;;;;;;;;
; Module Settings ;
;;;;;;;;;;;;;;;;;;;

[CLI Server]
; Whether the CLI web server uses ANSI color coding in its terminal output.
cli_server.color = On

[Date]
; Defines the default timezone used by the date functions
; http://php.net/date.timezone
date.timezone = Asia/Shanghai

; http://php.net/date.default-latitude
;date.default_latitude = 31.7667

; http://php.net/date.default-longitude
;date.default_longitude = 35.2333

; http://php.net/date.sunrise-zenith
;date.sunrise_zenith = 90.583333

; http://php.net/date.sunset-zenith
;date.sunset_zenith = 90.583333

[filter]
; http://php.net/filter.default
;filter.default = unsafe_raw

; http://php.net/filter.default-flags
;filter.default_flags =

[iconv]
; Use of this INI entry is deprecated, use global input_encoding instead.
; If empty, default_charset or input_encoding or iconv.input_encoding is used.
; The precedence is: default_charset < intput_encoding < iconv.input_encoding
;iconv.input_encoding =

; Use of this INI entry is deprecated, use global internal_encoding instead.
; If empty, default_charset or internal_encoding or iconv.internal_encoding is used.
; The precedence is: default_charset < internal_encoding < iconv.internal_encoding
;iconv.internal_encoding =

; Use of this INI entry is deprecated, use global output_encoding instead.
; If empty, default_charset or output_encoding or iconv.output_encoding is used.
; The precedence is: default_charset < output_encoding < iconv.output_encoding
; To use an output encoding conversion, iconv's output handler must be set
; otherwise output encoding conversion cannot be performed.
;iconv.output_encoding =

[intl]
;intl.default_locale =
; This directive allows you to produce PHP errors when some error
; happens within intl functions. The value is the level of the error produced.
; Default is 0, which does not produce any errors.
;intl.error_level = E_WARNING
;intl.use_exceptions = 0

[sqlite3]
;sqlite3.extension_dir =

[Pcre]
;PCRE library backtracking limit.
; http://php.net/pcre.backtrack-limit
;pcre.backtrack_limit=100000

;PCRE library recursion limit.
;Please note that if you set this value to a high number you may consume all
;the available process stack and eventually crash PHP (due to reaching the
;stack size limit imposed by the Operating System).
; http://php.net/pcre.recursion-limit
;pcre.recursion_limit=100000

[Pdo]
; Whether to pool ODBC connections. Can be one of "strict", "relaxed" or "off"
; http://php.net/pdo-odbc.connection-pooling
;pdo_odbc.connection_pooling=strict

;pdo_odbc.db2_instance_name

[Pdo_mysql]
; If mysqlnd is used: Number of cache slots for the internal result set cache
; http://php.net/pdo_mysql.cache_size
pdo_mysql.cache_size = 2000

; Default socket name for local MySQL connects.  If empty, uses the built-in
; MySQL defaults.
; http://php.net/pdo_mysql.default-socket
pdo_mysql.default_socket=

[Phar]
; http://php.net/phar.readonly
;phar.readonly = On

; http://php.net/phar.require-hash
;phar.require_hash = On

;phar.cache_list =

[mail function]
; For Win32 only.
; http://php.net/smtp
SMTP = localhost
; http://php.net/smtp-port
smtp_port = 25

; For Win32 only.
; http://php.net/sendmail-from
;sendmail_from = me@example.com

; For Unix only.  You may supply arguments as well (default: "sendmail -t -i").
; http://php.net/sendmail-path
;sendmail_path =

; Force the addition of the specified parameters to be passed as extra parameters
; to the sendmail binary. These parameters will always replace the value of
; the 5th parameter to mail().
;mail.force_extra_parameters =

; Add X-PHP-Originating-Script: that will include uid of the script followed by the filename
mail.add_x_header = On

; The path to a log file that will log all mail() calls. Log entries include
; the full path of the script, line number, To address and headers.
;mail.log =
; Log mail to syslog (Event Log on Windows).
;mail.log = syslog

[SQL]
; http://php.net/sql.safe-mode
sql.safe_mode = Off

[ODBC]
; http://php.net/odbc.default-db
;odbc.default_db    =  Not yet implemented

; http://php.net/odbc.default-user
;odbc.default_user  =  Not yet implemented

; http://php.net/odbc.default-pw
;odbc.default_pw    =  Not yet implemented

; Controls the ODBC cursor model.
; Default: SQL_CURSOR_STATIC (default).
;odbc.default_cursortype

; Allow or prevent persistent links.
; http://php.net/odbc.allow-persistent
odbc.allow_persistent = On

; Check that a connection is still valid before reuse.
; http://php.net/odbc.check-persistent
odbc.check_persistent = On

; Maximum number of persistent links.  -1 means no limit.
; http://php.net/odbc.max-persistent
odbc.max_persistent = -1

; Maximum number of links (persistent + non-persistent).  -1 means no limit.
; http://php.net/odbc.max-links
odbc.max_links = -1

; Handling of LONG fields.  Returns number of bytes to variables.  0 means
; passthru.
; http://php.net/odbc.defaultlrl
odbc.defaultlrl = 4096

; Handling of binary data.  0 means passthru, 1 return as is, 2 convert to char.
; See the documentation on odbc_binmode and odbc_longreadlen for an explanation
; of odbc.defaultlrl and odbc.defaultbinmode
; http://php.net/odbc.defaultbinmode
odbc.defaultbinmode = 1

;birdstep.max_links = -1

[Interbase]
; Allow or prevent persistent links.
ibase.allow_persistent = 1

; Maximum number of persistent links.  -1 means no limit.
ibase.max_persistent = -1

; Maximum number of links (persistent + non-persistent).  -1 means no limit.
ibase.max_links = -1

; Default database name for ibase_connect().
;ibase.default_db =

; Default username for ibase_connect().
;ibase.default_user =

; Default password for ibase_connect().
;ibase.default_password =

; Default charset for ibase_connect().
;ibase.default_charset =

; Default timestamp format.
ibase.timestampformat = "%Y-%m-%d %H:%M:%S"

; Default date format.
ibase.dateformat = "%Y-%m-%d"

; Default time format.
ibase.timeformat = "%H:%M:%S"

[MySQL]
; Allow accessing, from PHP's perspective, local files with LOAD DATA statements
; http://php.net/mysql.allow_local_infile
mysql.allow_local_infile = On

; Allow or prevent persistent links.
; http://php.net/mysql.allow-persistent
mysql.allow_persistent = On

; If mysqlnd is used: Number of cache slots for the internal result set cache
; http://php.net/mysql.cache_size
mysql.cache_size = 2000

; Maximum number of persistent links.  -1 means no limit.
; http://php.net/mysql.max-persistent
mysql.max_persistent = -1

; Maximum number of links (persistent + non-persistent).  -1 means no limit.
; http://php.net/mysql.max-links
mysql.max_links = -1

; Default port number for mysql_connect().  If unset, mysql_connect() will use
; the $MYSQL_TCP_PORT or the mysql-tcp entry in /etc/services or the
; compile-time value defined MYSQL_PORT (in that order).  Win32 will only look
; at MYSQL_PORT.
; http://php.net/mysql.default-port
mysql.default_port =

; Default socket name for local MySQL connects.  If empty, uses the built-in
; MySQL defaults.
; http://php.net/mysql.default-socket
mysql.default_socket =

; Default host for mysql_connect() (doesn't apply in safe mode).
; http://php.net/mysql.default-host
mysql.default_host =

; Default user for mysql_connect() (doesn't apply in safe mode).
; http://php.net/mysql.default-user
mysql.default_user =

; Default password for mysql_connect() (doesn't apply in safe mode).
; Note that this is generally a *bad* idea to store passwords in this file.
; *Any* user with PHP access can run 'echo get_cfg_var("mysql.default_password")
; and reveal this password!  And of course, any users with read access to this
; file will be able to reveal the password as well.
; http://php.net/mysql.default-password
mysql.default_password =

; Maximum time (in seconds) for connect timeout. -1 means no limit
; http://php.net/mysql.connect-timeout
mysql.connect_timeout = 60

; Trace mode. When trace_mode is active (=On), warnings for table/index scans and
; SQL-Errors will be displayed.
; http://php.net/mysql.trace-mode
mysql.trace_mode = Off

[MySQLi]

; Maximum number of persistent links.  -1 means no limit.
; http://php.net/mysqli.max-persistent
mysqli.max_persistent = -1

; Allow accessing, from PHP's perspective, local files with LOAD DATA statements
; http://php.net/mysqli.allow_local_infile
;mysqli.allow_local_infile = On

; Allow or prevent persistent links.
; http://php.net/mysqli.allow-persistent
mysqli.allow_persistent = On

; Maximum number of links.  -1 means no limit.
; http://php.net/mysqli.max-links
mysqli.max_links = -1

; If mysqlnd is used: Number of cache slots for the internal result set cache
; http://php.net/mysqli.cache_size
mysqli.cache_size = 2000

; Default port number for mysqli_connect().  If unset, mysqli_connect() will use
; the $MYSQL_TCP_PORT or the mysql-tcp entry in /etc/services or the
; compile-time value defined MYSQL_PORT (in that order).  Win32 will only look
; at MYSQL_PORT.
; http://php.net/mysqli.default-port
mysqli.default_port = 3306

; Default socket name for local MySQL connects.  If empty, uses the built-in
; MySQL defaults.
; http://php.net/mysqli.default-socket
mysqli.default_socket =

; Default host for mysql_connect() (doesn't apply in safe mode).
; http://php.net/mysqli.default-host
mysqli.default_host =

; Default user for mysql_connect() (doesn't apply in safe mode).
; http://php.net/mysqli.default-user
mysqli.default_user =

; Default password for mysqli_connect() (doesn't apply in safe mode).
; Note that this is generally a *bad* idea to store passwords in this file.
; *Any* user with PHP access can run 'echo get_cfg_var("mysqli.default_pw")
; and reveal this password!  And of course, any users with read access to this
; file will be able to reveal the password as well.
; http://php.net/mysqli.default-pw
mysqli.default_pw =

; Allow or prevent reconnect
mysqli.reconnect = Off

[mysqlnd]
; Enable / Disable collection of general statistics by mysqlnd which can be
; used to tune and monitor MySQL operations.
; http://php.net/mysqlnd.collect_statistics
mysqlnd.collect_statistics = On

; Enable / Disable collection of memory usage statistics by mysqlnd which can be
; used to tune and monitor MySQL operations.
; http://php.net/mysqlnd.collect_memory_statistics
mysqlnd.collect_memory_statistics = On

; Records communication from all extensions using mysqlnd to the specified log
; file.
; http://php.net/mysqlnd.debug
;mysqlnd.debug =

; Defines which queries will be logged.
; http://php.net/mysqlnd.log_mask
;mysqlnd.log_mask = 0

; Default size of the mysqlnd memory pool, which is used by result sets.
; http://php.net/mysqlnd.mempool_default_size
;mysqlnd.mempool_default_size = 16000

; Size of a pre-allocated buffer used when sending commands to MySQL in bytes.
; http://php.net/mysqlnd.net_cmd_buffer_size
;mysqlnd.net_cmd_buffer_size = 2048

; Size of a pre-allocated buffer used for reading data sent by the server in
; bytes.
; http://php.net/mysqlnd.net_read_buffer_size
;mysqlnd.net_read_buffer_size = 32768

; Timeout for network requests in seconds.
; http://php.net/mysqlnd.net_read_timeout
;mysqlnd.net_read_timeout = 31536000

; SHA-256 Authentication Plugin related. File with the MySQL server public RSA
; key.
; http://php.net/mysqlnd.sha256_server_public_key
;mysqlnd.sha256_server_public_key =

[OCI8]

; Connection: Enables privileged connections using external
; credentials (OCI_SYSOPER, OCI_SYSDBA)
; http://php.net/oci8.privileged-connect
;oci8.privileged_connect = Off

; Connection: The maximum number of persistent OCI8 connections per
; process. Using -1 means no limit.
; http://php.net/oci8.max-persistent
;oci8.max_persistent = -1

; Connection: The maximum number of seconds a process is allowed to
; maintain an idle persistent connection. Using -1 means idle
; persistent connections will be maintained forever.
; http://php.net/oci8.persistent-timeout
;oci8.persistent_timeout = -1

; Connection: The number of seconds that must pass before issuing a
; ping during oci_pconnect() to check the connection validity. When
; set to 0, each oci_pconnect() will cause a ping. Using -1 disables
; pings completely.
; http://php.net/oci8.ping-interval
;oci8.ping_interval = 60

; Connection: Set this to a user chosen connection class to be used
; for all pooled server requests with Oracle 11g Database Resident
; Connection Pooling (DRCP).  To use DRCP, this value should be set to
; the same string for all web servers running the same application,
; the database pool must be configured, and the connection string must
; specify to use a pooled server.
;oci8.connection_class =

; High Availability: Using On lets PHP receive Fast Application
; Notification (FAN) events generated when a database node fails. The
; database must also be configured to post FAN events.
;oci8.events = Off

; Tuning: This option enables statement caching, and specifies how
; many statements to cache. Using 0 disables statement caching.
; http://php.net/oci8.statement-cache-size
;oci8.statement_cache_size = 20

; Tuning: Enables statement prefetching and sets the default number of
; rows that will be fetched automatically after statement execution.
; http://php.net/oci8.default-prefetch
;oci8.default_prefetch = 100

; Compatibility. Using On means oci_close() will not close
; oci_connect() and oci_new_connect() connections.
; http://php.net/oci8.old-oci-close-semantics
;oci8.old_oci_close_semantics = Off

[PostgreSQL]
; Allow or prevent persistent links.
; http://php.net/pgsql.allow-persistent
pgsql.allow_persistent = On

; Detect broken persistent links always with pg_pconnect().
; Auto reset feature requires a little overheads.
; http://php.net/pgsql.auto-reset-persistent
pgsql.auto_reset_persistent = Off

; Maximum number of persistent links.  -1 means no limit.
; http://php.net/pgsql.max-persistent
pgsql.max_persistent = -1

; Maximum number of links (persistent+non persistent).  -1 means no limit.
; http://php.net/pgsql.max-links
pgsql.max_links = -1

; Ignore PostgreSQL backends Notice message or not.
; Notice message logging require a little overheads.
; http://php.net/pgsql.ignore-notice
pgsql.ignore_notice = 0

; Log PostgreSQL backends Notice message or not.
; Unless pgsql.ignore_notice=0, module cannot log notice message.
; http://php.net/pgsql.log-notice
pgsql.log_notice = 0

[Sybase-CT]
; Allow or prevent persistent links.
; http://php.net/sybct.allow-persistent
sybct.allow_persistent = On

; Maximum number of persistent links.  -1 means no limit.
; http://php.net/sybct.max-persistent
sybct.max_persistent = -1

; Maximum number of links (persistent + non-persistent).  -1 means no limit.
; http://php.net/sybct.max-links
sybct.max_links = -1

; Minimum server message severity to display.
; http://php.net/sybct.min-server-severity
sybct.min_server_severity = 10

; Minimum client message severity to display.
; http://php.net/sybct.min-client-severity
sybct.min_client_severity = 10

; Set per-context timeout
; http://php.net/sybct.timeout
;sybct.timeout=

;sybct.packet_size

; The maximum time in seconds to wait for a connection attempt to succeed before returning failure.
; Default: one minute
;sybct.login_timeout=

; The name of the host you claim to be connecting from, for display by sp_who.
; Default: none
;sybct.hostname=

; Allows you to define how often deadlocks are to be retried. -1 means "forever".
; Default: 0
;sybct.deadlock_retry_count=

[bcmath]
; Number of decimal digits for all bcmath functions.
; http://php.net/bcmath.scale
bcmath.scale = 0

[browscap]
; http://php.net/browscap
;browscap = extra/browscap.ini

[Session]
; Handler used to store/retrieve data.
; http://php.net/session.save-handler
session.save_handler = files

; Argument passed to save_handler.  In the case of files, this is the path
; where data files are stored. Note: Windows users have to change this
; variable in order to use PHP's session functions.
;
; The path can be defined as:
;
;     session.save_path = "N;/path"
;
; where N is an integer.  Instead of storing all the session files in
; /path, what this will do is use subdirectories N-levels deep, and
; store the session data in those directories.  This is useful if
; your OS has problems with many files in one directory, and is
; a more efficient layout for servers that handle many sessions.
;
; NOTE 1: PHP will not create this directory structure automatically.
;         You can use the script in the ext/session dir for that purpose.
; NOTE 2: See the section on garbage collection below if you choose to
;         use subdirectories for session storage
;
; The file storage module creates files using mode 600 by default.
; You can change that by using
;
;     session.save_path = "N;MODE;/path"
;
; where MODE is the octal representation of the mode. Note that this
; does not overwrite the process's umask.
; http://php.net/session.save-path
;session.save_path = "/tmp"

; Whether to use strict session mode.
; Strict session mode does not accept uninitialized session ID and regenerate
; session ID if browser sends uninitialized session ID. Strict mode protects
; applications from session fixation via session adoption vulnerability. It is
; disabled by default for maximum compatibility, but enabling it is encouraged.
; https://wiki.php.net/rfc/strict_sessions
session.use_strict_mode = 0

; Whether to use cookies.
; http://php.net/session.use-cookies
session.use_cookies = 1

; http://php.net/session.cookie-secure
;session.cookie_secure =

; This option forces PHP to fetch and use a cookie for storing and maintaining
; the session id. We encourage this operation as it's very helpful in combating
; session hijacking when not specifying and managing your own session id. It is
; not the be-all and end-all of session hijacking defense, but it's a good start.
; http://php.net/session.use-only-cookies
session.use_only_cookies = 1

; Name of the session (used as cookie name).
; http://php.net/session.name
session.name = PHPSESSID

; Initialize session on request startup.
; http://php.net/session.auto-start
session.auto_start = 0

; Lifetime in seconds of cookie or, if 0, until browser is restarted.
; http://php.net/session.cookie-lifetime
session.cookie_lifetime = 0

; The path for which the cookie is valid.
; http://php.net/session.cookie-path
session.cookie_path = /

; The domain for which the cookie is valid.
; http://php.net/session.cookie-domain
session.cookie_domain =

; Whether or not to add the httpOnly flag to the cookie, which makes it inaccessible to browser scripting languages such as JavaScript.
; http://php.net/session.cookie-httponly
session.cookie_httponly =

; Handler used to serialize data.  php is the standard serializer of PHP.
; http://php.net/session.serialize-handler
session.serialize_handler = php

; Defines the probability that the 'garbage collection' process is started
; on every session initialization. The probability is calculated by using
; gc_probability/gc_divisor. Where session.gc_probability is the numerator
; and gc_divisor is the denominator in the equation. Setting this value to 1
; when the session.gc_divisor value is 100 will give you approximately a 1% chance
; the gc will run on any give request.
; Default Value: 1
; Development Value: 1
; Production Value: 1
; http://php.net/session.gc-probability
session.gc_probability = 1

; Defines the probability that the 'garbage collection' process is started on every
; session initialization. The probability is calculated by using the following equation:
; gc_probability/gc_divisor. Where session.gc_probability is the numerator and
; session.gc_divisor is the denominator in the equation. Setting this value to 1
; when the session.gc_divisor value is 100 will give you approximately a 1% chance
; the gc will run on any give request. Increasing this value to 1000 will give you
; a 0.1% chance the gc will run on any give request. For high volume production servers,
; this is a more efficient approach.
; Default Value: 100
; Development Value: 1000
; Production Value: 1000
; http://php.net/session.gc-divisor
session.gc_divisor = 1000

; After this number of seconds, stored data will be seen as 'garbage' and
; cleaned up by the garbage collection process.
; http://php.net/session.gc-maxlifetime
session.gc_maxlifetime = 1440

; NOTE: If you are using the subdirectory option for storing session files
;       (see session.save_path above), then garbage collection does *not*
;       happen automatically.  You will need to do your own garbage
;       collection through a shell script, cron entry, or some other method.
;       For example, the following script would is the equivalent of
;       setting session.gc_maxlifetime to 1440 (1440 seconds = 24 minutes):
;          find /path/to/sessions -cmin +24 -type f | xargs rm

; Check HTTP Referer to invalidate externally stored URLs containing ids.
; HTTP_REFERER has to contain this substring for the session to be
; considered as valid.
; http://php.net/session.referer-check
session.referer_check =

; How many bytes to read from the file.
; http://php.net/session.entropy-length
;session.entropy_length = 32

; Specified here to create the session id.
; http://php.net/session.entropy-file
; Defaults to /dev/urandom
; On systems that don't have /dev/urandom but do have /dev/arandom, this will default to /dev/arandom
; If neither are found at compile time, the default is no entropy file.
; On windows, setting the entropy_length setting will activate the
; Windows random source (using the CryptoAPI)
;session.entropy_file = /dev/urandom

; Set to {nocache,private,public,} to determine HTTP caching aspects
; or leave this empty to avoid sending anti-caching headers.
; http://php.net/session.cache-limiter
session.cache_limiter = nocache

; Document expires after n minutes.
; http://php.net/session.cache-expire
session.cache_expire = 180

; trans sid support is disabled by default.
; Use of trans sid may risk your users' security.
; Use this option with caution.
; - User may send URL contains active session ID
;   to other person via. email/irc/etc.
; - URL that contains active session ID may be stored
;   in publicly accessible computer.
; - User may access your site with the same session ID
;   always using URL stored in browser's history or bookmarks.
; http://php.net/session.use-trans-sid
session.use_trans_sid = 0

; Select a hash function for use in generating session ids.
; Possible Values
;   0  (MD5 128 bits)
;   1  (SHA-1 160 bits)
; This option may also be set to the name of any hash function supported by
; the hash extension. A list of available hashes is returned by the hash_algos()
; function.
; http://php.net/session.hash-function
session.hash_function = 0

; Define how many bits are stored in each character when converting
; the binary hash data to something readable.
; Possible values:
;   4  (4 bits: 0-9, a-f)
;   5  (5 bits: 0-9, a-v)
;   6  (6 bits: 0-9, a-z, A-Z, "-", ",")
; Default Value: 4
; Development Value: 5
; Production Value: 5
; http://php.net/session.hash-bits-per-character
session.hash_bits_per_character = 5

; The URL rewriter will look for URLs in a defined set of HTML tags.
; form/fieldset are special; if you include them here, the rewriter will
; add a hidden <input> field with the info which is otherwise appended
; to URLs.  If you want XHTML conformity, remove the form entry.
; Note that all valid entries require a "=", even if no value follows.
; Default Value: "a=href,area=href,frame=src,form=,fieldset="
; Development Value: "a=href,area=href,frame=src,input=src,form=fakeentry"
; Production Value: "a=href,area=href,frame=src,input=src,form=fakeentry"
; http://php.net/url-rewriter.tags
url_rewriter.tags = "a=href,area=href,frame=src,input=src,form=fakeentry"

; Enable upload progress tracking in $_SESSION
; Default Value: On
; Development Value: On
; Production Value: On
; http://php.net/session.upload-progress.enabled
;session.upload_progress.enabled = On

; Cleanup the progress information as soon as all POST data has been read
; (i.e. upload completed).
; Default Value: On
; Development Value: On
; Production Value: On
; http://php.net/session.upload-progress.cleanup
;session.upload_progress.cleanup = On

; A prefix used for the upload progress key in $_SESSION
; Default Value: "upload_progress_"
; Development Value: "upload_progress_"
; Production Value: "upload_progress_"
; http://php.net/session.upload-progress.prefix
;session.upload_progress.prefix = "upload_progress_"

; The index name (concatenated with the prefix) in $_SESSION
; containing the upload progress information
; Default Value: "PHP_SESSION_UPLOAD_PROGRESS"
; Development Value: "PHP_SESSION_UPLOAD_PROGRESS"
; Production Value: "PHP_SESSION_UPLOAD_PROGRESS"
; http://php.net/session.upload-progress.name
;session.upload_progress.name = "PHP_SESSION_UPLOAD_PROGRESS"

; How frequently the upload progress should be updated.
; Given either in percentages (per-file), or in bytes
; Default Value: "1%"
; Development Value: "1%"
; Production Value: "1%"
; http://php.net/session.upload-progress.freq
;session.upload_progress.freq =  "1%"

; The minimum delay between updates, in seconds
; Default Value: 1
; Development Value: 1
; Production Value: 1
; http://php.net/session.upload-progress.min-freq
;session.upload_progress.min_freq = "1"

[MSSQL]
; Allow or prevent persistent links.
mssql.allow_persistent = On

; Maximum number of persistent links.  -1 means no limit.
mssql.max_persistent = -1

; Maximum number of links (persistent+non persistent).  -1 means no limit.
mssql.max_links = -1

; Minimum error severity to display.
mssql.min_error_severity = 10

; Minimum message severity to display.
mssql.min_message_severity = 10

; Compatibility mode with old versions of PHP 3.0.
mssql.compatibility_mode = Off

; Connect timeout
;mssql.connect_timeout = 5

; Query timeout
;mssql.timeout = 60

; Valid range 0 - 2147483647.  Default = 4096.
;mssql.textlimit = 4096

; Valid range 0 - 2147483647.  Default = 4096.
;mssql.textsize = 4096

; Limits the number of records in each batch.  0 = all records in one batch.
;mssql.batchsize = 0

; Specify how datetime and datetim4 columns are returned
; On => Returns data converted to SQL server settings
; Off => Returns values as YYYY-MM-DD hh:mm:ss
;mssql.datetimeconvert = On

; Use NT authentication when connecting to the server
mssql.secure_connection = Off

; Specify max number of processes. -1 = library default
; msdlib defaults to 25
; FreeTDS defaults to 4096
;mssql.max_procs = -1

; Specify client character set.
; If empty or not set the client charset from freetds.conf is used
; This is only used when compiled with FreeTDS
;mssql.charset = "ISO-8859-1"

[Assertion]
; Assert(expr); active by default.
; http://php.net/assert.active
;assert.active = On

; Issue a PHP warning for each failed assertion.
; http://php.net/assert.warning
;assert.warning = On

; Don't bail out by default.
; http://php.net/assert.bail
;assert.bail = Off

; User-function to be called if an assertion fails.
; http://php.net/assert.callback
;assert.callback = 0

; Eval the expression with current error_reporting().  Set to true if you want
; error_reporting(0) around the eval().
; http://php.net/assert.quiet-eval
;assert.quiet_eval = 0

[COM]
; path to a file containing GUIDs, IIDs or filenames of files with TypeLibs
; http://php.net/com.typelib-file
;com.typelib_file =

; allow Distributed-COM calls
; http://php.net/com.allow-dcom
;com.allow_dcom = true

; autoregister constants of a components typlib on com_load()
; http://php.net/com.autoregister-typelib
;com.autoregister_typelib = true

; register constants casesensitive
; http://php.net/com.autoregister-casesensitive
;com.autoregister_casesensitive = false

; show warnings on duplicate constant registrations
; http://php.net/com.autoregister-verbose
;com.autoregister_verbose = true

; The default character set code-page to use when passing strings to and from COM objects.
; Default: system ANSI code page
;com.code_page=

[mbstring]
; language for internal character representation.
; This affects mb_send_mail() and mbstrig.detect_order.
; http://php.net/mbstring.language
;mbstring.language = Japanese

; Use of this INI entry is deprecated, use global internal_encoding instead.
; internal/script encoding.
; Some encoding cannot work as internal encoding. (e.g. SJIS, BIG5, ISO-2022-*)
; If empty, default_charset or internal_encoding or iconv.internal_encoding is used.
; The precedence is: default_charset < internal_encoding < iconv.internal_encoding
;mbstring.internal_encoding =

; Use of this INI entry is deprecated, use global input_encoding instead.
; http input encoding.
; mbstring.encoding_traslation = On is needed to use this setting.
; If empty, default_charset or input_encoding or mbstring.input is used.
; The precedence is: default_charset < intput_encoding < mbsting.http_input
; http://php.net/mbstring.http-input
;mbstring.http_input =

; Use of this INI entry is deprecated, use global output_encoding instead.
; http output encoding.
; mb_output_handler must be registered as output buffer to function.
; If empty, default_charset or output_encoding or mbstring.http_output is used.
; The precedence is: default_charset < output_encoding < mbstring.http_output
; To use an output encoding conversion, mbstring's output handler must be set
; otherwise output encoding conversion cannot be performed.
; http://php.net/mbstring.http-output
;mbstring.http_output =

; enable automatic encoding translation according to
; mbstring.internal_encoding setting. Input chars are
; converted to internal encoding by setting this to On.
; Note: Do _not_ use automatic encoding translation for
;       portable libs/applications.
; http://php.net/mbstring.encoding-translation
;mbstring.encoding_translation = Off

; automatic encoding detection order.
; "auto" detect order is changed according to mbstring.language
; http://php.net/mbstring.detect-order
;mbstring.detect_order = auto

; substitute_character used when character cannot be converted
; one from another
; http://php.net/mbstring.substitute-character
;mbstring.substitute_character = none

; overload(replace) single byte functions by mbstring functions.
; mail(), ereg(), etc are overloaded by mb_send_mail(), mb_ereg(),
; etc. Possible values are 0,1,2,4 or combination of them.
; For example, 7 for overload everything.
; 0: No overload
; 1: Overload mail() function
; 2: Overload str*() functions
; 4: Overload ereg*() functions
; http://php.net/mbstring.func-overload
;mbstring.func_overload = 0

; enable strict encoding detection.
; Default: Off
;mbstring.strict_detection = On

; This directive specifies the regex pattern of content types for which mb_output_handler()
; is activated.
; Default: mbstring.http_output_conv_mimetype=^(text/|application/xhtml\+xml)
;mbstring.http_output_conv_mimetype=

[gd]
; Tell the jpeg decode to ignore warnings and try to create
; a gd image. The warning will then be displayed as notices
; disabled by default
; http://php.net/gd.jpeg-ignore-warning
;gd.jpeg_ignore_warning = 0

[exif]
; Exif UNICODE user comments are handled as UCS-2BE/UCS-2LE and JIS as JIS.
; With mbstring support this will automatically be converted into the encoding
; given by corresponding encode setting. When empty mbstring.internal_encoding
; is used. For the decode settings you can distinguish between motorola and
; intel byte order. A decode setting cannot be empty.
; http://php.net/exif.encode-unicode
;exif.encode_unicode = ISO-8859-15

; http://php.net/exif.decode-unicode-motorola
;exif.decode_unicode_motorola = UCS-2BE

; http://php.net/exif.decode-unicode-intel
;exif.decode_unicode_intel    = UCS-2LE

; http://php.net/exif.encode-jis
;exif.encode_jis =

; http://php.net/exif.decode-jis-motorola
;exif.decode_jis_motorola = JIS

; http://php.net/exif.decode-jis-intel
;exif.decode_jis_intel    = JIS

[Tidy]
; The path to a default tidy configuration file to use when using tidy
; http://php.net/tidy.default-config
;tidy.default_config = /usr/local/lib/php/default.tcfg

; Should tidy clean and repair output automatically?
; WARNING: Do not use this option if you are generating non-html content
; such as dynamic images
; http://php.net/tidy.clean-output
tidy.clean_output = Off

[soap]
; Enables or disables WSDL caching feature.
; http://php.net/soap.wsdl-cache-enabled
soap.wsdl_cache_enabled=1

; Sets the directory name where SOAP extension will put cache files.
; http://php.net/soap.wsdl-cache-dir
soap.wsdl_cache_dir="/tmp"

; (time to live) Sets the number of second while cached file will be used
; instead of original one.
; http://php.net/soap.wsdl-cache-ttl
soap.wsdl_cache_ttl=86400

; Sets the size of the cache limit. (Max. number of WSDL files to cache)
soap.wsdl_cache_limit = 5

[sysvshm]
; A default size of the shared memory segment
;sysvshm.init_mem = 10000

[ldap]
; Sets the maximum number of open links or -1 for unlimited.
ldap.max_links = -1

[mcrypt]
; For more information about mcrypt settings see http://php.net/mcrypt-module-open

; Directory where to load mcrypt algorithms
; Default: Compiled in into libmcrypt (usually /usr/local/lib/libmcrypt)
;mcrypt.algorithms_dir=

; Directory where to load mcrypt modes
; Default: Compiled in into libmcrypt (usually /usr/local/lib/libmcrypt)
;mcrypt.modes_dir=

[dba]
;dba.default_handler=

[opcache]
; Determines if Zend OPCache is enabled
;opcache.enable=0

; Determines if Zend OPCache is enabled for the CLI version of PHP
;opcache.enable_cli=0

; The OPcache shared memory storage size.
;opcache.memory_consumption=64

; The amount of memory for interned strings in Mbytes.
;opcache.interned_strings_buffer=4

; The maximum number of keys (scripts) in the OPcache hash table.
; Only numbers between 200 and 100000 are allowed.
;opcache.max_accelerated_files=2000

; The maximum percentage of "wasted" memory until a restart is scheduled.
;opcache.max_wasted_percentage=5

; When this directive is enabled, the OPcache appends the current working
; directory to the script key, thus eliminating possible collisions between
; files with the same name (basename). Disabling the directive improves
; performance, but may break existing applications.
;opcache.use_cwd=1

; When disabled, you must reset the OPcache manually or restart the
; webserver for changes to the filesystem to take effect.
;opcache.validate_timestamps=1

; How often (in seconds) to check file timestamps for changes to the shared
; memory storage allocation. ("1" means validate once per second, but only
; once per request. "0" means always validate)
;opcache.revalidate_freq=2

; Enables or disables file search in include_path optimization
;opcache.revalidate_path=0

; If disabled, all PHPDoc comments are dropped from the code to reduce the
; size of the optimized code.
;opcache.save_comments=1

; If disabled, PHPDoc comments are not loaded from SHM, so "Doc Comments"
; may be always stored (save_comments=1), but not loaded by applications
; that don't need them anyway.
;opcache.load_comments=1

; If enabled, a fast shutdown sequence is used for the accelerated code
;opcache.fast_shutdown=0

; Allow file existence override (file_exists, etc.) performance feature.
;opcache.enable_file_override=0

; A bitmask, where each bit enables or disables the appropriate OPcache
; passes
;opcache.optimization_level=0xffffffff

;opcache.inherited_hack=1
;opcache.dups_fix=0

; The location of the OPcache blacklist file (wildcards allowed).
; Each OPcache blacklist file is a text file that holds the names of files
; that should not be accelerated. The file format is to add each filename
; to a new line. The filename may be a full path or just a file prefix
; (i.e., /var/www/x  blacklists all the files and directories in /var/www
; that start with 'x'). Line starting with a ; are ignored (comments).
;opcache.blacklist_filename=

; Allows exclusion of large files from being cached. By default all files
; are cached.
;opcache.max_file_size=0

; Check the cache checksum each N requests.
; The default value of "0" means that the checks are disabled.
;opcache.consistency_checks=0

; How long to wait (in seconds) for a scheduled restart to begin if the cache
; is not being accessed.
;opcache.force_restart_timeout=180

; OPcache error_log file name. Empty string assumes "stderr".
;opcache.error_log=

; All OPcache errors go to the Web server log.
; By default, only fatal errors (level 0) or errors (level 1) are logged.
; You can also enable warnings (level 2), info messages (level 3) or
; debug messages (level 4).
;opcache.log_verbosity_level=1

; Preferred Shared Memory back-end. Leave empty and let the system decide.
;opcache.preferred_memory_model=

; Protect the shared memory from unexpected writing during script execution.
; Useful for internal debugging only.
;opcache.protect_memory=0

; Validate cached file permissions.
; opcache.validate_permission=0

; Prevent name collisions in chroot'ed environment.
; opcache.validate_root=0

[curl]
; A default value for the CURLOPT_CAINFO option. This is required to be an
; absolute path.
;curl.cainfo =

[openssl]
; The location of a Certificate Authority (CA) file on the local filesystem
; to use when verifying the identity of SSL/TLS peers. Most users should
; not specify a value for this directive as PHP will attempt to use the
; OS-managed cert stores in its absence. If specified, this value may still
; be overridden on a per-stream basis via the "cafile" SSL stream context
; option.
;openssl.cafile=

; If openssl.cafile is not specified or if the CA file is not found, the
; directory pointed to by openssl.capath is searched for a suitable
; certificate. This value must be a correctly hashed certificate directory.
; Most users should not specify a value for this directive as PHP will
; attempt to use the OS-managed cert stores in its absence. If specified,
; this value may still be overridden on a per-stream basis via the "capath"
; SSL stream context option.
;openssl.capath=

; Local Variables:
; tab-width: 4
; End:
  • 编写Docker-Compose文件
version: "3.3"

services:
  nginx:
    hostname: nginx
    build: 
      context: ./nginx
      dockerfile: Dockerfile
    # expose:
    #   - "80"
    ports:
      - "80:80"
    restart: always
    links:
      - "mysql"
      - "php:php-cgi"
    volumes:
      # - /data/container/web:/usr/local/nginx/html
      - ./wwwroot:/usr/local/nginx/html
    depends_on:
      - mysql
      - php

  php:
    hostname: php
    build: ./php
    # ports:
    #   - "9000:9000"
    restart: always
    links:
      - mysql:mysql-db
    volumes:
      # - /data/container/web:/usr/local/nginx/html
      - ./wwwroot:/usr/local/nginx/html

  mysql:
    hostname: mysql
    image: mysql:5.6
    restart: always
    ports:
      - "3306:3306"
    environment:
      MYSQL_ROOT_PASSWORD: 123456
      MYSQL_USER: user
      MYSQL_PASSWORD: 123456
    volumes:
      - ./mysql/conf:/etc/mysql/conf.d
      - ./mysql/data:/var/lib/mysql

Docker-Compose项目的文件列表

$ tree -p
.
├── [-rw-r--r--]  docker-compose.yml
├── [drwxr-xr-x]  mysql
│   ├── [drwxr-xr-x]  conf
│   │   └── [-rw-r--r--]  my.cnf
│   └── [-rw-r--r--]  my.cnf
├── [drwxr-xr-x]  nginx
│   ├── [-rw-r--r--]  Dockerfile
│   └── [-rw-r--r--]  nginx.conf
└── [drwxr-xr-x]  php
    ├── [-rw-r--r--]  Dockerfile
    └── [-rw-r--r--]  php.ini

4 directories, 7 files

# 运行docker-compose命令执行构建
$ docker-compose up -d
# 查看docker-compose的运行进程
$ docker-compose ps 
NAME                   COMMAND                  SERVICE             STATUS              PORTS
compose-lnmp-mysql-1   "docker-entrypoint.s…"   mysql               running             0.0.0.0:3306->3306/tcp, :::3306->3306/tcp
compose-lnmp-nginx-1   "/usr/local/nginx/sb…"   nginx               running             0.0.0.0:80->80/tcp, :::80->80/tcp
compose-lnmp-php-1     "/bin/sh -c '/etc/in…"   php                 running             9000/tcp

# 访问PHP页面
$ echo "<?php phpinfo()?>" > wwwroot/test.php
$ curl 127.0.0.1/test.php

02 Docker 进阶部分 - 图38

9.6 案例2:一键部署Nginx反向代理Tomcat集群

cat > docker-compose.yml <<EOF
version: '3'
services:
  nginx:
    hostname: nginx
    build:
      context: ./nginx
      dockerfile: Dockerfile
    ports:
      - 80:80
    networks:
      - lnmt
    volumes :
      - ./nginx/tomcat.conf:/usr/local/nginx/conf/vhost/tomcat.conf
      - ./webapps:/usr/local/tomcat/webapps

  tomcat01:
    hostname: tomcat01
    build: ./tomcat
    networks:
      - lnmt
    volumes:
      - ./webapps:/usr/local/tomcat/webapps

  tomcat02:
    hostname : tomcat02
    build: ./tomcat
    networks:
      - lnmt
    volumes:
      - ./webapps:/usr/local/tomcat/webapps

  mysql:
    hostname: mysql
    image: mysql:5.7
    ports:
    - 3306:3306
    networks:
    - lnmt
    volumes:
    - ./mysql/conf:/etc/mysql/conf.d
    - ./mysql/data:/var/lib/mysql
    environment:
      MYSQL_ROOT_PASSWORD: 123456
      MYSQL_DATABASE: test
      MYSQL_USER: user
      MYSQL_PASSWORD: user123456

networks:
  lnmt: {}
EOF

:::color5 Nginx 配置目录

:::

$ mkdir -pv compose-tomcat/{mysql,nginx,tomcat,webapps}
$ cd nginx 

# 编写Dockerfile文件
$ cat > Dockerfile <<EOF
FROM centos:centos7.9.2009
LABEL maintainer www.baidu.com

# RUN curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo && \
#     curl -o /etc/yum.repos.d/epel.repo https://mirrors.aliyun.com/repo/epel-7.repo

RUN yum install -y gcc gcc-c++ make \
    openssl-devel pcre-devel gd-devel \
    iproute net-tools telnet wget curl && \
    yum clean all && \
    rm -rf /var/cache/yum/*
# http://nginx.org/download/nginx-1.21.1.tar.gz 下载到Dockerfile同级目录
ADD nginx-1.21.1.tar.gz /
RUN cd nginx-1.21.1 && \
    ./configure --prefix=/usr/local/nginx \
    --with-http_ssl_module \
    --with-http_stub_status_module && \
    make -j 4 && make install && \
    mkdir /usr/local/nginx/conf/vhost && \
    cd / && rm -rf nginx* && \
    ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime

RUN useradd nginx

ENV PATH $PATH:/usr/local/nginx/sbin

COPY nginx.conf /usr/local/nginx/conf/nginx.conf

WORKDIR /usr/local/nginx

EXPOSE 80

CMD ["nginx", "-g", "daemon off;"]
EOF

# Nginx 配置文件内容
cat > nginx.conf <<-'EOF'
user nginx;
worker_processes auto;

error_log logs/error.log  info;
pid logs/nginx.pid; 

events {
    worker_connections 4096;
}

http {
    log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
                      '$status $body_bytes_sent "$http_referer" '
                      '"$http_user_agent" "$http_x_forwarded_for"';

    access_log logs/access.log main;

    sendfile            on;
    tcp_nopush          on;
    tcp_nodelay         on;
    keepalive_timeout   65;
    types_hash_max_size 2048;

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

    include /usr/local/nginx/conf/vhost/*.conf;

    server {
        listen       80 default_server;
        listen       [::]:80 default_server;
        server_name  _;
        # root         /usr/share/nginx/html;
        # include      /usr/local/nginx/conf/vhost/*.conf;

        location / {
            root   html;
            index  index.html index.htm;
        }

        # location ~* \.php$ {
        #     root html;
        #     fastcgi_pass php:9000;
        #     fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        #     include fastcgi_params;
        # }

        # error_page 404 /404.html;
        #     location = /40x.html {
        # }

        # error_page 500 502 503 504 /50x.html;
        #     location = /50x.html {
        # }
    }
}
EOF

# tomcat.conf 配置文件内容
$ cat > tomcat.conf <<EOF
upstream tomcat {
    #ip_hash;
    server tomcat01:8080;
    server tomcat02:8080;
}
server {
    listen 80;
    server_name example.ctnrs.com;

    location / {
        proxy_pass http://tomcat;
    }

    #   location ~ \. (html|css|js|jpg|png|gif)$ {
    #       root /usr/local/tomcat/webapps/ROOT;
    #   }
}
EOF
$ tree -p 
.
├── [-rw-r--r--]  Dockerfile
├── [-rw-r--r--]  nginx-1.21.1.tar.gz
├── [-rw-r--r--]  nginx.conf
└── [-rw-r--r--]  tomcat.conf

0 directories, 4 files

:::color5 Tomcat 配置目录

:::

$ cat > Dockerfile <<EOF
FROM centos:centos7.9.2009
LABEL maintainer www.kubesphere.io

ENV VERSION=8.5.84

RUN yum install java-1.8.0-openjdk wget curl unzip iproute net-tools -y && \
    yum clean all && \
    rm -rf /var/cache/yum/*
# wget https://dlcdn.apache.org/tomcat/tomcat-8/v8.5.84/bin/apache-tomcat-8.5.84.tar.gz
ADD apache-tomcat-${VERSION}.tar.gz /usr/local/
RUN mv /usr/local/apache-tomcat-${VERSION} /usr/local/tomcat && \
    sed -i '1a JAVA_OPTS="-Djava.security.egd=file:/dev/./urandom"' /usr/local/tomcat/bin/catalina.sh && \
    ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime

ENV PATH $PATH:/usr/local/tomcat/bin

WORKDIR /usr/local/tomcat

EXPOSE 8080

CMD ["catalina.sh", "run"]
EOF
$ tree -p 
.
├── [-rw-r--r--]  apache-tomcat-8.5.84.tar.gz
└── [-rw-r--r--]  Dockerfile

0 directories, 2 files

:::color5 MySQL 的部署目录

:::

# data 数据的持久化
$ cd mysql && mkdir -pv {conf,data}

# conf/my.cnf
$ cat > conf/my.cnf <<EOF
[mysqld]
user = mysql
port = 3306
datadir = /var/lib/mysql
socket  = /var/lib/mysql/mysql.sock
pid-file  = /var/run/mysql/mysql.pid
log_error = /var/log/mysql/error.log
# character_set_server = utf8
# character_set_client = utf8
max_connections = 3600
EOF

# 查看目录树
$ tree -p 
.
├── [drwxr-xr-x]  conf
│   └── [-rw-r--r--]  my.cnf
└── [drwxr-xr-x]  data

2 directories, 1 file

:::color5 webapps 的部署目录

:::

# 将 war 包放在该目录下即可

:::color5 启动Docker-Compose项目

:::

$ docker-compose up -d 
$ docker-compose ps 
          Name                        Command             State                          Ports                       
---------------------------------------------------------------------------------------------------------------------
compose-tomcat_mysql_1      docker-entrypoint.sh mysqld   Up      0.0.0.0:3306->3306/tcp,:::3306->3306/tcp, 33060/tcp
compose-tomcat_nginx_1      nginx -g daemon off;          Up      0.0.0.0:80->80/tcp,:::80->80/tcp                   
compose-tomcat_tomcat01_1   catalina.sh run               Up      8080/tcp                                           
compose-tomcat_tomcat02_1   catalina.sh run               Up      8080/tcp

# $ curl -H "Host: example.ctnrs.com" 10.0.0.100

  • MySQL 部署
[mysqld]
user = mysql
port = 3306
datadir = /var/lib/mysql
socket  = /var/lib/mysql/mysql.sock
pid-file  = /var/run/mysql/mysql.pid
log_error = /var/log/mysql/error.log
character_set_server = utf8mb4
character_set_client = utf8mb4
max_connections = 3600
  • Nginx 部署

Dockerfile

FROM centos:6

MAINTAINER <zhongzhiwei zhongzhiwei@kubesphere.io>

# 获取最新Yum源信息 & 下载相应软件
RUN curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-vault-6.10.repo && \
    yum install -y gcc gcc-c++ make openssl-devel pcre-devel
ADD http://nginx.org/download/nginx-1.12.2.tar.gz /tmp
# 需要将nginx-1.12.2.tar.gz存放在Dockerfile同级目录下
# ADD nginx-1.12.2.tar.gz /tmp

RUN cd /tmp/nginx-1.12.2 && ./configure --prefix=/usr/local/nginx && make -j 2 && make install
RUN rm -f /usr/local/nginx/conf/nginx.conf 
COPY ./nginx.conf /usr/local/nginx/conf

EXPOSE 80
CMD ["/usr/local/nginx/sbin/nginx", "-g", "daemon off;"]

Nginx配置文件 nginx.conf

user  root; 
worker_processes  auto; 

error_log  logs/error.log  info;

pid        logs/nginx.pid; 

events {
    use epoll; 
}

http {

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

    log_format  main '$remote_addr - $remote_user [$time_local] "$request" '
                      '$status $body_bytes_sent "$http_referer" '
                      '"$http_user_agent" "$http_x_forwarded_for"';

    access_log logs/access.log main;
    sendfile        on;
    keepalive_timeout  65;

    upstream www.example.com {
        #ip_hash;
        server tomcat01:8080;
          server tomcat02:8080;
          server tomcat03:8080;
    }

    server {
        listen 80;
        server_name localhost;

          location / {
              proxy_pass http://www.example.com;
          }

        location ~ \.(html|css|js|jpg|png|gif)$ {
            root /opt/webapps/ROOT;
        }
    }
}
  • Tomcat 部署

Dockerfile

FROM centos:6

MAINTAINER <zhongzhiwei zhongzhiwei@kubesphere.io> 

# 获取最新Yum源信息 & 下载相应软件
RUN curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-vault-6.10.repo

ADD jdk-8u45-linux-x64.tar.gz /usr/local
ENV JAVA_HOME /usr/local/jdk1.8.0_45

ADD apache-tomcat-8.5.83.tar.gz /usr/local
COPY server.xml /usr/local/apache-tomcat-8.5.83/conf

EXPOSE 8080
ENTRYPOINT ["/usr/local/apache-tomcat-8.5.83/bin/catalina.sh", "run"]

server.xml 配置文件

<?xml version="1.0" encoding="UTF-8"?>
<Server port="8005" shutdown="SHUTDOWN">
  <Listener className="org.apache.catalina.startup.VersionLoggerListener" />
  <!-- Security listener. Documentation at /docs/config/listeners.html
  <Listener className="org.apache.catalina.security.SecurityListener" />
  -->
  <!-- APR library loader. Documentation at /docs/apr.html -->
  <Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="on" />
  <!-- Prevent memory leaks due to use of particular java/javax APIs-->
  <Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener" />
  <Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />
  <Listener className="org.apache.catalina.core.ThreadLocalLeakPreventionListener" />

  <!-- Global JNDI resources
       Documentation at /docs/jndi-resources-howto.html
  -->
  <GlobalNamingResources>
    <!-- Editable user database that can also be used by
         UserDatabaseRealm to authenticate users
    -->
    <Resource name="UserDatabase" auth="Container"
              type="org.apache.catalina.UserDatabase"
              description="User database that can be updated and saved"
              factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
              pathname="conf/tomcat-users.xml" />
  </GlobalNamingResources>

  <!-- A "Service" is a collection of one or more "Connectors" that share
       a single "Container" Note:  A "Service" is not itself a "Container",
       so you may not define subcomponents such as "Valves" at this level.
       Documentation at /docs/config/service.html
   -->
  <Service name="Catalina">

    <!--The connectors can use a shared executor, you can define one or more named thread pools-->
    <!--
    <Executor name="tomcatThreadPool" namePrefix="catalina-exec-"
        maxThreads="150" minSpareThreads="4"/>
    -->


    <!-- A "Connector" represents an endpoint by which requests are received
         and responses are returned. Documentation at :
         Java HTTP Connector: /docs/config/http.html
         Java AJP  Connector: /docs/config/ajp.html
         APR (HTTP/AJP) Connector: /docs/apr.html
         Define a non-SSL/TLS HTTP/1.1 Connector on port 8080
    -->
    <Connector port="8080" protocol="HTTP/1.1"
               connectionTimeout="20000"
               redirectPort="8443" />
    <!-- A "Connector" using the shared thread pool-->
    <!--
    <Connector executor="tomcatThreadPool"
               port="8080" protocol="HTTP/1.1"
               connectionTimeout="20000"
               redirectPort="8443" />
    -->
    <!-- Define an SSL/TLS HTTP/1.1 Connector on port 8443
         This connector uses the NIO implementation. The default
         SSLImplementation will depend on the presence of the APR/native
         library and the useOpenSSL attribute of the AprLifecycleListener.
         Either JSSE or OpenSSL style configuration may be used regardless of
         the SSLImplementation selected. JSSE style configuration is used below.
    -->
    <!--
    <Connector port="8443" protocol="org.apache.coyote.http11.Http11NioProtocol"
               maxThreads="150" SSLEnabled="true">
        <SSLHostConfig>
            <Certificate certificateKeystoreFile="conf/localhost-rsa.jks"
                         type="RSA" />
        </SSLHostConfig>
    </Connector>
    -->
    <!-- Define an SSL/TLS HTTP/1.1 Connector on port 8443 with HTTP/2
         This connector uses the APR/native implementation which always uses
         OpenSSL for TLS.
         Either JSSE or OpenSSL style configuration may be used. OpenSSL style
         configuration is used below.
    -->
    <!--
    <Connector port="8443" protocol="org.apache.coyote.http11.Http11AprProtocol"
               maxThreads="150" SSLEnabled="true" >
        <UpgradeProtocol className="org.apache.coyote.http2.Http2Protocol" />
        <SSLHostConfig>
            <Certificate certificateKeyFile="conf/localhost-rsa-key.pem"
                         certificateFile="conf/localhost-rsa-cert.pem"
                         certificateChainFile="conf/localhost-rsa-chain.pem"
                         type="RSA" />
        </SSLHostConfig>
    </Connector>
    -->

    <!-- Define an AJP 1.3 Connector on port 8009 -->
    <!--
    <Connector protocol="AJP/1.3"
               address="::1"
               port="8009"
               redirectPort="8443" />
    -->

    <!-- An Engine represents the entry point (within Catalina) that processes
         every request.  The Engine implementation for Tomcat stand alone
         analyzes the HTTP headers included with the request, and passes them
         on to the appropriate Host (virtual host).
         Documentation at /docs/config/engine.html -->

    <!-- You should set jvmRoute to support load-balancing via AJP ie :
    <Engine name="Catalina" defaultHost="localhost" jvmRoute="jvm1">
    -->
    <Engine name="Catalina" defaultHost="localhost">

      <!--For clustering, please take a look at documentation at:
          /docs/cluster-howto.html  (simple how to)
          /docs/config/cluster.html (reference documentation) -->
      <!--
      <Cluster className="org.apache.catalina.ha.tcp.SimpleTcpCluster"/>
      -->

      <!-- Use the LockOutRealm to prevent attempts to guess user passwords
           via a brute-force attack -->
      <Realm className="org.apache.catalina.realm.LockOutRealm">
        <!-- This Realm uses the UserDatabase configured in the global JNDI
             resources under the key "UserDatabase".  Any edits
             that are performed against this UserDatabase are immediately
             available for use by the Realm.  -->
        <Realm className="org.apache.catalina.realm.UserDatabaseRealm"
               resourceName="UserDatabase"/>
      </Realm>

      <Host name="localhost"  appBase="webapps"
            unpackWARs="true" autoDeploy="true">

        <!-- SingleSignOn valve, share authentication between web applications
             Documentation at: /docs/config/valve.html -->
        <!--
        <Valve className="org.apache.catalina.authenticator.SingleSignOn" />
        -->

        <!-- Access log processes all example.
             Documentation at: /docs/config/valve.html
             Note: The pattern used is equivalent to using pattern="common" -->
        <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
               prefix="localhost_access_log" suffix=".txt"
               pattern="%h %l %u %t &quot;%r&quot; %s %b" />

      </Host>
    </Engine>
  </Service>
</Server>
  • Docker-Compose.yml 文件
version: '3'
services:
  nginx:
    hostname: nginx
    build:
      context: ./nginx
      dockerfile: Dockerfile
    ports:
      - 80:80
    links:
      - tomcat01:tomcat01
      - tomcat02:tomcat02
      - tomcat03:tomcat03
    volumes:
      - ./webapps:/opt/webapps
    depends_on:
      - mysql
      - tomcat01
      - tomcat02
      - tomcat03

  tomcat01:
    hostname: tomcat01
    build: ./tomcat
    links:
      - mysql:mysql-db
    volumes:
      - ./webapps:/usr/local/apache-tomcat-8.5.83/webapps

  tomcat02:
    hostname: tomcat02
    build: ./tomcat
    links:
      - mysql:mysql-db
    volumes:
      - ./webapps:/usr/local/apache-tomcat-8.5.83/webapps

  tomcat03:
    hostname: tomcat03
    build: ./tomcat
    links:
      - mysql:mysql-db
    volumes:
      - ./webapps:/usr/local/apache-tomcat-8.5.83/webapps

  mysql:
    hostname: mysql
    image: mysql:5.6
    ports:
      - 3306:3306
    volumes:
      - ./mysql/conf:/etc/mysql/conf.d
      - ./mysql/data:/var/lib/mysql
    environment:
      MYSQL_ROOT_PASSWORD: 123456
      MYSQL_DATABASE: db
      MYSQL_USER: user
      MYSQL_PASSWORD: 123456
    privileged: true

Docker-Compose 目录结构:

$ mkdir -pv compose-nginx-tomcat ; cd compose-nginx-tomcat
$ mkdir -pv nginx mysql/{conf,data} tomcat webapps/ROOT
$ echo "Java Page ......" > webapps/ROOT/index.jsp

# 查看项目的目录结构
$ tree 
tree  -p
.
├── [-rw-r--r--]  docker-compose.yml
├── [drwxr-xr-x]  mysql
│   ├── [drwxr-xr-x]  conf
│   │   └── [-rw-r--r--]  my.cnf
│   └── [drwxr-xr-x]  data
├── [drwxr-xr-x]  nginx
│   ├── [-rw-r--r--]  Dockerfile
│   └── [-rw-r--r--]  nginx.conf
├── [drwxr-xr-x]  tomcat
│   ├── [-rw-r--r--]  apache-tomcat-8.5.83.tar.gz
│   ├── [-rw-r--r--]  Dockerfile
│   ├── [-rw-r--r--]  jdk-8u45-linux-x64.tar.gz
│   └── [-rw-r--r--]  server.xml
└── [drwxr-xr-x]  webapps
    └── [drwxr-xr-x]  ROOT
        └── [-rw-r--r--]  index.jsp

7 directories, 9 files

$ docker-compose up -d
$ docker-compose ps 
NAME                              COMMAND                  SERVICE             STATUS              PORTS
compose-nginx-tomcat-mysql-1      "docker-entrypoint.s…"   mysql               running             0.0.0.0:3306->3306/tcp, :::3306->3306/tcp
compose-nginx-tomcat-nginx-1      "/usr/local/nginx/sb…"   nginx               running             0.0.0.0:80->80/tcp, :::80->80/tcp
compose-nginx-tomcat-tomcat01-1   "/usr/local/apache-t…"   tomcat01            running             8080/tcp
compose-nginx-tomcat-tomcat02-1   "/usr/local/apache-t…"   tomcat02            running             8080/tcp
compose-nginx-tomcat-tomcat03-1   "/usr/local/apache-t…"   tomcat03            running             8080/tcp

# 查看Docker-compose项目的各容器的日志
$ docker-compose logs

# 访问页面
$ curl 110.41.20.249
Java Page ......

添加内容显示后端代理的地址

# $ docker exec -it compose_nginx_tomcat_nginx_1 bash
$ vim nginx/nginx.conf
user  root; 
worker_processes  auto; 

error_log  logs/error.log  info;

pid        logs/nginx.pid; 

events {
    use epoll; 
}

http {

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

    log_format  main '$upstream_addr $remote_addr - $remote_user [$time_local] "$request" '
                      '$status $body_bytes_sent "$http_referer" '
                      '"$http_user_agent" "$http_x_forwarded_for"';

    access_log logs/access.log main;
    sendfile        on;
    keepalive_timeout  65;

    upstream www.example.com {
        #ip_hash;
        server tomcat01:8080;
            server tomcat02:8080;
            server tomcat03:8080;
    }

    server {
        listen 80;
        server_name localhost;

              location / {
                  proxy_pass http://www.example.com;
              }

        location ~ \.(html|css|js|jpg|png|gif)$ {
            root /opt/webapps/ROOT;
        }
    }
}

02 Docker 进阶部分 - 图39

# 修改后需要退出容器使用docker-compose restart重启才能使配置生效,在容器内重启nginx不生效
docker-compose restart

# 访问页面
$ curl 110.41.20.249
Java Page ......

# 停止运行的容器
$ docker-compose stop

10 Prometheus 监控 Docker 主机

10.1 监控系统概述

  • cAdvisor (Container Advisor):用于收集正在运行的容器资源使用和性能信息。( Kubelet 默认内置采用 cAdvisor )

https://github.com/google/cadvisor

  • Prometheus (普罗米修斯):容器监控系统。

https://prometheus.io

https://github.com/prometheus

  • Grafana:是一个开源的度量分析和可视化系统。

https://grafana.com/grafana

:::color5 cAdvisor ( 采集所有容器资源利用率,在每个Docker主机部署 ) ←Prometheus ( 收集和存储 ) →Grafana ( 可视化展示 )

:::

10.2 监控系统部署

:::color2 Docker 部署 Advisor

:::

# Advisor GitHub 部署命令
#   sudo docker run \
#   --volume=/:/rootfs:ro \
#   --volume=/var/run:/var/run:ro \
#   --volume=/sys:/sys:ro \
#   --volume=/var/lib/docker/:/var/lib/docker:ro \
#   --volume=/dev/disk/:/dev/disk:ro \
#   --publish=8080:8080 \
#   --detach=true \
#   --name=cadvisor \
#   --privileged=true \
#   --device=/dev/kmsg \
#   gcr.io/cadvisor/cadvisor:$VERSION

# /var/lib/docker/:/var/lib/docker:ro 挂载Docker的工作目录
$ sudo docker run -d \
  --volume=/:/rootfs:ro \
  --volume=/var/run:/var/run:ro \
  --volume=/sys:/sys:ro \
  --volume=/var/lib/docker/:/var/lib/docker:ro \
  --volume=/dev/disk/:/dev/disk:ro \
  --publish=8080:8080 \
  --restart always \
  --detach=true \
  --name=cadvisor \
  google/cadvisor:latest

# 浏览器访问: http://NodeIP:8080
- http://NodeIP:8080/containers/
# 查看相关参数
- http://NodeIP:8080/metrics
  1. 浏览器访问:http://<IP地址>:8080/containers/

02 Docker 进阶部分 - 图40

可以查看到很多的监控指标( 实时不会存储到硬盘中 )

  1. 浏览器访问:http://<IP地址>:8080/metrics/

02 Docker 进阶部分 - 图41

:::color2 Dockerc 部署 Prometheus

:::

$ sudo docker run -d \
    --name=prometheus \
    -p 9090:9090 \
    prom/prometheus

$ docker ps -l 
CONTAINER ID   IMAGE             COMMAND                  CREATED         STATUS         PORTS                                       NAMES
b74015cb3559   prom/prometheus   "/bin/prometheus --c…"   4 minutes ago   Up 4 minutes   0.0.0.0:9090->9090/tcp, :::9090->9090/tcp   prometheus
  1. 浏览器访问:http://<IP地址>:9090

02 Docker 进阶部分 - 图42

# 修改Prometheus的配置文件
# job        : 分组
# target: 被监控端,instances
$ docker exec -it prometheus /bin/sh
/prometheus $ vi /etc/prometheus/prometheus.yml 
# metrics_path defaults to '/metrics'
# scheme defaults to 'http'.
# 添加以下内容
- job_name: "docker"
  static_configs:
    # cadvisor 暴露的端口
    - targets: ["10.0.0.100:8080"]

# 重启Prometheus容器
$ docker restart prometheus 
$ docker ps -l 
CONTAINER ID   IMAGE             COMMAND                  CREATED          STATUS          PORTS                                       NAMES
b74015cb3559   prom/prometheus   "/bin/prometheus --c…"   14 minutes ago   Up 36 seconds   0.0.0.0:9090->9090/tcp, :::9090->9090/tcp   prometheus

浏览器访问:http://<IP地址>:9090查看Targets的状态信息

02 Docker 进阶部分 - 图43

02 Docker 进阶部分 - 图44

:::warning 学习Prometheus的成本:

  1. Prometheus 的配置管理
  2. PromQL 查询语言

:::

:::color2 Dockerc 部署 Grafana

:::

$ sudo docker run -d \
   --name=grafana -p 3000:3000 \
   --restart always \
   grafana/grafana

# 浏览器访问:http://NodeIP:3000
# 默认用户名和密码:admin/admin

浏览器访问:http://<IP地址>:3000

02 Docker 进阶部分 - 图45

10.3 Grafana展示

10.3.1 自建 Grafana 简易仪表板

02 Docker 进阶部分 - 图46

选择”Prometheus”的数据源的配置添加 → “Save & Test”

02 Docker 进阶部分 - 图47

02 Docker 进阶部分 - 图48

配置仪表板信息

02 Docker 进阶部分 - 图49

02 Docker 进阶部分 - 图50

02 Docker 进阶部分 - 图51

可以在一个仪表板中添加多个查询结构显示

10.3.2 导入 Grafana 仪表板

02 Docker 进阶部分 - 图52

可以使用编号为:

监控Docker主机模板ID:193 或者 11600

Reference:https://grafana.com/dashboards

02 Docker 进阶部分 - 图53

10.3.3 图表不出数据

:::warning

  1. 时间没有同步
  2. PromQL查询有问题,可能是版本不兼容
  3. Prometheus 里没有数据

:::

10.4 监控多 Docker 主机

02 Docker 进阶部分 - 图54

在其他的 Docker Host 主机运行

$ sudo docker run -d \
  --volume=/:/rootfs:ro \
  --volume=/var/run:/var/run:ro \
  --volume=/sys:/sys:ro \
  --volume=/var/lib/docker/:/var/lib/docker:ro \
  --volume=/dev/disk/:/dev/disk:ro \
  --publish=8080:8080 \
  --restart always \
  --detach=true \
  --name=cadvisor \
  google/cadvisor:latest

在主的Prometheus的容器中修改Prometheus配置文件

$ docker exec -it prometheus /bin/sh
/prometheus $ vi /etc/prometheus/prometheus.yml 
- job_name: "docker"
  static_configs:
    - targets: ["10.0.0.100:8080","10.0.0.101:8080"]

# 重启Prometheus容器
$ docker restart prometheus 

$ docker ps
CONTAINER ID   IMAGE                    COMMAND                  CREATED          STATUS          PORTS                                       NAMES
b74015cb3559   prom/prometheus          "/bin/prometheus --c…"   38 minutes ago   Up 11 seconds   0.0.0.0:9090->9090/tcp, :::9090->9090/tcp   prometheus

浏览器访问:http://<IP地址>:9090查看Targets的状态信息

02 Docker 进阶部分 - 图55

Grafana 怎么将其展示出来

02 Docker 进阶部分 - 图56

  • Prometheus 使用 up可以获取所有的被监控端的指标信息

02 Docker 进阶部分 - 图57

  • Grafana 修改仪表板

02 Docker 进阶部分 - 图58

02 Docker 进阶部分 - 图59

  • 需要将每一个小的仪表板适配该选项,使得更快的展示
rate(container_cpu_user_seconds_total{image!="",instance="$NodeChoice"}[5m]) * 100

02 Docker 进阶部分 - 图60