├── www ├── phpinfo.php ├── mysql.php ├── index.html ├── redis.php └── mongo.php ├── .gitignore ├── nginx ├── ssl │ └── .gitignore ├── sites │ ├── .gitignore │ ├── thinkphp.conf │ ├── yii.conf │ ├── default.conf │ └── laravel.conf ├── Dockerfile └── nginx.conf ├── php-fpm ├── conf-5.6 │ ├── php-fpm.conf │ └── php-fpm.d │ │ ├── zz-docker.conf │ │ └── docker.conf ├── conf-7.1 │ ├── php-fpm.d │ │ ├── zz-docker.conf │ │ ├── docker.conf │ │ └── www.conf │ └── php-fpm.conf ├── conf-7.2 │ ├── php-fpm.d │ │ ├── zz-docker.conf │ │ ├── docker.conf │ │ └── www.conf │ └── php-fpm.conf ├── conf-7.3 │ ├── php-fpm.d │ │ ├── zz-docker.conf │ │ ├── docker.conf │ │ ├── www.conf │ │ └── www.conf.default │ └── php-fpm.conf ├── conf-7.4 │ ├── php-fpm.d │ │ ├── zz-docker.conf │ │ ├── docker.conf │ │ └── www.conf │ └── php-fpm.conf ├── conf-8.0 │ ├── php-fpm.d │ │ ├── zz-docker.conf │ │ ├── docker.conf │ │ ├── www.conf │ │ └── www.conf.default │ └── php-fpm.conf ├── conf-8.1 │ ├── php-fpm.d │ │ ├── zz-docker.conf │ │ └── docker.conf │ └── php-fpm.conf └── Dockerfile ├── mysql └── Dockerfile ├── memcached └── Dockerfile ├── mongo └── Dockerfile ├── redis └── Dockerfile ├── docs ├── vhost.md └── https.md ├── README.md ├── env-example └── docker-compose.yml /www/phpinfo.php: -------------------------------------------------------------------------------- 1 | " 4 | 5 | VOLUME /var/www 6 | WORKDIR /var/www 7 | 8 | EXPOSE 80 443 -------------------------------------------------------------------------------- /mysql/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG MYSQL_VERSION 2 | FROM mysql:${MYSQL_VERSION} 3 | 4 | LABEL maintainer="YanlongMa " 5 | 6 | CMD ["mysqld"] 7 | 8 | EXPOSE 3306 -------------------------------------------------------------------------------- /memcached/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG MEMCACHED_VERSION 2 | FROM memcached:${MEMCACHED_VERSION}-alpine 3 | 4 | LABEL maintainer="YanlongMa " 5 | 6 | CMD ["memcached"] 7 | 8 | EXPOSE 11211 -------------------------------------------------------------------------------- /www/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Document 6 | 7 | 8 |

Hello Docker LNMP!

9 | 10 | -------------------------------------------------------------------------------- /mongo/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG MONGO_VERSION 2 | FROM mongo:${MONGO_VERSION} 3 | 4 | LABEL maintainer="YanlongMa " 5 | 6 | #COPY mongo.conf /usr/local/etc/mongo/mongo.conf 7 | 8 | CMD ["mongod"] 9 | 10 | EXPOSE 27017 -------------------------------------------------------------------------------- /www/redis.php: -------------------------------------------------------------------------------- 1 | connect('redis', 6379); // 连接Redis 5 | // $redis->auth('mypasswords123sdfeak'); // 密码验证 6 | $redis->select(0); // 选择数据库 7 | // $redis->set( "testKey" , "Hello Redis"); // 设置测试key 8 | echo $redis->get("name"); // 输出value 9 | -------------------------------------------------------------------------------- /php-fpm/conf-5.6/php-fpm.d/docker.conf: -------------------------------------------------------------------------------- 1 | [global] 2 | error_log = /proc/self/fd/2 3 | 4 | [www] 5 | ; if we send this to /proc/self/fd/1, it never appears 6 | access.log = /proc/self/fd/2 7 | 8 | clear_env = no 9 | 10 | ; Ensure worker stdout and stderr are sent to the main error log. 11 | catch_workers_output = yes 12 | -------------------------------------------------------------------------------- /php-fpm/conf-7.1/php-fpm.d/docker.conf: -------------------------------------------------------------------------------- 1 | [global] 2 | error_log = /proc/self/fd/2 3 | 4 | [www] 5 | ; if we send this to /proc/self/fd/1, it never appears 6 | access.log = /proc/self/fd/2 7 | 8 | clear_env = no 9 | 10 | ; Ensure worker stdout and stderr are sent to the main error log. 11 | catch_workers_output = yes 12 | -------------------------------------------------------------------------------- /php-fpm/conf-7.2/php-fpm.d/docker.conf: -------------------------------------------------------------------------------- 1 | [global] 2 | error_log = /proc/self/fd/2 3 | 4 | [www] 5 | ; if we send this to /proc/self/fd/1, it never appears 6 | access.log = /proc/self/fd/2 7 | 8 | clear_env = no 9 | 10 | ; Ensure worker stdout and stderr are sent to the main error log. 11 | catch_workers_output = yes 12 | -------------------------------------------------------------------------------- /redis/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG REDIS_VERSION 2 | FROM redis:${REDIS_VERSION}-alpine 3 | 4 | LABEL maintainer="YanlongMa " 5 | 6 | #RUN mkdir -p /usr/local/etc/redis 7 | #COPY redis.conf /usr/local/etc/redis/redis.conf 8 | 9 | #CMD [ "redis-server", "/usr/local/etc/redis/redis.conf" ] 10 | CMD [ "redis-server"] 11 | 12 | EXPOSE 6379 -------------------------------------------------------------------------------- /php-fpm/conf-7.3/php-fpm.d/docker.conf: -------------------------------------------------------------------------------- 1 | [global] 2 | error_log = /proc/self/fd/2 3 | 4 | ; https://github.com/docker-library/php/pull/725#issuecomment-443540114 5 | log_limit = 8192 6 | 7 | [www] 8 | ; if we send this to /proc/self/fd/1, it never appears 9 | access.log = /proc/self/fd/2 10 | 11 | clear_env = no 12 | 13 | ; Ensure worker stdout and stderr are sent to the main error log. 14 | catch_workers_output = yes 15 | decorate_workers_output = no 16 | -------------------------------------------------------------------------------- /php-fpm/conf-7.4/php-fpm.d/docker.conf: -------------------------------------------------------------------------------- 1 | [global] 2 | error_log = /proc/self/fd/2 3 | 4 | ; https://github.com/docker-library/php/pull/725#issuecomment-443540114 5 | log_limit = 8192 6 | 7 | [www] 8 | ; if we send this to /proc/self/fd/1, it never appears 9 | access.log = /proc/self/fd/2 10 | 11 | clear_env = no 12 | 13 | ; Ensure worker stdout and stderr are sent to the main error log. 14 | catch_workers_output = yes 15 | decorate_workers_output = no 16 | -------------------------------------------------------------------------------- /php-fpm/conf-8.0/php-fpm.d/docker.conf: -------------------------------------------------------------------------------- 1 | [global] 2 | error_log = /proc/self/fd/2 3 | 4 | ; https://github.com/docker-library/php/pull/725#issuecomment-443540114 5 | log_limit = 8192 6 | 7 | [www] 8 | ; if we send this to /proc/self/fd/1, it never appears 9 | access.log = /proc/self/fd/2 10 | 11 | clear_env = no 12 | 13 | ; Ensure worker stdout and stderr are sent to the main error log. 14 | catch_workers_output = yes 15 | decorate_workers_output = no 16 | -------------------------------------------------------------------------------- /php-fpm/conf-8.1/php-fpm.d/docker.conf: -------------------------------------------------------------------------------- 1 | [global] 2 | error_log = /proc/self/fd/2 3 | 4 | ; https://github.com/docker-library/php/pull/725#issuecomment-443540114 5 | log_limit = 8192 6 | 7 | [www] 8 | ; if we send this to /proc/self/fd/1, it never appears 9 | access.log = /proc/self/fd/2 10 | 11 | clear_env = no 12 | 13 | ; Ensure worker stdout and stderr are sent to the main error log. 14 | catch_workers_output = yes 15 | decorate_workers_output = no 16 | -------------------------------------------------------------------------------- /www/mongo.php: -------------------------------------------------------------------------------- 1 | insert(['x' => 1, 'name'=>'菜鸟教程', 'url' => 'http://www.runoob.com']); 8 | $bulk->insert(['x' => 2, 'name'=>'Google', 'url' => 'http://www.google.com']); 9 | $bulk->insert(['x' => 3, 'name'=>'taobao', 'url' => 'http://www.taobao.com']); 10 | $result = $manager->executeBulkWrite('test-db.test-sites', $bulk); 11 | 12 | var_dump($result); -------------------------------------------------------------------------------- /nginx/nginx.conf: -------------------------------------------------------------------------------- 1 | user nginx; 2 | worker_processes auto; 3 | 4 | error_log /var/log/nginx/error.log notice; 5 | pid /var/run/nginx.pid; 6 | 7 | 8 | events { 9 | worker_connections 1024; 10 | } 11 | 12 | 13 | http { 14 | include /etc/nginx/mime.types; 15 | default_type application/octet-stream; 16 | 17 | log_format main '$remote_addr - $remote_user [$time_local] "$request" ' 18 | '$status $body_bytes_sent "$http_referer" ' 19 | '"$http_user_agent" "$http_x_forwarded_for"'; 20 | 21 | access_log /var/log/nginx/access.log main; 22 | 23 | sendfile on; 24 | #tcp_nopush on; 25 | 26 | keepalive_timeout 65; 27 | 28 | #gzip on; 29 | 30 | include /etc/nginx/conf.d/*.conf; 31 | } -------------------------------------------------------------------------------- /nginx/sites/thinkphp.conf: -------------------------------------------------------------------------------- 1 | server { 2 | 3 | listen 80; 4 | 5 | server_name thinkphp.local; 6 | root /var/www/thinkphp/public; 7 | 8 | index index.php index.html index.htm; 9 | 10 | location / { 11 | if (!-e $request_filename) { 12 | rewrite ^(.*)$ /index.php?s=/$1 last; 13 | } 14 | } 15 | 16 | location ~ \.php$ { 17 | fastcgi_pass php-fpm:9000; 18 | fastcgi_index index.php; 19 | fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; 20 | include fastcgi_params; 21 | } 22 | 23 | location ~ /\.ht { 24 | # deny all; 25 | } 26 | 27 | location ~ ^(.*)\/\.svn\/ { 28 | # deny all; 29 | } 30 | 31 | location ~ /\.(svn|git) { 32 | # deny all; 33 | } 34 | 35 | } -------------------------------------------------------------------------------- /nginx/sites/yii.conf: -------------------------------------------------------------------------------- 1 | server { 2 | 3 | listen 80; 4 | 5 | server_name yii.local; 6 | root /var/www/yii; 7 | 8 | index index.php index.html index.htm; 9 | 10 | location / { 11 | if (!-e $request_filename){ 12 | rewrite ^/(.*)/web/(.*) /$1/web/index.php last; 13 | } 14 | } 15 | 16 | location ~ \.php$ { 17 | fastcgi_pass php-fpm:9000; 18 | fastcgi_index index.php; 19 | fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; 20 | include fastcgi_params; 21 | } 22 | 23 | location ~ ^/(environments|vendor|console|common|console|tests|requirements\.php|composer\.lock|composer\.json|yii|init)/ { 24 | # deny all; 25 | } 26 | 27 | location ~ /\.ht { 28 | # deny all; 29 | } 30 | 31 | location ~ ^(.*)\/\.svn\/ { 32 | # deny all; 33 | } 34 | 35 | location ~ /\.(svn|git) { 36 | # deny all; 37 | } 38 | 39 | } -------------------------------------------------------------------------------- /docs/vhost.md: -------------------------------------------------------------------------------- 1 | # Nginx 配置虚拟主机 2 | 3 | 4 | ## 添加域名映射 5 | 6 | 宿主机 /etc/hosts 文件中添加域名映射,配置如下: 7 | ``` 8 | 127.0.0.1 laravel.local 9 | ``` 10 | 11 | 12 | ## 添加 server 配置 13 | 14 | 目录 docker-lnmp/nginx/sites 下新增 laravel.conf 文件,配置如下: 15 | ``` 16 | server { 17 | 18 | listen 80; 19 | 20 | server_name laravel.local; 21 | root /var/www/laravel/public; 22 | 23 | index index.php index.html index.htm; 24 | 25 | location / { 26 | try_files $uri $uri/ /index.php?$query_string; 27 | 28 | if (!-d $request_filename) { 29 | rewrite ^/(.+)/$ /$1 permanent; 30 | } 31 | 32 | if (!-e $request_filename) { 33 | rewrite ^/(.*)$ /index.php?/$1 last; 34 | break; 35 | } 36 | } 37 | 38 | location ~ \.php$ { 39 | fastcgi_pass php-fpm:9000; 40 | fastcgi_index index.php; 41 | fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; 42 | include fastcgi_params; 43 | } 44 | 45 | } 46 | ``` 47 | 48 | 49 | ## 3. 重启服务 50 | 51 | 参照基本命令。 52 | -------------------------------------------------------------------------------- /nginx/sites/default.conf: -------------------------------------------------------------------------------- 1 | server { 2 | 3 | listen 80; 4 | listen [::]:80; 5 | server_name localhost; 6 | 7 | #access_log /var/log/nginx/host.access.log main; 8 | 9 | location / { 10 | root /var/www; 11 | index index.php index.html index.htm; 12 | } 13 | 14 | #error_page 404 /404.html; 15 | 16 | # redirect server error pages to the static page /50x.html 17 | # 18 | error_page 500 502 503 504 /50x.html; 19 | location = /50x.html { 20 | root /var/www; 21 | } 22 | 23 | # proxy the PHP scripts to Apache listening on 127.0.0.1:80 24 | # 25 | #location ~ \.php$ { 26 | # proxy_pass http://127.0.0.1; 27 | #} 28 | 29 | # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 30 | location ~ \.php$ { 31 | root /var/www; 32 | fastcgi_index index.php; 33 | fastcgi_pass php-fpm:9000; 34 | include fastcgi_params; 35 | fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; 36 | fastcgi_param SCRIPT_NAME $fastcgi_script_name; 37 | fastcgi_param PHP_ADMIN_VALUE open_basedir=$document_root:/tmp/; 38 | } 39 | 40 | # deny access to .htaccess files, if Apache's document root 41 | # concurs with nginx's one 42 | # 43 | #location ~ /\.ht { 44 | # deny all; 45 | #} 46 | } -------------------------------------------------------------------------------- /docs/https.md: -------------------------------------------------------------------------------- 1 | # Nginx 配置 HTTPS 2 | 3 | Nginx 虚拟主机基本配置请参考 [Nginx 配置虚拟主机](vhost.md) 小节。 4 | 5 | 6 | ## 申请 SSL 证书 7 | 8 | 申请 SSL 证书的平台自选,本人将申请的证书命名如下: 9 | - laravel.local.pem 10 | - laravel.local.key 11 | 12 | 并将证书放到 docker-lnmp/nginx/ssl 目录下: 13 | ``` 14 | cp -i 你的目录/laravel.local.pem 你的目录/docker-lnmp/nginx/ssl/ 15 | cp -i 你的目录/laravel.local.key 你的目录/docker-lnmp/nginx/ssl/ 16 | ``` 17 | 18 | 19 | ## 添加 server 配置 20 | 21 | docker-lnmp/nginx/sites/laravel.conf 文件再添加一个 server 项,配置如下: 22 | ``` 23 | server { 24 | 25 | listen 443 ssl; 26 | 27 | server_name laravel.local; 28 | root /var/www/laravel/public; 29 | 30 | index index.php index.html index.htm; 31 | 32 | # 将证书放到 docker-lnmp/nginx/ssl 目录下,将下面的证书改成当前域名的,路径用下面的 33 | ssl_certificate /etc/nginx/ssl/laravel.local.pem; 34 | ssl_certificate_key /etc/nginx/ssl/laravel.local.key; 35 | ssl_session_timeout 5m; 36 | ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4; 37 | ssl_protocols TLSv1 TLSv1.1 TLSv1.2; 38 | ssl_prefer_server_ciphers on; 39 | 40 | location / { 41 | try_files $uri $uri/ /index.php?$query_string; 42 | 43 | if (!-d $request_filename) { 44 | rewrite ^/(.+)/$ /$1 permanent; 45 | } 46 | 47 | if (!-e $request_filename) { 48 | rewrite ^/(.*)$ /index.php?/$1 last; 49 | break; 50 | } 51 | } 52 | 53 | location ~ \.php$ { 54 | fastcgi_pass php-fpm:9000; 55 | fastcgi_index index.php; 56 | fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; 57 | include fastcgi_params; 58 | } 59 | 60 | } 61 | ``` 62 | 63 | 如需将 http 请求全部跳转至 https,监听 80 的 server 添加如下配置即可: 64 | ``` 65 | return 301 https://$server_name$request_uri; 66 | ``` 67 | 68 | ## 重启服务 69 | 70 | 参照基本命令。 71 | 72 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # 使用 Docker LNMP 部署 PHP 开发环境 2 | 3 | 4 | ## 项目简介 5 | 6 | Docker LNMP 是基于 docker-compose 开发的运行在 Docker 上的 LNMP 开发环境,包含 PHP、MySQL、Redis 等镜像并支持多版本切换,满足您的学习、开发和测试需求。 7 | 8 | 9 | ## 包含镜像 10 | 11 | Docker LNMP 包含以下镜像,每种镜像支持多个版本: 12 | 13 | - nginx 14 | - php-fpm (8.1 - 8.0 - 7.4 - 7.3 - 7.2 - 7.1 - 5.6) 15 | - mysql (8.0 - 5.7 - 5.6) 16 | - redis (7.0 - 6.0 - 5.0 - 4.0) 17 | - memcached (1.5.16 - 1.5 - 1) 18 | - mongo 19 | 20 | 其中: 21 | 22 | php-fpm 默认是 8.1 版本,如需使用其它版本,配置 `.env` 文件中 `PHP_VERSION` 即可; 23 | 24 | mysql 默认是 8.0 版本,如需使用其它版本,配置 `.env` 文件中 `MYSQL_VERSION` 即可; 25 | 26 | 27 | ## 下载使用 28 | 29 | Docker LNMP 默认将同级目录映射到 php-fpm 容器的工作目录,在项目的同级目录下载 Docker LNMP: 30 | ``` 31 | $ git clone https://github.com/yanlongma/docker-lnmp.git 32 | ``` 33 | 34 | 进入 docker-lnmp 目录,生成配置文件 `.env` 35 | ``` 36 | $ cd docker-lnmp 37 | $ cp env-example .env 38 | ``` 39 | 40 | 如需映射到其它目录,配置 `.env` 文件中 `WEB_ROOT_PATH` 即可。 41 | 42 | 43 | ## 启动服务 44 | 45 | 在 docker-lnmp 目录,启动服务,命令如下: 46 | ``` 47 | $ docker-compose up -d nginx 48 | Creating network "docker-lnmp_default" with the default driver 49 | Creating docker-lnmp_mysql_1 ... done 50 | Creating docker-lnmp_php-fpm_1 ... done 51 | Creating docker-lnmp_nginx_1 ... done 52 | ``` 53 | 54 | nginx 默认会启动 php-fpm 和 mysql 服务,如需启动其它服务请手动添加,可选服务有 mongo、redis、memcached。 55 | 56 | 启动成功后,在 docker-lnmp 同级目录新建 phpinfo.php 文件,浏览器访问 `http://localhost/phpinfo.php`,则可看到 phpinfo() 相关信息。 57 | 58 | 59 | ## 关闭服务 60 | 61 | 在 docker-lnmp 目录,关闭服务,命令如下: 62 | ``` 63 | $ docker-compose down 64 | ``` 65 | 66 | 67 | ## 构建服务 68 | 69 | 如修改 dockerfile 文件,需重新构建服务,如重新构建 php-fpm 命令如下: 70 | ``` 71 | $ docker-compose build php-fpm 72 | ``` 73 | 74 | 建议先关闭服务,构建完成再重启服务。 75 | 76 | 77 | ## 虚拟主机 78 | 79 | Nginx 虚拟主机相关配置请参考如下文档,配置完需重启服务,完整配置请参考 `nignx/sites/laravel.conf` 文件: 80 | - [Nginx 配置虚拟主机](./docs/vhost.md) 81 | - [Nginx 配置 HTTPS](./docs/https.md) 82 | 83 | 84 | ## License 85 | 86 | [MIT license](https://opensource.org/licenses/MIT) -------------------------------------------------------------------------------- /env-example: -------------------------------------------------------------------------------- 1 | 2 | ### Paths ################################################# 3 | 4 | WEB_ROOT_PATH=../ 5 | 6 | 7 | ### PHP Version ########################################### 8 | 9 | # support 8.1 - 8.0 - 7.4 - 7.3 - 7.2 - 7.1 - 5.6 10 | PHP_VERSION=8.1 11 | 12 | 13 | ### PHP Extensions ######################################## 14 | 15 | PHP_INSTALL_PCNTL=true 16 | PHP_INSTALL_OPCACHE=false 17 | PHP_INSTALL_ZIP=true 18 | 19 | # http://pecl.php.net/package/redis 20 | # support php8.0+ (5.3.6) 21 | # support php5.6+ (5.0.0 - 4.3.0 - 4.2.0 - 3.1.6) 22 | PHP_INSTALL_REDIS=true 23 | PHP_INSTALL_REDIS_VERSION=5.3.6 24 | 25 | # http://pecl.php.net/package/mongodb 26 | # support php5.6+ (1.5.5 - 1.5.4 - 1.5.3 - 1.4.4) 27 | PHP_INSTALL_MONGODB=false 28 | PHP_INSTALL_MONGODB_VERSION=1.5.4 29 | 30 | # http://pecl.php.net/package/memcached 31 | # support php7+ (3.1.3 - 3.1.2 - 3.1.1) 32 | # sopport php5.6 (2.2.0) 33 | PHP_INSTALL_MEMCACHED=false 34 | PHP_INSTALL_MEMCACHED_VERSION=3.1.2 35 | 36 | # http://pecl.php.net/package/swoole 37 | # support php7+ (4.3.5 - 4.2.13 - 4.1.2 - 2.2.0 - 2.1.3) 38 | # sopport php5.6 (2.0.11) 39 | PHP_INSTALL_SWOOLE=false 40 | PHP_INSTALL_SWOOLE_VERSION=4.2.13 41 | 42 | PHP_INSTALL_XUNSEARCH=false 43 | PHP_INSTALL_COMPOSER=true 44 | 45 | 46 | ### Mysql ########################################### 47 | 48 | # https://hub.docker.com/_/mysql 49 | # support 8.0 - 5.7 - 5.6 50 | # 8 系列版本需将 docker-compose.yml 文件中的 command: --default-authentication-plugin=mysql_native_password 注释打开 51 | # 5 系列版本需将 docker-compose.yml 文件中的 command: --default-authentication-plugin=mysql_native_password 注释 52 | MYSQL_VERSION=8.0 53 | MYSQL_PORT=3306 54 | MYSQL_ROOT_PASSWORD=123456 55 | 56 | 57 | ### Mongo ########################################### 58 | 59 | # https://hub.docker.com/_/mongo 60 | # support latest 61 | MONGO_VERSION=latest 62 | MONGO_PORT=27017 63 | MONGO_ROOT_USERNAME=root 64 | MONGO_ROOT_PASSWORD=123456 65 | 66 | 67 | ### Redis ########################################### 68 | 69 | # https://hub.docker.com/_/redis 70 | # support 7.0 - 6.0 - 5.0 - 4.0 71 | REDIS_VERSION=5.0 72 | REDIS_PORT=6379 73 | 74 | 75 | ### Memcached ####################################### 76 | 77 | # https://hub.docker.com/_/memcached 78 | # support 1.5.16 - 1.5 - 1 79 | MEMCACHED_VERSION=1.5.16 80 | MEMCACHED_PORT=11211 81 | 82 | -------------------------------------------------------------------------------- /docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: "3.0" 2 | 3 | services: 4 | 5 | nginx: 6 | container_name: lnmp-nginx 7 | build: 8 | context: ./nginx 9 | ports: 10 | - 80:80 11 | - 443:443 12 | volumes: 13 | - ./nginx/nginx.conf:/etc/nginx/nginx.conf 14 | - ./nginx/sites:/etc/nginx/conf.d 15 | - ./nginx/ssl:/etc/nginx/ssl 16 | - ${WEB_ROOT_PATH}:/var/www 17 | depends_on: 18 | - php-fpm 19 | - mysql 20 | 21 | php-fpm: 22 | container_name: lnmp-php-pfm 23 | build: 24 | context: ./php-fpm 25 | args: 26 | - PHP_VERSION=${PHP_VERSION} 27 | - INSTALL_PCNTL=${PHP_INSTALL_PCNTL} 28 | - INSTALL_OPCACHE=${PHP_INSTALL_OPCACHE} 29 | - INSTALL_ZIP=${PHP_INSTALL_ZIP} 30 | - INSTALL_REDIS=${PHP_INSTALL_REDIS} 31 | - INSTALL_REDIS_VERSION=${PHP_INSTALL_REDIS_VERSION} 32 | - INSTALL_MONGODB=${PHP_INSTALL_MONGODB} 33 | - INSTALL_MONGODB_VERSION=${PHP_INSTALL_MONGODB_VERSION} 34 | - INSTALL_MEMCACHED=${PHP_INSTALL_MEMCACHED} 35 | - INSTALL_MEMCACHED_VERSION=${PHP_INSTALL_MEMCACHED_VERSION} 36 | - INSTALL_SWOOLE=${PHP_INSTALL_SWOOLE} 37 | - INSTALL_SWOOLE_VERSION=${PHP_INSTALL_SWOOLE_VERSION} 38 | - INSTALL_XUNSEARCH=${PHP_INSTALL_XUNSEARCH} 39 | - INSTALL_COMPOSER=${PHP_INSTALL_COMPOSER} 40 | ports: 41 | - 9000:9000 42 | volumes: 43 | - ./php-fpm/conf-${PHP_VERSION}/php.ini:/usr/local/etc/php/php.ini 44 | - ./php-fpm/conf-${PHP_VERSION}/php-fpm.conf:/usr/local/etc/php-fpm.conf 45 | - ./php-fpm/conf-${PHP_VERSION}/php-fpm.d:/usr/local/etc/php-fpm.d 46 | - ${WEB_ROOT_PATH}:/var/www 47 | 48 | mysql: 49 | container_name: lnmp-mysql 50 | build: 51 | context: ./mysql 52 | args: 53 | - MYSQL_VERSION=${MYSQL_VERSION} 54 | ports: 55 | - ${MYSQL_PORT}:3306 56 | volumes: 57 | - ./mysql/data:/var/lib/mysql 58 | command: 59 | --default-authentication-plugin=mysql_native_password 60 | --max_allowed_packet=200M 61 | restart: always 62 | environment: 63 | - MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD} 64 | 65 | mongo: 66 | container_name: lnmp-mongo 67 | build: 68 | context: ./mongo 69 | args: 70 | - MONGO_VERSION=${MONGO_VERSION} 71 | ports: 72 | - ${MONGO_PORT}:27017 73 | volumes: 74 | - ./mongo/data:/data/db 75 | restart: always 76 | environment: 77 | MONGO_INITDB_ROOT_USERNAME: ${MONGO_ROOT_USERNAME} 78 | MONGO_INITDB_ROOT_PASSWORD: ${MONGO_ROOT_PASSWORD} 79 | 80 | redis: 81 | container_name: lnmp-redis 82 | build: 83 | context: ./redis 84 | args: 85 | - REDIS_VERSION=${REDIS_VERSION} 86 | ports: 87 | - ${REDIS_PORT}:6379 88 | volumes: 89 | - ./redis/data:/data 90 | restart: always 91 | 92 | memcached: 93 | container_name: lnmp-memcached 94 | build: 95 | context: ./memcached 96 | args: 97 | - MEMCACHED_VERSION=${MEMCACHED_VERSION} 98 | ports: 99 | - ${MEMCACHED_PORT}:11211 -------------------------------------------------------------------------------- /nginx/sites/laravel.conf: -------------------------------------------------------------------------------- 1 | server { 2 | 3 | listen 80; 4 | 5 | server_name laravel.local; 6 | root /var/www/laravel/public; 7 | 8 | index index.php index.html index.htm; 9 | 10 | # 强制跳转 https 11 | # return 301 https://$server_name$request_uri; 12 | 13 | location / { 14 | try_files $uri $uri/ /index.php?$query_string; 15 | 16 | if (!-d $request_filename) { 17 | rewrite ^/(.+)/$ /$1 permanent; 18 | } 19 | 20 | if (!-e $request_filename) { 21 | rewrite ^/(.*)$ /index.php?/$1 last; 22 | break; 23 | } 24 | } 25 | 26 | location = /50x.html { 27 | root html; 28 | } 29 | 30 | location ~ \.php$ { 31 | fastcgi_pass php-fpm:9000; 32 | fastcgi_index index.php; 33 | fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; 34 | include fastcgi_params; 35 | } 36 | 37 | location ~ /\.ht { 38 | # deny all; 39 | } 40 | 41 | location ~ ^(.*)\/\.svn\/ { 42 | # deny all; 43 | } 44 | 45 | location ~ /\.(svn|git) { 46 | # deny all; 47 | } 48 | 49 | } 50 | 51 | # server { 52 | # 53 | # listen 443 ssl; 54 | # 55 | # server_name laravel.local; 56 | # root /var/www/laravel/public; 57 | # 58 | # index index.php index.html index.htm; 59 | # 60 | # # 将秘钥放到 docker-lnmp/nginx/ssl 目录下,将下面的秘钥改成当前域名的(有证书了把下面两行打开) 61 | # # ssl_certificate /etc/nginx/ssl/laravel.local.pem; 62 | # # ssl_certificate_key /etc/nginx/ssl/laravel.local.key; 63 | # ssl_session_timeout 5m; 64 | # ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4; 65 | # ssl_protocols TLSv1 TLSv1.1 TLSv1.2; 66 | # ssl_prefer_server_ciphers on; 67 | # 68 | # location / { 69 | # try_files $uri $uri/ /index.php?$query_string; 70 | # 71 | # if (!-d $request_filename) { 72 | # rewrite ^/(.+)/$ /$1 permanent; 73 | # } 74 | # 75 | # if (!-e $request_filename) { 76 | # rewrite ^/(.*)$ /index.php?/$1 last; 77 | # break; 78 | # } 79 | # } 80 | # 81 | # location = /50x.html { 82 | # root html; 83 | # } 84 | # 85 | # location ~ \.php$ { 86 | # fastcgi_pass php-fpm:9000; 87 | # fastcgi_index index.php; 88 | # fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; 89 | # include fastcgi_params; 90 | # } 91 | # 92 | # location ~ /\.ht { 93 | # # deny all; 94 | # } 95 | # 96 | # location ~ ^(.*)\/\.svn\/ { 97 | # # deny all; 98 | # } 99 | # 100 | # location ~ /\.(svn|git) { 101 | # # deny all; 102 | # } 103 | # 104 | # location ~ /\.(svn|git) { 105 | # # deny all; 106 | # } 107 | # 108 | # } -------------------------------------------------------------------------------- /php-fpm/conf-7.1/php-fpm.conf: -------------------------------------------------------------------------------- 1 | ;;;;;;;;;;;;;;;;;;;;; 2 | ; FPM Configuration ; 3 | ;;;;;;;;;;;;;;;;;;;;; 4 | 5 | ; All relative paths in this configuration file are relative to PHP's install 6 | ; prefix (/usr/local). This prefix can be dynamically changed by using the 7 | ; '-p' argument from the command line. 8 | 9 | ;;;;;;;;;;;;;;;;;; 10 | ; Global Options ; 11 | ;;;;;;;;;;;;;;;;;; 12 | 13 | [global] 14 | ; Pid file 15 | ; Note: the default prefix is /usr/local/var 16 | ; Default Value: none 17 | ;pid = run/php-fpm.pid 18 | 19 | ; Error log file 20 | ; If it's set to "syslog", log is sent to syslogd instead of being written 21 | ; into a local file. 22 | ; Note: the default prefix is /usr/local/var 23 | ; Default Value: log/php-fpm.log 24 | ;error_log = log/php-fpm.log 25 | 26 | ; syslog_facility is used to specify what type of program is logging the 27 | ; message. This lets syslogd specify that messages from different facilities 28 | ; will be handled differently. 29 | ; See syslog(3) for possible values (ex daemon equiv LOG_DAEMON) 30 | ; Default Value: daemon 31 | ;syslog.facility = daemon 32 | 33 | ; syslog_ident is prepended to every message. If you have multiple FPM 34 | ; instances running on the same server, you can change the default value 35 | ; which must suit common needs. 36 | ; Default Value: php-fpm 37 | ;syslog.ident = php-fpm 38 | 39 | ; Log level 40 | ; Possible Values: alert, error, warning, notice, debug 41 | ; Default Value: notice 42 | ;log_level = notice 43 | 44 | ; If this number of child processes exit with SIGSEGV or SIGBUS within the time 45 | ; interval set by emergency_restart_interval then FPM will restart. A value 46 | ; of '0' means 'Off'. 47 | ; Default Value: 0 48 | ;emergency_restart_threshold = 0 49 | 50 | ; Interval of time used by emergency_restart_interval to determine when 51 | ; a graceful restart will be initiated. This can be useful to work around 52 | ; accidental corruptions in an accelerator's shared memory. 53 | ; Available Units: s(econds), m(inutes), h(ours), or d(ays) 54 | ; Default Unit: seconds 55 | ; Default Value: 0 56 | ;emergency_restart_interval = 0 57 | 58 | ; Time limit for child processes to wait for a reaction on signals from master. 59 | ; Available units: s(econds), m(inutes), h(ours), or d(ays) 60 | ; Default Unit: seconds 61 | ; Default Value: 0 62 | ;process_control_timeout = 0 63 | 64 | ; The maximum number of processes FPM will fork. This has been designed to control 65 | ; the global number of processes when using dynamic PM within a lot of pools. 66 | ; Use it with caution. 67 | ; Note: A value of 0 indicates no limit 68 | ; Default Value: 0 69 | ; process.max = 128 70 | 71 | ; Specify the nice(2) priority to apply to the master process (only if set) 72 | ; The value can vary from -19 (highest priority) to 20 (lowest priority) 73 | ; Note: - It will only work if the FPM master process is launched as root 74 | ; - The pool process will inherit the master process priority 75 | ; unless specified otherwise 76 | ; Default Value: no set 77 | ; process.priority = -19 78 | 79 | ; Send FPM to background. Set to 'no' to keep FPM in foreground for debugging. 80 | ; Default Value: yes 81 | ;daemonize = yes 82 | 83 | ; Set open file descriptor rlimit for the master process. 84 | ; Default Value: system defined value 85 | ;rlimit_files = 1024 86 | 87 | ; Set max core size rlimit for the master process. 88 | ; Possible Values: 'unlimited' or an integer greater or equal to 0 89 | ; Default Value: system defined value 90 | ;rlimit_core = 0 91 | 92 | ; Specify the event mechanism FPM will use. The following is available: 93 | ; - select (any POSIX os) 94 | ; - poll (any POSIX os) 95 | ; - epoll (linux >= 2.5.44) 96 | ; - kqueue (FreeBSD >= 4.1, OpenBSD >= 2.9, NetBSD >= 2.0) 97 | ; - /dev/poll (Solaris >= 7) 98 | ; - port (Solaris >= 10) 99 | ; Default Value: not set (auto detection) 100 | ;events.mechanism = epoll 101 | 102 | ; When FPM is built with systemd integration, specify the interval, 103 | ; in seconds, between health report notification to systemd. 104 | ; Set to 0 to disable. 105 | ; Available Units: s(econds), m(inutes), h(ours) 106 | ; Default Unit: seconds 107 | ; Default value: 10 108 | ;systemd_interval = 10 109 | 110 | ;;;;;;;;;;;;;;;;;;;; 111 | ; Pool Definitions ; 112 | ;;;;;;;;;;;;;;;;;;;; 113 | 114 | ; Multiple pools of child processes may be started with different listening 115 | ; ports and different management options. The name of the pool will be 116 | ; used in logs and stats. There is no limitation on the number of pools which 117 | ; FPM can handle. Your system will tell you anyway :) 118 | 119 | ; Include one or more files. If glob(3) exists, it is used to include a bunch of 120 | ; files from a glob(3) pattern. This directive can be used everywhere in the 121 | ; file. 122 | ; Relative path can also be used. They will be prefixed by: 123 | ; - the global prefix if it's been set (-p argument) 124 | ; - /usr/local otherwise 125 | include=etc/php-fpm.d/*.conf 126 | -------------------------------------------------------------------------------- /php-fpm/conf-7.2/php-fpm.conf: -------------------------------------------------------------------------------- 1 | ;;;;;;;;;;;;;;;;;;;;; 2 | ; FPM Configuration ; 3 | ;;;;;;;;;;;;;;;;;;;;; 4 | 5 | ; All relative paths in this configuration file are relative to PHP's install 6 | ; prefix (/usr/local). This prefix can be dynamically changed by using the 7 | ; '-p' argument from the command line. 8 | 9 | ;;;;;;;;;;;;;;;;;; 10 | ; Global Options ; 11 | ;;;;;;;;;;;;;;;;;; 12 | 13 | [global] 14 | ; Pid file 15 | ; Note: the default prefix is /usr/local/var 16 | ; Default Value: none 17 | ;pid = run/php-fpm.pid 18 | 19 | ; Error log file 20 | ; If it's set to "syslog", log is sent to syslogd instead of being written 21 | ; into a local file. 22 | ; Note: the default prefix is /usr/local/var 23 | ; Default Value: log/php-fpm.log 24 | ;error_log = log/php-fpm.log 25 | 26 | ; syslog_facility is used to specify what type of program is logging the 27 | ; message. This lets syslogd specify that messages from different facilities 28 | ; will be handled differently. 29 | ; See syslog(3) for possible values (ex daemon equiv LOG_DAEMON) 30 | ; Default Value: daemon 31 | ;syslog.facility = daemon 32 | 33 | ; syslog_ident is prepended to every message. If you have multiple FPM 34 | ; instances running on the same server, you can change the default value 35 | ; which must suit common needs. 36 | ; Default Value: php-fpm 37 | ;syslog.ident = php-fpm 38 | 39 | ; Log level 40 | ; Possible Values: alert, error, warning, notice, debug 41 | ; Default Value: notice 42 | ;log_level = notice 43 | 44 | ; If this number of child processes exit with SIGSEGV or SIGBUS within the time 45 | ; interval set by emergency_restart_interval then FPM will restart. A value 46 | ; of '0' means 'Off'. 47 | ; Default Value: 0 48 | ;emergency_restart_threshold = 0 49 | 50 | ; Interval of time used by emergency_restart_interval to determine when 51 | ; a graceful restart will be initiated. This can be useful to work around 52 | ; accidental corruptions in an accelerator's shared memory. 53 | ; Available Units: s(econds), m(inutes), h(ours), or d(ays) 54 | ; Default Unit: seconds 55 | ; Default Value: 0 56 | ;emergency_restart_interval = 0 57 | 58 | ; Time limit for child processes to wait for a reaction on signals from master. 59 | ; Available units: s(econds), m(inutes), h(ours), or d(ays) 60 | ; Default Unit: seconds 61 | ; Default Value: 0 62 | ;process_control_timeout = 0 63 | 64 | ; The maximum number of processes FPM will fork. This has been designed to control 65 | ; the global number of processes when using dynamic PM within a lot of pools. 66 | ; Use it with caution. 67 | ; Note: A value of 0 indicates no limit 68 | ; Default Value: 0 69 | ; process.max = 128 70 | 71 | ; Specify the nice(2) priority to apply to the master process (only if set) 72 | ; The value can vary from -19 (highest priority) to 20 (lowest priority) 73 | ; Note: - It will only work if the FPM master process is launched as root 74 | ; - The pool process will inherit the master process priority 75 | ; unless specified otherwise 76 | ; Default Value: no set 77 | ; process.priority = -19 78 | 79 | ; Send FPM to background. Set to 'no' to keep FPM in foreground for debugging. 80 | ; Default Value: yes 81 | ;daemonize = yes 82 | 83 | ; Set open file descriptor rlimit for the master process. 84 | ; Default Value: system defined value 85 | ;rlimit_files = 1024 86 | 87 | ; Set max core size rlimit for the master process. 88 | ; Possible Values: 'unlimited' or an integer greater or equal to 0 89 | ; Default Value: system defined value 90 | ;rlimit_core = 0 91 | 92 | ; Specify the event mechanism FPM will use. The following is available: 93 | ; - select (any POSIX os) 94 | ; - poll (any POSIX os) 95 | ; - epoll (linux >= 2.5.44) 96 | ; - kqueue (FreeBSD >= 4.1, OpenBSD >= 2.9, NetBSD >= 2.0) 97 | ; - /dev/poll (Solaris >= 7) 98 | ; - port (Solaris >= 10) 99 | ; Default Value: not set (auto detection) 100 | ;events.mechanism = epoll 101 | 102 | ; When FPM is built with systemd integration, specify the interval, 103 | ; in seconds, between health report notification to systemd. 104 | ; Set to 0 to disable. 105 | ; Available Units: s(econds), m(inutes), h(ours) 106 | ; Default Unit: seconds 107 | ; Default value: 10 108 | ;systemd_interval = 10 109 | 110 | ;;;;;;;;;;;;;;;;;;;; 111 | ; Pool Definitions ; 112 | ;;;;;;;;;;;;;;;;;;;; 113 | 114 | ; Multiple pools of child processes may be started with different listening 115 | ; ports and different management options. The name of the pool will be 116 | ; used in logs and stats. There is no limitation on the number of pools which 117 | ; FPM can handle. Your system will tell you anyway :) 118 | 119 | ; Include one or more files. If glob(3) exists, it is used to include a bunch of 120 | ; files from a glob(3) pattern. This directive can be used everywhere in the 121 | ; file. 122 | ; Relative path can also be used. They will be prefixed by: 123 | ; - the global prefix if it's been set (-p argument) 124 | ; - /usr/local otherwise 125 | include=etc/php-fpm.d/*.conf 126 | -------------------------------------------------------------------------------- /php-fpm/Dockerfile: -------------------------------------------------------------------------------- 1 | ########################################################################### 2 | # PHP-FPM Version Of Alpine: 3 | ########################################################################### 4 | 5 | ARG PHP_VERSION 6 | FROM php:${PHP_VERSION}-fpm-alpine 7 | 8 | LABEL maintainer="YanlongMa " 9 | 10 | 11 | ########################################################################### 12 | # Alpine Aliyun Mirrors: 13 | ########################################################################### 14 | 15 | RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories 16 | 17 | 18 | ########################################################################### 19 | # System Extensions: 20 | ########################################################################### 21 | 22 | RUN apk --update add \ 23 | autoconf \ 24 | build-base \ 25 | linux-headers \ 26 | libaio-dev \ 27 | zlib-dev \ 28 | curl \ 29 | git \ 30 | freetype-dev \ 31 | libjpeg-turbo-dev \ 32 | libmcrypt-dev \ 33 | libpng-dev \ 34 | libtool \ 35 | libbz2 \ 36 | bzip2 \ 37 | bzip2-dev \ 38 | libstdc++ \ 39 | libxslt-dev \ 40 | openldap-dev \ 41 | imagemagick-dev \ 42 | libzip-dev \ 43 | make \ 44 | zip \ 45 | unzip \ 46 | wget \ 47 | libmemcached-dev 48 | 49 | 50 | ########################################################################### 51 | # PHP Core Extensions: 52 | ########################################################################### 53 | 54 | # Core Extensions For Default Installation: 55 | #RUN docker-php-ext-install \ 56 | # bcmath \ 57 | # pdo_mysql \ 58 | # mysqli \ 59 | # sockets \ 60 | # && docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ \ 61 | # && docker-php-ext-install gd 62 | RUN docker-php-ext-install \ 63 | bcmath \ 64 | pdo_mysql \ 65 | mysqli \ 66 | sockets \ 67 | && docker-php-ext-configure gd --with-freetype --with-jpeg \ 68 | && docker-php-ext-install -j$(nproc) gd 69 | 70 | 71 | # Core Extensions pcntl: 72 | ARG INSTALL_PCNTL=false 73 | RUN if [ ${INSTALL_PCNTL} = true ]; then \ 74 | docker-php-ext-install pcntl \ 75 | ;fi 76 | 77 | 78 | # Core Extensions opcache: 79 | ARG INSTALL_OPCACHE=false 80 | RUN if [ ${INSTALL_OPCACHE} = true ]; then \ 81 | docker-php-ext-install opcache \ 82 | ;fi 83 | 84 | 85 | # Core Extensions zip: 86 | ARG INSTALL_ZIP=false 87 | RUN if [ ${INSTALL_ZIP} = true ]; then \ 88 | if [ ${PHP_VERSION} = "7.3" ] || [ ${PHP_VERSION} = "7.4" ]; then \ 89 | docker-php-ext-configure zip \ 90 | else \ 91 | docker-php-ext-configure zip --with-libzip \ 92 | ;fi \ 93 | && docker-php-ext-install zip \ 94 | ;fi 95 | 96 | 97 | ########################################################################### 98 | # PHP PECL Extensions: 99 | ########################################################################### 100 | 101 | # PECL Extensions reids: 102 | ARG INSTALL_REDIS=false 103 | ARG INSTALL_REDIS_VERSION 104 | RUN if [ ${INSTALL_REDIS} = true ]; then \ 105 | pecl install redis-${INSTALL_REDIS_VERSION} \ 106 | && rm -rf /tmp/pear \ 107 | && docker-php-ext-enable redis \ 108 | ;fi 109 | 110 | 111 | # PECL Extensions mongodb: 112 | ARG INSTALL_MONGODB=false 113 | ARG INSTALL_MONGODB_VERSION 114 | RUN if [ ${INSTALL_MONGODB} = true ]; then \ 115 | pecl install mongodb-${INSTALL_MONGODB_VERSION} \ 116 | && rm -rf /tmp/pear \ 117 | && docker-php-ext-enable mongodb \ 118 | ;fi 119 | 120 | 121 | # PECL Extensions memcached: 122 | ARG INSTALL_MEMCACHED=false 123 | ARG INSTALL_MEMCACHED_VERSION 124 | RUN if [ ${INSTALL_MEMCACHED} = true ]; then \ 125 | pecl install memcached-${INSTALL_MEMCACHED_VERSION} \ 126 | && rm -rf /tmp/pear \ 127 | && docker-php-ext-enable memcached \ 128 | ;fi 129 | 130 | 131 | # PECL Extensions swoole: 132 | ARG INSTALL_SWOOLE=false 133 | ARG INSTALL_SWOOLE_VERSION 134 | RUN if [ ${INSTALL_SWOOLE} = true ]; then \ 135 | pecl install swoole-${INSTALL_SWOOLE_VERSION} \ 136 | && rm -rf /tmp/pear \ 137 | && docker-php-ext-enable swoole \ 138 | ;fi 139 | 140 | 141 | ########################################################################### 142 | # PHP Thrid Extensions: 143 | ########################################################################### 144 | 145 | # Thrid Extensions Xunsearch: 146 | ARG INSTALL_XUNSEARCH=false 147 | RUN if [ ${INSTALL_XUNSEARCH} = true ]; then \ 148 | curl 'http://www.xunsearch.com/scws/down/scws-1.2.3.tar.bz2' -o scws.tar.bz2 \ 149 | && tar xvjf scws.tar.bz2 \ 150 | && cd scws-1.2.3 \ 151 | && ./configure --prefix=/usr/local/scws \ 152 | && make \ 153 | && make install \ 154 | && cd phpext \ 155 | && phpize \ 156 | && ./configure --with-scws=/usr/local/scws \ 157 | && make \ 158 | && make install \ 159 | && cd ../../ \ 160 | && rm -rf scws scws-1.2.3.tar.bz2 \ 161 | && docker-php-ext-enable scws \ 162 | && echo "scws.default.charset = utf8" >> /usr/local/etc/php/conf.d/docker-php-ext-scws.ini \ 163 | && echo "scws.default.fpath = /usr/local/scws/etc" >> /usr/local/etc/php/conf.d/docker-php-ext-scws.ini \ 164 | ;fi 165 | 166 | 167 | # Composer: 168 | ARG INSTALL_COMPOSER=false 169 | RUN if [ ${INSTALL_COMPOSER} = true ]; then \ 170 | curl -sS http://getcomposer.org/installer | php \ 171 | && mv ./composer.phar /usr/local/bin/composer \ 172 | && composer config -g repo.packagist composer https://mirrors.aliyun.com/composer \ 173 | ;fi 174 | 175 | RUN apk del build-base \ 176 | linux-headers \ 177 | libaio-dev \ 178 | && rm -rf /var/cache/apk/* 179 | 180 | 181 | VOLUME /var/www 182 | WORKDIR /var/www 183 | 184 | 185 | EXPOSE 9000 186 | CMD ["php-fpm"] -------------------------------------------------------------------------------- /php-fpm/conf-7.3/php-fpm.conf: -------------------------------------------------------------------------------- 1 | ;;;;;;;;;;;;;;;;;;;;; 2 | ; FPM Configuration ; 3 | ;;;;;;;;;;;;;;;;;;;;; 4 | 5 | ; All relative paths in this configuration file are relative to PHP's install 6 | ; prefix (/usr/local). This prefix can be dynamically changed by using the 7 | ; '-p' argument from the command line. 8 | 9 | ;;;;;;;;;;;;;;;;;; 10 | ; Global Options ; 11 | ;;;;;;;;;;;;;;;;;; 12 | 13 | [global] 14 | ; Pid file 15 | ; Note: the default prefix is /usr/local/var 16 | ; Default Value: none 17 | ;pid = run/php-fpm.pid 18 | 19 | ; Error log file 20 | ; If it's set to "syslog", log is sent to syslogd instead of being written 21 | ; into a local file. 22 | ; Note: the default prefix is /usr/local/var 23 | ; Default Value: log/php-fpm.log 24 | ;error_log = log/php-fpm.log 25 | 26 | ; syslog_facility is used to specify what type of program is logging the 27 | ; message. This lets syslogd specify that messages from different facilities 28 | ; will be handled differently. 29 | ; See syslog(3) for possible values (ex daemon equiv LOG_DAEMON) 30 | ; Default Value: daemon 31 | ;syslog.facility = daemon 32 | 33 | ; syslog_ident is prepended to every message. If you have multiple FPM 34 | ; instances running on the same server, you can change the default value 35 | ; which must suit common needs. 36 | ; Default Value: php-fpm 37 | ;syslog.ident = php-fpm 38 | 39 | ; Log level 40 | ; Possible Values: alert, error, warning, notice, debug 41 | ; Default Value: notice 42 | ;log_level = notice 43 | 44 | ; Log limit on number of characters in the single line (log entry). If the 45 | ; line is over the limit, it is wrapped on multiple lines. The limit is for 46 | ; all logged characters including message prefix and suffix if present. However 47 | ; the new line character does not count into it as it is present only when 48 | ; logging to a file descriptor. It means the new line character is not present 49 | ; when logging to syslog. 50 | ; Default Value: 1024 51 | ;log_limit = 4096 52 | 53 | ; Log buffering specifies if the log line is buffered which means that the 54 | ; line is written in a single write operation. If the value is false, then the 55 | ; data is written directly into the file descriptor. It is an experimental 56 | ; option that can potentionaly improve logging performance and memory usage 57 | ; for some heavy logging scenarios. This option is ignored if logging to syslog 58 | ; as it has to be always buffered. 59 | ; Default value: yes 60 | ;log_buffering = no 61 | 62 | ; If this number of child processes exit with SIGSEGV or SIGBUS within the time 63 | ; interval set by emergency_restart_interval then FPM will restart. A value 64 | ; of '0' means 'Off'. 65 | ; Default Value: 0 66 | ;emergency_restart_threshold = 0 67 | 68 | ; Interval of time used by emergency_restart_interval to determine when 69 | ; a graceful restart will be initiated. This can be useful to work around 70 | ; accidental corruptions in an accelerator's shared memory. 71 | ; Available Units: s(econds), m(inutes), h(ours), or d(ays) 72 | ; Default Unit: seconds 73 | ; Default Value: 0 74 | ;emergency_restart_interval = 0 75 | 76 | ; Time limit for child processes to wait for a reaction on signals from master. 77 | ; Available units: s(econds), m(inutes), h(ours), or d(ays) 78 | ; Default Unit: seconds 79 | ; Default Value: 0 80 | ;process_control_timeout = 0 81 | 82 | ; The maximum number of processes FPM will fork. This has been designed to control 83 | ; the global number of processes when using dynamic PM within a lot of pools. 84 | ; Use it with caution. 85 | ; Note: A value of 0 indicates no limit 86 | ; Default Value: 0 87 | ; process.max = 128 88 | 89 | ; Specify the nice(2) priority to apply to the master process (only if set) 90 | ; The value can vary from -19 (highest priority) to 20 (lowest priority) 91 | ; Note: - It will only work if the FPM master process is launched as root 92 | ; - The pool process will inherit the master process priority 93 | ; unless specified otherwise 94 | ; Default Value: no set 95 | ; process.priority = -19 96 | 97 | ; Send FPM to background. Set to 'no' to keep FPM in foreground for debugging. 98 | ; Default Value: yes 99 | ;daemonize = yes 100 | 101 | ; Set open file descriptor rlimit for the master process. 102 | ; Default Value: system defined value 103 | ;rlimit_files = 1024 104 | 105 | ; Set max core size rlimit for the master process. 106 | ; Possible Values: 'unlimited' or an integer greater or equal to 0 107 | ; Default Value: system defined value 108 | ;rlimit_core = 0 109 | 110 | ; Specify the event mechanism FPM will use. The following is available: 111 | ; - select (any POSIX os) 112 | ; - poll (any POSIX os) 113 | ; - epoll (linux >= 2.5.44) 114 | ; - kqueue (FreeBSD >= 4.1, OpenBSD >= 2.9, NetBSD >= 2.0) 115 | ; - /dev/poll (Solaris >= 7) 116 | ; - port (Solaris >= 10) 117 | ; Default Value: not set (auto detection) 118 | ;events.mechanism = epoll 119 | 120 | ; When FPM is built with systemd integration, specify the interval, 121 | ; in seconds, between health report notification to systemd. 122 | ; Set to 0 to disable. 123 | ; Available Units: s(econds), m(inutes), h(ours) 124 | ; Default Unit: seconds 125 | ; Default value: 10 126 | ;systemd_interval = 10 127 | 128 | ;;;;;;;;;;;;;;;;;;;; 129 | ; Pool Definitions ; 130 | ;;;;;;;;;;;;;;;;;;;; 131 | 132 | ; Multiple pools of child processes may be started with different listening 133 | ; ports and different management options. The name of the pool will be 134 | ; used in logs and stats. There is no limitation on the number of pools which 135 | ; FPM can handle. Your system will tell you anyway :) 136 | 137 | ; Include one or more files. If glob(3) exists, it is used to include a bunch of 138 | ; files from a glob(3) pattern. This directive can be used everywhere in the 139 | ; file. 140 | ; Relative path can also be used. They will be prefixed by: 141 | ; - the global prefix if it's been set (-p argument) 142 | ; - /usr/local otherwise 143 | include=etc/php-fpm.d/*.conf 144 | -------------------------------------------------------------------------------- /php-fpm/conf-7.4/php-fpm.conf: -------------------------------------------------------------------------------- 1 | ;;;;;;;;;;;;;;;;;;;;; 2 | ; FPM Configuration ; 3 | ;;;;;;;;;;;;;;;;;;;;; 4 | 5 | ; All relative paths in this configuration file are relative to PHP's install 6 | ; prefix (/usr/local). This prefix can be dynamically changed by using the 7 | ; '-p' argument from the command line. 8 | 9 | ;;;;;;;;;;;;;;;;;; 10 | ; Global Options ; 11 | ;;;;;;;;;;;;;;;;;; 12 | 13 | [global] 14 | ; Pid file 15 | ; Note: the default prefix is /usr/local/var 16 | ; Default Value: none 17 | ;pid = run/php-fpm.pid 18 | 19 | ; Error log file 20 | ; If it's set to "syslog", log is sent to syslogd instead of being written 21 | ; into a local file. 22 | ; Note: the default prefix is /usr/local/var 23 | ; Default Value: log/php-fpm.log 24 | ;error_log = log/php-fpm.log 25 | 26 | ; syslog_facility is used to specify what type of program is logging the 27 | ; message. This lets syslogd specify that messages from different facilities 28 | ; will be handled differently. 29 | ; See syslog(3) for possible values (ex daemon equiv LOG_DAEMON) 30 | ; Default Value: daemon 31 | ;syslog.facility = daemon 32 | 33 | ; syslog_ident is prepended to every message. If you have multiple FPM 34 | ; instances running on the same server, you can change the default value 35 | ; which must suit common needs. 36 | ; Default Value: php-fpm 37 | ;syslog.ident = php-fpm 38 | 39 | ; Log level 40 | ; Possible Values: alert, error, warning, notice, debug 41 | ; Default Value: notice 42 | ;log_level = notice 43 | 44 | ; Log limit on number of characters in the single line (log entry). If the 45 | ; line is over the limit, it is wrapped on multiple lines. The limit is for 46 | ; all logged characters including message prefix and suffix if present. However 47 | ; the new line character does not count into it as it is present only when 48 | ; logging to a file descriptor. It means the new line character is not present 49 | ; when logging to syslog. 50 | ; Default Value: 1024 51 | ;log_limit = 4096 52 | 53 | ; Log buffering specifies if the log line is buffered which means that the 54 | ; line is written in a single write operation. If the value is false, then the 55 | ; data is written directly into the file descriptor. It is an experimental 56 | ; option that can potentionaly improve logging performance and memory usage 57 | ; for some heavy logging scenarios. This option is ignored if logging to syslog 58 | ; as it has to be always buffered. 59 | ; Default value: yes 60 | ;log_buffering = no 61 | 62 | ; If this number of child processes exit with SIGSEGV or SIGBUS within the time 63 | ; interval set by emergency_restart_interval then FPM will restart. A value 64 | ; of '0' means 'Off'. 65 | ; Default Value: 0 66 | ;emergency_restart_threshold = 0 67 | 68 | ; Interval of time used by emergency_restart_interval to determine when 69 | ; a graceful restart will be initiated. This can be useful to work around 70 | ; accidental corruptions in an accelerator's shared memory. 71 | ; Available Units: s(econds), m(inutes), h(ours), or d(ays) 72 | ; Default Unit: seconds 73 | ; Default Value: 0 74 | ;emergency_restart_interval = 0 75 | 76 | ; Time limit for child processes to wait for a reaction on signals from master. 77 | ; Available units: s(econds), m(inutes), h(ours), or d(ays) 78 | ; Default Unit: seconds 79 | ; Default Value: 0 80 | ;process_control_timeout = 0 81 | 82 | ; The maximum number of processes FPM will fork. This has been designed to control 83 | ; the global number of processes when using dynamic PM within a lot of pools. 84 | ; Use it with caution. 85 | ; Note: A value of 0 indicates no limit 86 | ; Default Value: 0 87 | ; process.max = 128 88 | 89 | ; Specify the nice(2) priority to apply to the master process (only if set) 90 | ; The value can vary from -19 (highest priority) to 20 (lowest priority) 91 | ; Note: - It will only work if the FPM master process is launched as root 92 | ; - The pool process will inherit the master process priority 93 | ; unless specified otherwise 94 | ; Default Value: no set 95 | ; process.priority = -19 96 | 97 | ; Send FPM to background. Set to 'no' to keep FPM in foreground for debugging. 98 | ; Default Value: yes 99 | ;daemonize = yes 100 | 101 | ; Set open file descriptor rlimit for the master process. 102 | ; Default Value: system defined value 103 | ;rlimit_files = 1024 104 | 105 | ; Set max core size rlimit for the master process. 106 | ; Possible Values: 'unlimited' or an integer greater or equal to 0 107 | ; Default Value: system defined value 108 | ;rlimit_core = 0 109 | 110 | ; Specify the event mechanism FPM will use. The following is available: 111 | ; - select (any POSIX os) 112 | ; - poll (any POSIX os) 113 | ; - epoll (linux >= 2.5.44) 114 | ; - kqueue (FreeBSD >= 4.1, OpenBSD >= 2.9, NetBSD >= 2.0) 115 | ; - /dev/poll (Solaris >= 7) 116 | ; - port (Solaris >= 10) 117 | ; Default Value: not set (auto detection) 118 | ;events.mechanism = epoll 119 | 120 | ; When FPM is built with systemd integration, specify the interval, 121 | ; in seconds, between health report notification to systemd. 122 | ; Set to 0 to disable. 123 | ; Available Units: s(econds), m(inutes), h(ours) 124 | ; Default Unit: seconds 125 | ; Default value: 10 126 | ;systemd_interval = 10 127 | 128 | ;;;;;;;;;;;;;;;;;;;; 129 | ; Pool Definitions ; 130 | ;;;;;;;;;;;;;;;;;;;; 131 | 132 | ; Multiple pools of child processes may be started with different listening 133 | ; ports and different management options. The name of the pool will be 134 | ; used in logs and stats. There is no limitation on the number of pools which 135 | ; FPM can handle. Your system will tell you anyway :) 136 | 137 | ; Include one or more files. If glob(3) exists, it is used to include a bunch of 138 | ; files from a glob(3) pattern. This directive can be used everywhere in the 139 | ; file. 140 | ; Relative path can also be used. They will be prefixed by: 141 | ; - the global prefix if it's been set (-p argument) 142 | ; - /usr/local otherwise 143 | include=etc/php-fpm.d/*.conf 144 | -------------------------------------------------------------------------------- /php-fpm/conf-8.0/php-fpm.conf: -------------------------------------------------------------------------------- 1 | ;;;;;;;;;;;;;;;;;;;;; 2 | ; FPM Configuration ; 3 | ;;;;;;;;;;;;;;;;;;;;; 4 | 5 | ; All relative paths in this configuration file are relative to PHP's install 6 | ; prefix (/usr/local). This prefix can be dynamically changed by using the 7 | ; '-p' argument from the command line. 8 | 9 | ;;;;;;;;;;;;;;;;;; 10 | ; Global Options ; 11 | ;;;;;;;;;;;;;;;;;; 12 | 13 | [global] 14 | ; Pid file 15 | ; Note: the default prefix is /usr/local/var 16 | ; Default Value: none 17 | ;pid = run/php-fpm.pid 18 | 19 | ; Error log file 20 | ; If it's set to "syslog", log is sent to syslogd instead of being written 21 | ; into a local file. 22 | ; Note: the default prefix is /usr/local/var 23 | ; Default Value: log/php-fpm.log 24 | ;error_log = log/php-fpm.log 25 | 26 | ; syslog_facility is used to specify what type of program is logging the 27 | ; message. This lets syslogd specify that messages from different facilities 28 | ; will be handled differently. 29 | ; See syslog(3) for possible values (ex daemon equiv LOG_DAEMON) 30 | ; Default Value: daemon 31 | ;syslog.facility = daemon 32 | 33 | ; syslog_ident is prepended to every message. If you have multiple FPM 34 | ; instances running on the same server, you can change the default value 35 | ; which must suit common needs. 36 | ; Default Value: php-fpm 37 | ;syslog.ident = php-fpm 38 | 39 | ; Log level 40 | ; Possible Values: alert, error, warning, notice, debug 41 | ; Default Value: notice 42 | ;log_level = notice 43 | 44 | ; Log limit on number of characters in the single line (log entry). If the 45 | ; line is over the limit, it is wrapped on multiple lines. The limit is for 46 | ; all logged characters including message prefix and suffix if present. However 47 | ; the new line character does not count into it as it is present only when 48 | ; logging to a file descriptor. It means the new line character is not present 49 | ; when logging to syslog. 50 | ; Default Value: 1024 51 | ;log_limit = 4096 52 | 53 | ; Log buffering specifies if the log line is buffered which means that the 54 | ; line is written in a single write operation. If the value is false, then the 55 | ; data is written directly into the file descriptor. It is an experimental 56 | ; option that can potentionaly improve logging performance and memory usage 57 | ; for some heavy logging scenarios. This option is ignored if logging to syslog 58 | ; as it has to be always buffered. 59 | ; Default value: yes 60 | ;log_buffering = no 61 | 62 | ; If this number of child processes exit with SIGSEGV or SIGBUS within the time 63 | ; interval set by emergency_restart_interval then FPM will restart. A value 64 | ; of '0' means 'Off'. 65 | ; Default Value: 0 66 | ;emergency_restart_threshold = 0 67 | 68 | ; Interval of time used by emergency_restart_interval to determine when 69 | ; a graceful restart will be initiated. This can be useful to work around 70 | ; accidental corruptions in an accelerator's shared memory. 71 | ; Available Units: s(econds), m(inutes), h(ours), or d(ays) 72 | ; Default Unit: seconds 73 | ; Default Value: 0 74 | ;emergency_restart_interval = 0 75 | 76 | ; Time limit for child processes to wait for a reaction on signals from master. 77 | ; Available units: s(econds), m(inutes), h(ours), or d(ays) 78 | ; Default Unit: seconds 79 | ; Default Value: 0 80 | ;process_control_timeout = 0 81 | 82 | ; The maximum number of processes FPM will fork. This has been designed to control 83 | ; the global number of processes when using dynamic PM within a lot of pools. 84 | ; Use it with caution. 85 | ; Note: A value of 0 indicates no limit 86 | ; Default Value: 0 87 | ; process.max = 128 88 | 89 | ; Specify the nice(2) priority to apply to the master process (only if set) 90 | ; The value can vary from -19 (highest priority) to 20 (lowest priority) 91 | ; Note: - It will only work if the FPM master process is launched as root 92 | ; - The pool process will inherit the master process priority 93 | ; unless specified otherwise 94 | ; Default Value: no set 95 | ; process.priority = -19 96 | 97 | ; Send FPM to background. Set to 'no' to keep FPM in foreground for debugging. 98 | ; Default Value: yes 99 | ;daemonize = yes 100 | 101 | ; Set open file descriptor rlimit for the master process. 102 | ; Default Value: system defined value 103 | ;rlimit_files = 1024 104 | 105 | ; Set max core size rlimit for the master process. 106 | ; Possible Values: 'unlimited' or an integer greater or equal to 0 107 | ; Default Value: system defined value 108 | ;rlimit_core = 0 109 | 110 | ; Specify the event mechanism FPM will use. The following is available: 111 | ; - select (any POSIX os) 112 | ; - poll (any POSIX os) 113 | ; - epoll (linux >= 2.5.44) 114 | ; - kqueue (FreeBSD >= 4.1, OpenBSD >= 2.9, NetBSD >= 2.0) 115 | ; - /dev/poll (Solaris >= 7) 116 | ; - port (Solaris >= 10) 117 | ; Default Value: not set (auto detection) 118 | ;events.mechanism = epoll 119 | 120 | ; When FPM is built with systemd integration, specify the interval, 121 | ; in seconds, between health report notification to systemd. 122 | ; Set to 0 to disable. 123 | ; Available Units: s(econds), m(inutes), h(ours) 124 | ; Default Unit: seconds 125 | ; Default value: 10 126 | ;systemd_interval = 10 127 | 128 | ;;;;;;;;;;;;;;;;;;;; 129 | ; Pool Definitions ; 130 | ;;;;;;;;;;;;;;;;;;;; 131 | 132 | ; Multiple pools of child processes may be started with different listening 133 | ; ports and different management options. The name of the pool will be 134 | ; used in logs and stats. There is no limitation on the number of pools which 135 | ; FPM can handle. Your system will tell you anyway :) 136 | 137 | ; Include one or more files. If glob(3) exists, it is used to include a bunch of 138 | ; files from a glob(3) pattern. This directive can be used everywhere in the 139 | ; file. 140 | ; Relative path can also be used. They will be prefixed by: 141 | ; - the global prefix if it's been set (-p argument) 142 | ; - /usr/local otherwise 143 | include=etc/php-fpm.d/*.conf 144 | -------------------------------------------------------------------------------- /php-fpm/conf-8.1/php-fpm.conf: -------------------------------------------------------------------------------- 1 | ;;;;;;;;;;;;;;;;;;;;; 2 | ; FPM Configuration ; 3 | ;;;;;;;;;;;;;;;;;;;;; 4 | 5 | ; All relative paths in this configuration file are relative to PHP's install 6 | ; prefix (/usr/local). This prefix can be dynamically changed by using the 7 | ; '-p' argument from the command line. 8 | 9 | ;;;;;;;;;;;;;;;;;; 10 | ; Global Options ; 11 | ;;;;;;;;;;;;;;;;;; 12 | 13 | [global] 14 | ; Pid file 15 | ; Note: the default prefix is /usr/local/var 16 | ; Default Value: none 17 | ;pid = run/php-fpm.pid 18 | 19 | ; Error log file 20 | ; If it's set to "syslog", log is sent to syslogd instead of being written 21 | ; into a local file. 22 | ; Note: the default prefix is /usr/local/var 23 | ; Default Value: log/php-fpm.log 24 | ;error_log = log/php-fpm.log 25 | 26 | ; syslog_facility is used to specify what type of program is logging the 27 | ; message. This lets syslogd specify that messages from different facilities 28 | ; will be handled differently. 29 | ; See syslog(3) for possible values (ex daemon equiv LOG_DAEMON) 30 | ; Default Value: daemon 31 | ;syslog.facility = daemon 32 | 33 | ; syslog_ident is prepended to every message. If you have multiple FPM 34 | ; instances running on the same server, you can change the default value 35 | ; which must suit common needs. 36 | ; Default Value: php-fpm 37 | ;syslog.ident = php-fpm 38 | 39 | ; Log level 40 | ; Possible Values: alert, error, warning, notice, debug 41 | ; Default Value: notice 42 | ;log_level = notice 43 | 44 | ; Log limit on number of characters in the single line (log entry). If the 45 | ; line is over the limit, it is wrapped on multiple lines. The limit is for 46 | ; all logged characters including message prefix and suffix if present. However 47 | ; the new line character does not count into it as it is present only when 48 | ; logging to a file descriptor. It means the new line character is not present 49 | ; when logging to syslog. 50 | ; Default Value: 1024 51 | ;log_limit = 4096 52 | 53 | ; Log buffering specifies if the log line is buffered which means that the 54 | ; line is written in a single write operation. If the value is false, then the 55 | ; data is written directly into the file descriptor. It is an experimental 56 | ; option that can potentially improve logging performance and memory usage 57 | ; for some heavy logging scenarios. This option is ignored if logging to syslog 58 | ; as it has to be always buffered. 59 | ; Default value: yes 60 | ;log_buffering = no 61 | 62 | ; If this number of child processes exit with SIGSEGV or SIGBUS within the time 63 | ; interval set by emergency_restart_interval then FPM will restart. A value 64 | ; of '0' means 'Off'. 65 | ; Default Value: 0 66 | ;emergency_restart_threshold = 0 67 | 68 | ; Interval of time used by emergency_restart_interval to determine when 69 | ; a graceful restart will be initiated. This can be useful to work around 70 | ; accidental corruptions in an accelerator's shared memory. 71 | ; Available Units: s(econds), m(inutes), h(ours), or d(ays) 72 | ; Default Unit: seconds 73 | ; Default Value: 0 74 | ;emergency_restart_interval = 0 75 | 76 | ; Time limit for child processes to wait for a reaction on signals from master. 77 | ; Available units: s(econds), m(inutes), h(ours), or d(ays) 78 | ; Default Unit: seconds 79 | ; Default Value: 0 80 | ;process_control_timeout = 0 81 | 82 | ; The maximum number of processes FPM will fork. This has been designed to control 83 | ; the global number of processes when using dynamic PM within a lot of pools. 84 | ; Use it with caution. 85 | ; Note: A value of 0 indicates no limit 86 | ; Default Value: 0 87 | ; process.max = 128 88 | 89 | ; Specify the nice(2) priority to apply to the master process (only if set) 90 | ; The value can vary from -19 (highest priority) to 20 (lowest priority) 91 | ; Note: - It will only work if the FPM master process is launched as root 92 | ; - The pool process will inherit the master process priority 93 | ; unless specified otherwise 94 | ; Default Value: no set 95 | ; process.priority = -19 96 | 97 | ; Send FPM to background. Set to 'no' to keep FPM in foreground for debugging. 98 | ; Default Value: yes 99 | ;daemonize = yes 100 | 101 | ; Set open file descriptor rlimit for the master process. 102 | ; Default Value: system defined value 103 | ;rlimit_files = 1024 104 | 105 | ; Set max core size rlimit for the master process. 106 | ; Possible Values: 'unlimited' or an integer greater or equal to 0 107 | ; Default Value: system defined value 108 | ;rlimit_core = 0 109 | 110 | ; Specify the event mechanism FPM will use. The following is available: 111 | ; - select (any POSIX os) 112 | ; - poll (any POSIX os) 113 | ; - epoll (linux >= 2.5.44) 114 | ; - kqueue (FreeBSD >= 4.1, OpenBSD >= 2.9, NetBSD >= 2.0) 115 | ; - /dev/poll (Solaris >= 7) 116 | ; - port (Solaris >= 10) 117 | ; Default Value: not set (auto detection) 118 | ;events.mechanism = epoll 119 | 120 | ; When FPM is built with systemd integration, specify the interval, 121 | ; in seconds, between health report notification to systemd. 122 | ; Set to 0 to disable. 123 | ; Available Units: s(econds), m(inutes), h(ours) 124 | ; Default Unit: seconds 125 | ; Default value: 10 126 | ;systemd_interval = 10 127 | 128 | ;;;;;;;;;;;;;;;;;;;; 129 | ; Pool Definitions ; 130 | ;;;;;;;;;;;;;;;;;;;; 131 | 132 | ; Multiple pools of child processes may be started with different listening 133 | ; ports and different management options. The name of the pool will be 134 | ; used in logs and stats. There is no limitation on the number of pools which 135 | ; FPM can handle. Your system will tell you anyway :) 136 | 137 | ; Include one or more files. If glob(3) exists, it is used to include a bunch of 138 | ; files from a glob(3) pattern. This directive can be used everywhere in the 139 | ; file. 140 | ; Relative path can also be used. They will be prefixed by: 141 | ; - the global prefix if it's been set (-p argument) 142 | ; - /usr/local otherwise 143 | include=etc/php-fpm.d/*.conf 144 | -------------------------------------------------------------------------------- /php-fpm/conf-7.1/php-fpm.d/www.conf: -------------------------------------------------------------------------------- 1 | ; Start a new pool named 'www'. 2 | ; the variable $pool can be used in any directive and will be replaced by the 3 | ; pool name ('www' here) 4 | [www] 5 | 6 | ; Per pool prefix 7 | ; It only applies on the following directives: 8 | ; - 'access.log' 9 | ; - 'slowlog' 10 | ; - 'listen' (unixsocket) 11 | ; - 'chroot' 12 | ; - 'chdir' 13 | ; - 'php_values' 14 | ; - 'php_admin_values' 15 | ; When not set, the global prefix (or NONE) applies instead. 16 | ; Note: This directive can also be relative to the global prefix. 17 | ; Default Value: none 18 | ;prefix = /path/to/pools/$pool 19 | 20 | ; Unix user/group of processes 21 | ; Note: The user is mandatory. If the group is not set, the default user's group 22 | ; will be used. 23 | user = www-data 24 | group = www-data 25 | 26 | ; The address on which to accept FastCGI requests. 27 | ; Valid syntaxes are: 28 | ; 'ip.add.re.ss:port' - to listen on a TCP socket to a specific IPv4 address on 29 | ; a specific port; 30 | ; '[ip:6:addr:ess]:port' - to listen on a TCP socket to a specific IPv6 address on 31 | ; a specific port; 32 | ; 'port' - to listen on a TCP socket to all addresses 33 | ; (IPv6 and IPv4-mapped) on a specific port; 34 | ; '/path/to/unix/socket' - to listen on a unix socket. 35 | ; Note: This value is mandatory. 36 | listen = 127.0.0.1:9000 37 | 38 | ; Set listen(2) backlog. 39 | ; Default Value: 511 (-1 on FreeBSD and OpenBSD) 40 | ;listen.backlog = 511 41 | 42 | ; Set permissions for unix socket, if one is used. In Linux, read/write 43 | ; permissions must be set in order to allow connections from a web server. Many 44 | ; BSD-derived systems allow connections regardless of permissions. 45 | ; Default Values: user and group are set as the running user 46 | ; mode is set to 0660 47 | ;listen.owner = www-data 48 | ;listen.group = www-data 49 | ;listen.mode = 0660 50 | ; When POSIX Access Control Lists are supported you can set them using 51 | ; these options, value is a comma separated list of user/group names. 52 | ; When set, listen.owner and listen.group are ignored 53 | ;listen.acl_users = 54 | ;listen.acl_groups = 55 | 56 | ; List of addresses (IPv4/IPv6) of FastCGI clients which are allowed to connect. 57 | ; Equivalent to the FCGI_WEB_SERVER_ADDRS environment variable in the original 58 | ; PHP FCGI (5.2.2+). Makes sense only with a tcp listening socket. Each address 59 | ; must be separated by a comma. If this value is left blank, connections will be 60 | ; accepted from any ip address. 61 | ; Default Value: any 62 | ;listen.allowed_clients = 127.0.0.1 63 | 64 | ; Specify the nice(2) priority to apply to the pool processes (only if set) 65 | ; The value can vary from -19 (highest priority) to 20 (lower priority) 66 | ; Note: - It will only work if the FPM master process is launched as root 67 | ; - The pool processes will inherit the master process priority 68 | ; unless it specified otherwise 69 | ; Default Value: no set 70 | ; process.priority = -19 71 | 72 | ; Set the process dumpable flag (PR_SET_DUMPABLE prctl) even if the process user 73 | ; or group is differrent than the master process user. It allows to create process 74 | ; core dump and ptrace the process for the pool user. 75 | ; Default Value: no 76 | ; process.dumpable = yes 77 | 78 | ; Choose how the process manager will control the number of child processes. 79 | ; Possible Values: 80 | ; static - a fixed number (pm.max_children) of child processes; 81 | ; dynamic - the number of child processes are set dynamically based on the 82 | ; following directives. With this process management, there will be 83 | ; always at least 1 children. 84 | ; pm.max_children - the maximum number of children that can 85 | ; be alive at the same time. 86 | ; pm.start_servers - the number of children created on startup. 87 | ; pm.min_spare_servers - the minimum number of children in 'idle' 88 | ; state (waiting to process). If the number 89 | ; of 'idle' processes is less than this 90 | ; number then some children will be created. 91 | ; pm.max_spare_servers - the maximum number of children in 'idle' 92 | ; state (waiting to process). If the number 93 | ; of 'idle' processes is greater than this 94 | ; number then some children will be killed. 95 | ; ondemand - no children are created at startup. Children will be forked when 96 | ; new requests will connect. The following parameter are used: 97 | ; pm.max_children - the maximum number of children that 98 | ; can be alive at the same time. 99 | ; pm.process_idle_timeout - The number of seconds after which 100 | ; an idle process will be killed. 101 | ; Note: This value is mandatory. 102 | pm = dynamic 103 | 104 | ; The number of child processes to be created when pm is set to 'static' and the 105 | ; maximum number of child processes when pm is set to 'dynamic' or 'ondemand'. 106 | ; This value sets the limit on the number of simultaneous requests that will be 107 | ; served. Equivalent to the ApacheMaxClients directive with mpm_prefork. 108 | ; Equivalent to the PHP_FCGI_CHILDREN environment variable in the original PHP 109 | ; CGI. The below defaults are based on a server without much resources. Don't 110 | ; forget to tweak pm.* to fit your needs. 111 | ; Note: Used when pm is set to 'static', 'dynamic' or 'ondemand' 112 | ; Note: This value is mandatory. 113 | pm.max_children = 5 114 | 115 | ; The number of child processes created on startup. 116 | ; Note: Used only when pm is set to 'dynamic' 117 | ; Default Value: min_spare_servers + (max_spare_servers - min_spare_servers) / 2 118 | pm.start_servers = 2 119 | 120 | ; The desired minimum number of idle server processes. 121 | ; Note: Used only when pm is set to 'dynamic' 122 | ; Note: Mandatory when pm is set to 'dynamic' 123 | pm.min_spare_servers = 1 124 | 125 | ; The desired maximum number of idle server processes. 126 | ; Note: Used only when pm is set to 'dynamic' 127 | ; Note: Mandatory when pm is set to 'dynamic' 128 | pm.max_spare_servers = 3 129 | 130 | ; The number of seconds after which an idle process will be killed. 131 | ; Note: Used only when pm is set to 'ondemand' 132 | ; Default Value: 10s 133 | ;pm.process_idle_timeout = 10s; 134 | 135 | ; The number of requests each child process should execute before respawning. 136 | ; This can be useful to work around memory leaks in 3rd party libraries. For 137 | ; endless request processing specify '0'. Equivalent to PHP_FCGI_MAX_REQUESTS. 138 | ; Default Value: 0 139 | ;pm.max_requests = 500 140 | 141 | ; The URI to view the FPM status page. If this value is not set, no URI will be 142 | ; recognized as a status page. It shows the following informations: 143 | ; pool - the name of the pool; 144 | ; process manager - static, dynamic or ondemand; 145 | ; start time - the date and time FPM has started; 146 | ; start since - number of seconds since FPM has started; 147 | ; accepted conn - the number of request accepted by the pool; 148 | ; listen queue - the number of request in the queue of pending 149 | ; connections (see backlog in listen(2)); 150 | ; max listen queue - the maximum number of requests in the queue 151 | ; of pending connections since FPM has started; 152 | ; listen queue len - the size of the socket queue of pending connections; 153 | ; idle processes - the number of idle processes; 154 | ; active processes - the number of active processes; 155 | ; total processes - the number of idle + active processes; 156 | ; max active processes - the maximum number of active processes since FPM 157 | ; has started; 158 | ; max children reached - number of times, the process limit has been reached, 159 | ; when pm tries to start more children (works only for 160 | ; pm 'dynamic' and 'ondemand'); 161 | ; Value are updated in real time. 162 | ; Example output: 163 | ; pool: www 164 | ; process manager: static 165 | ; start time: 01/Jul/2011:17:53:49 +0200 166 | ; start since: 62636 167 | ; accepted conn: 190460 168 | ; listen queue: 0 169 | ; max listen queue: 1 170 | ; listen queue len: 42 171 | ; idle processes: 4 172 | ; active processes: 11 173 | ; total processes: 15 174 | ; max active processes: 12 175 | ; max children reached: 0 176 | ; 177 | ; By default the status page output is formatted as text/plain. Passing either 178 | ; 'html', 'xml' or 'json' in the query string will return the corresponding 179 | ; output syntax. Example: 180 | ; http://www.foo.bar/status 181 | ; http://www.foo.bar/status?json 182 | ; http://www.foo.bar/status?html 183 | ; http://www.foo.bar/status?xml 184 | ; 185 | ; By default the status page only outputs short status. Passing 'full' in the 186 | ; query string will also return status for each pool process. 187 | ; Example: 188 | ; http://www.foo.bar/status?full 189 | ; http://www.foo.bar/status?json&full 190 | ; http://www.foo.bar/status?html&full 191 | ; http://www.foo.bar/status?xml&full 192 | ; The Full status returns for each process: 193 | ; pid - the PID of the process; 194 | ; state - the state of the process (Idle, Running, ...); 195 | ; start time - the date and time the process has started; 196 | ; start since - the number of seconds since the process has started; 197 | ; requests - the number of requests the process has served; 198 | ; request duration - the duration in µs of the requests; 199 | ; request method - the request method (GET, POST, ...); 200 | ; request URI - the request URI with the query string; 201 | ; content length - the content length of the request (only with POST); 202 | ; user - the user (PHP_AUTH_USER) (or '-' if not set); 203 | ; script - the main script called (or '-' if not set); 204 | ; last request cpu - the %cpu the last request consumed 205 | ; it's always 0 if the process is not in Idle state 206 | ; because CPU calculation is done when the request 207 | ; processing has terminated; 208 | ; last request memory - the max amount of memory the last request consumed 209 | ; it's always 0 if the process is not in Idle state 210 | ; because memory calculation is done when the request 211 | ; processing has terminated; 212 | ; If the process is in Idle state, then informations are related to the 213 | ; last request the process has served. Otherwise informations are related to 214 | ; the current request being served. 215 | ; Example output: 216 | ; ************************ 217 | ; pid: 31330 218 | ; state: Running 219 | ; start time: 01/Jul/2011:17:53:49 +0200 220 | ; start since: 63087 221 | ; requests: 12808 222 | ; request duration: 1250261 223 | ; request method: GET 224 | ; request URI: /test_mem.php?N=10000 225 | ; content length: 0 226 | ; user: - 227 | ; script: /home/fat/web/docs/php/test_mem.php 228 | ; last request cpu: 0.00 229 | ; last request memory: 0 230 | ; 231 | ; Note: There is a real-time FPM status monitoring sample web page available 232 | ; It's available in: /usr/local/share/php/fpm/status.html 233 | ; 234 | ; Note: The value must start with a leading slash (/). The value can be 235 | ; anything, but it may not be a good idea to use the .php extension or it 236 | ; may conflict with a real PHP file. 237 | ; Default Value: not set 238 | ;pm.status_path = /status 239 | 240 | ; The ping URI to call the monitoring page of FPM. If this value is not set, no 241 | ; URI will be recognized as a ping page. This could be used to test from outside 242 | ; that FPM is alive and responding, or to 243 | ; - create a graph of FPM availability (rrd or such); 244 | ; - remove a server from a group if it is not responding (load balancing); 245 | ; - trigger alerts for the operating team (24/7). 246 | ; Note: The value must start with a leading slash (/). The value can be 247 | ; anything, but it may not be a good idea to use the .php extension or it 248 | ; may conflict with a real PHP file. 249 | ; Default Value: not set 250 | ;ping.path = /ping 251 | 252 | ; This directive may be used to customize the response of a ping request. The 253 | ; response is formatted as text/plain with a 200 response code. 254 | ; Default Value: pong 255 | ;ping.response = pong 256 | 257 | ; The access log file 258 | ; Default: not set 259 | ;access.log = log/$pool.access.log 260 | 261 | ; The access log format. 262 | ; The following syntax is allowed 263 | ; %%: the '%' character 264 | ; %C: %CPU used by the request 265 | ; it can accept the following format: 266 | ; - %{user}C for user CPU only 267 | ; - %{system}C for system CPU only 268 | ; - %{total}C for user + system CPU (default) 269 | ; %d: time taken to serve the request 270 | ; it can accept the following format: 271 | ; - %{seconds}d (default) 272 | ; - %{miliseconds}d 273 | ; - %{mili}d 274 | ; - %{microseconds}d 275 | ; - %{micro}d 276 | ; %e: an environment variable (same as $_ENV or $_SERVER) 277 | ; it must be associated with embraces to specify the name of the env 278 | ; variable. Some exemples: 279 | ; - server specifics like: %{REQUEST_METHOD}e or %{SERVER_PROTOCOL}e 280 | ; - HTTP headers like: %{HTTP_HOST}e or %{HTTP_USER_AGENT}e 281 | ; %f: script filename 282 | ; %l: content-length of the request (for POST request only) 283 | ; %m: request method 284 | ; %M: peak of memory allocated by PHP 285 | ; it can accept the following format: 286 | ; - %{bytes}M (default) 287 | ; - %{kilobytes}M 288 | ; - %{kilo}M 289 | ; - %{megabytes}M 290 | ; - %{mega}M 291 | ; %n: pool name 292 | ; %o: output header 293 | ; it must be associated with embraces to specify the name of the header: 294 | ; - %{Content-Type}o 295 | ; - %{X-Powered-By}o 296 | ; - %{Transfert-Encoding}o 297 | ; - .... 298 | ; %p: PID of the child that serviced the request 299 | ; %P: PID of the parent of the child that serviced the request 300 | ; %q: the query string 301 | ; %Q: the '?' character if query string exists 302 | ; %r: the request URI (without the query string, see %q and %Q) 303 | ; %R: remote IP address 304 | ; %s: status (response code) 305 | ; %t: server time the request was received 306 | ; it can accept a strftime(3) format: 307 | ; %d/%b/%Y:%H:%M:%S %z (default) 308 | ; The strftime(3) format must be encapsuled in a %{}t tag 309 | ; e.g. for a ISO8601 formatted timestring, use: %{%Y-%m-%dT%H:%M:%S%z}t 310 | ; %T: time the log has been written (the request has finished) 311 | ; it can accept a strftime(3) format: 312 | ; %d/%b/%Y:%H:%M:%S %z (default) 313 | ; The strftime(3) format must be encapsuled in a %{}t tag 314 | ; e.g. for a ISO8601 formatted timestring, use: %{%Y-%m-%dT%H:%M:%S%z}t 315 | ; %u: remote user 316 | ; 317 | ; Default: "%R - %u %t \"%m %r\" %s" 318 | ;access.format = "%R - %u %t \"%m %r%Q%q\" %s %f %{mili}d %{kilo}M %C%%" 319 | 320 | ; The log file for slow requests 321 | ; Default Value: not set 322 | ; Note: slowlog is mandatory if request_slowlog_timeout is set 323 | ;slowlog = log/$pool.log.slow 324 | 325 | ; The timeout for serving a single request after which a PHP backtrace will be 326 | ; dumped to the 'slowlog' file. A value of '0s' means 'off'. 327 | ; Available units: s(econds)(default), m(inutes), h(ours), or d(ays) 328 | ; Default Value: 0 329 | ;request_slowlog_timeout = 0 330 | 331 | ; The timeout for serving a single request after which the worker process will 332 | ; be killed. This option should be used when the 'max_execution_time' ini option 333 | ; does not stop script execution for some reason. A value of '0' means 'off'. 334 | ; Available units: s(econds)(default), m(inutes), h(ours), or d(ays) 335 | ; Default Value: 0 336 | ;request_terminate_timeout = 0 337 | 338 | ; Set open file descriptor rlimit. 339 | ; Default Value: system defined value 340 | ;rlimit_files = 1024 341 | 342 | ; Set max core size rlimit. 343 | ; Possible Values: 'unlimited' or an integer greater or equal to 0 344 | ; Default Value: system defined value 345 | ;rlimit_core = 0 346 | 347 | ; Chroot to this directory at the start. This value must be defined as an 348 | ; absolute path. When this value is not set, chroot is not used. 349 | ; Note: you can prefix with '$prefix' to chroot to the pool prefix or one 350 | ; of its subdirectories. If the pool prefix is not set, the global prefix 351 | ; will be used instead. 352 | ; Note: chrooting is a great security feature and should be used whenever 353 | ; possible. However, all PHP paths will be relative to the chroot 354 | ; (error_log, sessions.save_path, ...). 355 | ; Default Value: not set 356 | ;chroot = 357 | 358 | ; Chdir to this directory at the start. 359 | ; Note: relative path can be used. 360 | ; Default Value: current directory or / when chroot 361 | ;chdir = /var/www 362 | 363 | ; Redirect worker stdout and stderr into main error log. If not set, stdout and 364 | ; stderr will be redirected to /dev/null according to FastCGI specs. 365 | ; Note: on highloaded environement, this can cause some delay in the page 366 | ; process time (several ms). 367 | ; Default Value: no 368 | ;catch_workers_output = yes 369 | 370 | ; Clear environment in FPM workers 371 | ; Prevents arbitrary environment variables from reaching FPM worker processes 372 | ; by clearing the environment in workers before env vars specified in this 373 | ; pool configuration are added. 374 | ; Setting to "no" will make all environment variables available to PHP code 375 | ; via getenv(), $_ENV and $_SERVER. 376 | ; Default Value: yes 377 | ;clear_env = no 378 | 379 | ; Limits the extensions of the main script FPM will allow to parse. This can 380 | ; prevent configuration mistakes on the web server side. You should only limit 381 | ; FPM to .php extensions to prevent malicious users to use other extensions to 382 | ; execute php code. 383 | ; Note: set an empty value to allow all extensions. 384 | ; Default Value: .php 385 | ;security.limit_extensions = .php .php3 .php4 .php5 .php7 386 | 387 | ; Pass environment variables like LD_LIBRARY_PATH. All $VARIABLEs are taken from 388 | ; the current environment. 389 | ; Default Value: clean env 390 | ;env[HOSTNAME] = $HOSTNAME 391 | ;env[PATH] = /usr/local/bin:/usr/bin:/bin 392 | ;env[TMP] = /tmp 393 | ;env[TMPDIR] = /tmp 394 | ;env[TEMP] = /tmp 395 | 396 | ; Additional php.ini defines, specific to this pool of workers. These settings 397 | ; overwrite the values previously defined in the php.ini. The directives are the 398 | ; same as the PHP SAPI: 399 | ; php_value/php_flag - you can set classic ini defines which can 400 | ; be overwritten from PHP call 'ini_set'. 401 | ; php_admin_value/php_admin_flag - these directives won't be overwritten by 402 | ; PHP call 'ini_set' 403 | ; For php_*flag, valid values are on, off, 1, 0, true, false, yes or no. 404 | 405 | ; Defining 'extension' will load the corresponding shared extension from 406 | ; extension_dir. Defining 'disable_functions' or 'disable_classes' will not 407 | ; overwrite previously defined php.ini values, but will append the new value 408 | ; instead. 409 | 410 | ; Note: path INI options can be relative and will be expanded with the prefix 411 | ; (pool, global or /usr/local) 412 | 413 | ; Default Value: nothing is defined by default except the values in php.ini and 414 | ; specified at startup with the -d argument 415 | ;php_admin_value[sendmail_path] = /usr/sbin/sendmail -t -i -f www@my.domain.com 416 | ;php_flag[display_errors] = off 417 | ;php_admin_value[error_log] = /var/log/fpm-php.www.log 418 | ;php_admin_flag[log_errors] = on 419 | ;php_admin_value[memory_limit] = 32M 420 | -------------------------------------------------------------------------------- /php-fpm/conf-7.2/php-fpm.d/www.conf: -------------------------------------------------------------------------------- 1 | ; Start a new pool named 'www'. 2 | ; the variable $pool can be used in any directive and will be replaced by the 3 | ; pool name ('www' here) 4 | [www] 5 | 6 | ; Per pool prefix 7 | ; It only applies on the following directives: 8 | ; - 'access.log' 9 | ; - 'slowlog' 10 | ; - 'listen' (unixsocket) 11 | ; - 'chroot' 12 | ; - 'chdir' 13 | ; - 'php_values' 14 | ; - 'php_admin_values' 15 | ; When not set, the global prefix (or NONE) applies instead. 16 | ; Note: This directive can also be relative to the global prefix. 17 | ; Default Value: none 18 | ;prefix = /path/to/pools/$pool 19 | 20 | ; Unix user/group of processes 21 | ; Note: The user is mandatory. If the group is not set, the default user's group 22 | ; will be used. 23 | user = www-data 24 | group = www-data 25 | 26 | ; The address on which to accept FastCGI requests. 27 | ; Valid syntaxes are: 28 | ; 'ip.add.re.ss:port' - to listen on a TCP socket to a specific IPv4 address on 29 | ; a specific port; 30 | ; '[ip:6:addr:ess]:port' - to listen on a TCP socket to a specific IPv6 address on 31 | ; a specific port; 32 | ; 'port' - to listen on a TCP socket to all addresses 33 | ; (IPv6 and IPv4-mapped) on a specific port; 34 | ; '/path/to/unix/socket' - to listen on a unix socket. 35 | ; Note: This value is mandatory. 36 | listen = 127.0.0.1:9000 37 | 38 | ; Set listen(2) backlog. 39 | ; Default Value: 511 (-1 on FreeBSD and OpenBSD) 40 | ;listen.backlog = 511 41 | 42 | ; Set permissions for unix socket, if one is used. In Linux, read/write 43 | ; permissions must be set in order to allow connections from a web server. Many 44 | ; BSD-derived systems allow connections regardless of permissions. 45 | ; Default Values: user and group are set as the running user 46 | ; mode is set to 0660 47 | ;listen.owner = www-data 48 | ;listen.group = www-data 49 | ;listen.mode = 0660 50 | ; When POSIX Access Control Lists are supported you can set them using 51 | ; these options, value is a comma separated list of user/group names. 52 | ; When set, listen.owner and listen.group are ignored 53 | ;listen.acl_users = 54 | ;listen.acl_groups = 55 | 56 | ; List of addresses (IPv4/IPv6) of FastCGI clients which are allowed to connect. 57 | ; Equivalent to the FCGI_WEB_SERVER_ADDRS environment variable in the original 58 | ; PHP FCGI (5.2.2+). Makes sense only with a tcp listening socket. Each address 59 | ; must be separated by a comma. If this value is left blank, connections will be 60 | ; accepted from any ip address. 61 | ; Default Value: any 62 | ;listen.allowed_clients = 127.0.0.1 63 | 64 | ; Specify the nice(2) priority to apply to the pool processes (only if set) 65 | ; The value can vary from -19 (highest priority) to 20 (lower priority) 66 | ; Note: - It will only work if the FPM master process is launched as root 67 | ; - The pool processes will inherit the master process priority 68 | ; unless it specified otherwise 69 | ; Default Value: no set 70 | ; process.priority = -19 71 | 72 | ; Set the process dumpable flag (PR_SET_DUMPABLE prctl) even if the process user 73 | ; or group is differrent than the master process user. It allows to create process 74 | ; core dump and ptrace the process for the pool user. 75 | ; Default Value: no 76 | ; process.dumpable = yes 77 | 78 | ; Choose how the process manager will control the number of child processes. 79 | ; Possible Values: 80 | ; static - a fixed number (pm.max_children) of child processes; 81 | ; dynamic - the number of child processes are set dynamically based on the 82 | ; following directives. With this process management, there will be 83 | ; always at least 1 children. 84 | ; pm.max_children - the maximum number of children that can 85 | ; be alive at the same time. 86 | ; pm.start_servers - the number of children created on startup. 87 | ; pm.min_spare_servers - the minimum number of children in 'idle' 88 | ; state (waiting to process). If the number 89 | ; of 'idle' processes is less than this 90 | ; number then some children will be created. 91 | ; pm.max_spare_servers - the maximum number of children in 'idle' 92 | ; state (waiting to process). If the number 93 | ; of 'idle' processes is greater than this 94 | ; number then some children will be killed. 95 | ; ondemand - no children are created at startup. Children will be forked when 96 | ; new requests will connect. The following parameter are used: 97 | ; pm.max_children - the maximum number of children that 98 | ; can be alive at the same time. 99 | ; pm.process_idle_timeout - The number of seconds after which 100 | ; an idle process will be killed. 101 | ; Note: This value is mandatory. 102 | pm = dynamic 103 | 104 | ; The number of child processes to be created when pm is set to 'static' and the 105 | ; maximum number of child processes when pm is set to 'dynamic' or 'ondemand'. 106 | ; This value sets the limit on the number of simultaneous requests that will be 107 | ; served. Equivalent to the ApacheMaxClients directive with mpm_prefork. 108 | ; Equivalent to the PHP_FCGI_CHILDREN environment variable in the original PHP 109 | ; CGI. The below defaults are based on a server without much resources. Don't 110 | ; forget to tweak pm.* to fit your needs. 111 | ; Note: Used when pm is set to 'static', 'dynamic' or 'ondemand' 112 | ; Note: This value is mandatory. 113 | pm.max_children = 5 114 | 115 | ; The number of child processes created on startup. 116 | ; Note: Used only when pm is set to 'dynamic' 117 | ; Default Value: min_spare_servers + (max_spare_servers - min_spare_servers) / 2 118 | pm.start_servers = 2 119 | 120 | ; The desired minimum number of idle server processes. 121 | ; Note: Used only when pm is set to 'dynamic' 122 | ; Note: Mandatory when pm is set to 'dynamic' 123 | pm.min_spare_servers = 1 124 | 125 | ; The desired maximum number of idle server processes. 126 | ; Note: Used only when pm is set to 'dynamic' 127 | ; Note: Mandatory when pm is set to 'dynamic' 128 | pm.max_spare_servers = 3 129 | 130 | ; The number of seconds after which an idle process will be killed. 131 | ; Note: Used only when pm is set to 'ondemand' 132 | ; Default Value: 10s 133 | ;pm.process_idle_timeout = 10s; 134 | 135 | ; The number of requests each child process should execute before respawning. 136 | ; This can be useful to work around memory leaks in 3rd party libraries. For 137 | ; endless request processing specify '0'. Equivalent to PHP_FCGI_MAX_REQUESTS. 138 | ; Default Value: 0 139 | ;pm.max_requests = 500 140 | 141 | ; The URI to view the FPM status page. If this value is not set, no URI will be 142 | ; recognized as a status page. It shows the following informations: 143 | ; pool - the name of the pool; 144 | ; process manager - static, dynamic or ondemand; 145 | ; start time - the date and time FPM has started; 146 | ; start since - number of seconds since FPM has started; 147 | ; accepted conn - the number of request accepted by the pool; 148 | ; listen queue - the number of request in the queue of pending 149 | ; connections (see backlog in listen(2)); 150 | ; max listen queue - the maximum number of requests in the queue 151 | ; of pending connections since FPM has started; 152 | ; listen queue len - the size of the socket queue of pending connections; 153 | ; idle processes - the number of idle processes; 154 | ; active processes - the number of active processes; 155 | ; total processes - the number of idle + active processes; 156 | ; max active processes - the maximum number of active processes since FPM 157 | ; has started; 158 | ; max children reached - number of times, the process limit has been reached, 159 | ; when pm tries to start more children (works only for 160 | ; pm 'dynamic' and 'ondemand'); 161 | ; Value are updated in real time. 162 | ; Example output: 163 | ; pool: www 164 | ; process manager: static 165 | ; start time: 01/Jul/2011:17:53:49 +0200 166 | ; start since: 62636 167 | ; accepted conn: 190460 168 | ; listen queue: 0 169 | ; max listen queue: 1 170 | ; listen queue len: 42 171 | ; idle processes: 4 172 | ; active processes: 11 173 | ; total processes: 15 174 | ; max active processes: 12 175 | ; max children reached: 0 176 | ; 177 | ; By default the status page output is formatted as text/plain. Passing either 178 | ; 'html', 'xml' or 'json' in the query string will return the corresponding 179 | ; output syntax. Example: 180 | ; http://www.foo.bar/status 181 | ; http://www.foo.bar/status?json 182 | ; http://www.foo.bar/status?html 183 | ; http://www.foo.bar/status?xml 184 | ; 185 | ; By default the status page only outputs short status. Passing 'full' in the 186 | ; query string will also return status for each pool process. 187 | ; Example: 188 | ; http://www.foo.bar/status?full 189 | ; http://www.foo.bar/status?json&full 190 | ; http://www.foo.bar/status?html&full 191 | ; http://www.foo.bar/status?xml&full 192 | ; The Full status returns for each process: 193 | ; pid - the PID of the process; 194 | ; state - the state of the process (Idle, Running, ...); 195 | ; start time - the date and time the process has started; 196 | ; start since - the number of seconds since the process has started; 197 | ; requests - the number of requests the process has served; 198 | ; request duration - the duration in µs of the requests; 199 | ; request method - the request method (GET, POST, ...); 200 | ; request URI - the request URI with the query string; 201 | ; content length - the content length of the request (only with POST); 202 | ; user - the user (PHP_AUTH_USER) (or '-' if not set); 203 | ; script - the main script called (or '-' if not set); 204 | ; last request cpu - the %cpu the last request consumed 205 | ; it's always 0 if the process is not in Idle state 206 | ; because CPU calculation is done when the request 207 | ; processing has terminated; 208 | ; last request memory - the max amount of memory the last request consumed 209 | ; it's always 0 if the process is not in Idle state 210 | ; because memory calculation is done when the request 211 | ; processing has terminated; 212 | ; If the process is in Idle state, then informations are related to the 213 | ; last request the process has served. Otherwise informations are related to 214 | ; the current request being served. 215 | ; Example output: 216 | ; ************************ 217 | ; pid: 31330 218 | ; state: Running 219 | ; start time: 01/Jul/2011:17:53:49 +0200 220 | ; start since: 63087 221 | ; requests: 12808 222 | ; request duration: 1250261 223 | ; request method: GET 224 | ; request URI: /test_mem.php?N=10000 225 | ; content length: 0 226 | ; user: - 227 | ; script: /home/fat/web/docs/php/test_mem.php 228 | ; last request cpu: 0.00 229 | ; last request memory: 0 230 | ; 231 | ; Note: There is a real-time FPM status monitoring sample web page available 232 | ; It's available in: /usr/local/share/php/fpm/status.html 233 | ; 234 | ; Note: The value must start with a leading slash (/). The value can be 235 | ; anything, but it may not be a good idea to use the .php extension or it 236 | ; may conflict with a real PHP file. 237 | ; Default Value: not set 238 | ;pm.status_path = /status 239 | 240 | ; The ping URI to call the monitoring page of FPM. If this value is not set, no 241 | ; URI will be recognized as a ping page. This could be used to test from outside 242 | ; that FPM is alive and responding, or to 243 | ; - create a graph of FPM availability (rrd or such); 244 | ; - remove a server from a group if it is not responding (load balancing); 245 | ; - trigger alerts for the operating team (24/7). 246 | ; Note: The value must start with a leading slash (/). The value can be 247 | ; anything, but it may not be a good idea to use the .php extension or it 248 | ; may conflict with a real PHP file. 249 | ; Default Value: not set 250 | ;ping.path = /ping 251 | 252 | ; This directive may be used to customize the response of a ping request. The 253 | ; response is formatted as text/plain with a 200 response code. 254 | ; Default Value: pong 255 | ;ping.response = pong 256 | 257 | ; The access log file 258 | ; Default: not set 259 | ;access.log = log/$pool.access.log 260 | 261 | ; The access log format. 262 | ; The following syntax is allowed 263 | ; %%: the '%' character 264 | ; %C: %CPU used by the request 265 | ; it can accept the following format: 266 | ; - %{user}C for user CPU only 267 | ; - %{system}C for system CPU only 268 | ; - %{total}C for user + system CPU (default) 269 | ; %d: time taken to serve the request 270 | ; it can accept the following format: 271 | ; - %{seconds}d (default) 272 | ; - %{miliseconds}d 273 | ; - %{mili}d 274 | ; - %{microseconds}d 275 | ; - %{micro}d 276 | ; %e: an environment variable (same as $_ENV or $_SERVER) 277 | ; it must be associated with embraces to specify the name of the env 278 | ; variable. Some exemples: 279 | ; - server specifics like: %{REQUEST_METHOD}e or %{SERVER_PROTOCOL}e 280 | ; - HTTP headers like: %{HTTP_HOST}e or %{HTTP_USER_AGENT}e 281 | ; %f: script filename 282 | ; %l: content-length of the request (for POST request only) 283 | ; %m: request method 284 | ; %M: peak of memory allocated by PHP 285 | ; it can accept the following format: 286 | ; - %{bytes}M (default) 287 | ; - %{kilobytes}M 288 | ; - %{kilo}M 289 | ; - %{megabytes}M 290 | ; - %{mega}M 291 | ; %n: pool name 292 | ; %o: output header 293 | ; it must be associated with embraces to specify the name of the header: 294 | ; - %{Content-Type}o 295 | ; - %{X-Powered-By}o 296 | ; - %{Transfert-Encoding}o 297 | ; - .... 298 | ; %p: PID of the child that serviced the request 299 | ; %P: PID of the parent of the child that serviced the request 300 | ; %q: the query string 301 | ; %Q: the '?' character if query string exists 302 | ; %r: the request URI (without the query string, see %q and %Q) 303 | ; %R: remote IP address 304 | ; %s: status (response code) 305 | ; %t: server time the request was received 306 | ; it can accept a strftime(3) format: 307 | ; %d/%b/%Y:%H:%M:%S %z (default) 308 | ; The strftime(3) format must be encapsuled in a %{}t tag 309 | ; e.g. for a ISO8601 formatted timestring, use: %{%Y-%m-%dT%H:%M:%S%z}t 310 | ; %T: time the log has been written (the request has finished) 311 | ; it can accept a strftime(3) format: 312 | ; %d/%b/%Y:%H:%M:%S %z (default) 313 | ; The strftime(3) format must be encapsuled in a %{}t tag 314 | ; e.g. for a ISO8601 formatted timestring, use: %{%Y-%m-%dT%H:%M:%S%z}t 315 | ; %u: remote user 316 | ; 317 | ; Default: "%R - %u %t \"%m %r\" %s" 318 | ;access.format = "%R - %u %t \"%m %r%Q%q\" %s %f %{mili}d %{kilo}M %C%%" 319 | 320 | ; The log file for slow requests 321 | ; Default Value: not set 322 | ; Note: slowlog is mandatory if request_slowlog_timeout is set 323 | ;slowlog = log/$pool.log.slow 324 | 325 | ; The timeout for serving a single request after which a PHP backtrace will be 326 | ; dumped to the 'slowlog' file. A value of '0s' means 'off'. 327 | ; Available units: s(econds)(default), m(inutes), h(ours), or d(ays) 328 | ; Default Value: 0 329 | ;request_slowlog_timeout = 0 330 | 331 | ; Depth of slow log stack trace. 332 | ; Default Value: 20 333 | ;request_slowlog_trace_depth = 20 334 | 335 | ; The timeout for serving a single request after which the worker process will 336 | ; be killed. This option should be used when the 'max_execution_time' ini option 337 | ; does not stop script execution for some reason. A value of '0' means 'off'. 338 | ; Available units: s(econds)(default), m(inutes), h(ours), or d(ays) 339 | ; Default Value: 0 340 | ;request_terminate_timeout = 0 341 | 342 | ; Set open file descriptor rlimit. 343 | ; Default Value: system defined value 344 | ;rlimit_files = 1024 345 | 346 | ; Set max core size rlimit. 347 | ; Possible Values: 'unlimited' or an integer greater or equal to 0 348 | ; Default Value: system defined value 349 | ;rlimit_core = 0 350 | 351 | ; Chroot to this directory at the start. This value must be defined as an 352 | ; absolute path. When this value is not set, chroot is not used. 353 | ; Note: you can prefix with '$prefix' to chroot to the pool prefix or one 354 | ; of its subdirectories. If the pool prefix is not set, the global prefix 355 | ; will be used instead. 356 | ; Note: chrooting is a great security feature and should be used whenever 357 | ; possible. However, all PHP paths will be relative to the chroot 358 | ; (error_log, sessions.save_path, ...). 359 | ; Default Value: not set 360 | ;chroot = 361 | 362 | ; Chdir to this directory at the start. 363 | ; Note: relative path can be used. 364 | ; Default Value: current directory or / when chroot 365 | ;chdir = /var/www 366 | 367 | ; Redirect worker stdout and stderr into main error log. If not set, stdout and 368 | ; stderr will be redirected to /dev/null according to FastCGI specs. 369 | ; Note: on highloaded environement, this can cause some delay in the page 370 | ; process time (several ms). 371 | ; Default Value: no 372 | ;catch_workers_output = yes 373 | 374 | ; Clear environment in FPM workers 375 | ; Prevents arbitrary environment variables from reaching FPM worker processes 376 | ; by clearing the environment in workers before env vars specified in this 377 | ; pool configuration are added. 378 | ; Setting to "no" will make all environment variables available to PHP code 379 | ; via getenv(), $_ENV and $_SERVER. 380 | ; Default Value: yes 381 | ;clear_env = no 382 | 383 | ; Limits the extensions of the main script FPM will allow to parse. This can 384 | ; prevent configuration mistakes on the web server side. You should only limit 385 | ; FPM to .php extensions to prevent malicious users to use other extensions to 386 | ; execute php code. 387 | ; Note: set an empty value to allow all extensions. 388 | ; Default Value: .php 389 | ;security.limit_extensions = .php .php3 .php4 .php5 .php7 390 | 391 | ; Pass environment variables like LD_LIBRARY_PATH. All $VARIABLEs are taken from 392 | ; the current environment. 393 | ; Default Value: clean env 394 | ;env[HOSTNAME] = $HOSTNAME 395 | ;env[PATH] = /usr/local/bin:/usr/bin:/bin 396 | ;env[TMP] = /tmp 397 | ;env[TMPDIR] = /tmp 398 | ;env[TEMP] = /tmp 399 | 400 | ; Additional php.ini defines, specific to this pool of workers. These settings 401 | ; overwrite the values previously defined in the php.ini. The directives are the 402 | ; same as the PHP SAPI: 403 | ; php_value/php_flag - you can set classic ini defines which can 404 | ; be overwritten from PHP call 'ini_set'. 405 | ; php_admin_value/php_admin_flag - these directives won't be overwritten by 406 | ; PHP call 'ini_set' 407 | ; For php_*flag, valid values are on, off, 1, 0, true, false, yes or no. 408 | 409 | ; Defining 'extension' will load the corresponding shared extension from 410 | ; extension_dir. Defining 'disable_functions' or 'disable_classes' will not 411 | ; overwrite previously defined php.ini values, but will append the new value 412 | ; instead. 413 | 414 | ; Note: path INI options can be relative and will be expanded with the prefix 415 | ; (pool, global or /usr/local) 416 | 417 | ; Default Value: nothing is defined by default except the values in php.ini and 418 | ; specified at startup with the -d argument 419 | ;php_admin_value[sendmail_path] = /usr/sbin/sendmail -t -i -f www@my.domain.com 420 | ;php_flag[display_errors] = off 421 | ;php_admin_value[error_log] = /var/log/fpm-php.www.log 422 | ;php_admin_flag[log_errors] = on 423 | ;php_admin_value[memory_limit] = 32M 424 | -------------------------------------------------------------------------------- /php-fpm/conf-7.3/php-fpm.d/www.conf: -------------------------------------------------------------------------------- 1 | ; Start a new pool named 'www'. 2 | ; the variable $pool can be used in any directive and will be replaced by the 3 | ; pool name ('www' here) 4 | [www] 5 | 6 | ; Per pool prefix 7 | ; It only applies on the following directives: 8 | ; - 'access.log' 9 | ; - 'slowlog' 10 | ; - 'listen' (unixsocket) 11 | ; - 'chroot' 12 | ; - 'chdir' 13 | ; - 'php_values' 14 | ; - 'php_admin_values' 15 | ; When not set, the global prefix (or NONE) applies instead. 16 | ; Note: This directive can also be relative to the global prefix. 17 | ; Default Value: none 18 | ;prefix = /path/to/pools/$pool 19 | 20 | ; Unix user/group of processes 21 | ; Note: The user is mandatory. If the group is not set, the default user's group 22 | ; will be used. 23 | user = www-data 24 | group = www-data 25 | 26 | ; The address on which to accept FastCGI requests. 27 | ; Valid syntaxes are: 28 | ; 'ip.add.re.ss:port' - to listen on a TCP socket to a specific IPv4 address on 29 | ; a specific port; 30 | ; '[ip:6:addr:ess]:port' - to listen on a TCP socket to a specific IPv6 address on 31 | ; a specific port; 32 | ; 'port' - to listen on a TCP socket to all addresses 33 | ; (IPv6 and IPv4-mapped) on a specific port; 34 | ; '/path/to/unix/socket' - to listen on a unix socket. 35 | ; Note: This value is mandatory. 36 | listen = 127.0.0.1:9000 37 | 38 | ; Set listen(2) backlog. 39 | ; Default Value: 511 (-1 on FreeBSD and OpenBSD) 40 | ;listen.backlog = 511 41 | 42 | ; Set permissions for unix socket, if one is used. In Linux, read/write 43 | ; permissions must be set in order to allow connections from a web server. Many 44 | ; BSD-derived systems allow connections regardless of permissions. 45 | ; Default Values: user and group are set as the running user 46 | ; mode is set to 0660 47 | ;listen.owner = www-data 48 | ;listen.group = www-data 49 | ;listen.mode = 0660 50 | ; When POSIX Access Control Lists are supported you can set them using 51 | ; these options, value is a comma separated list of user/group names. 52 | ; When set, listen.owner and listen.group are ignored 53 | ;listen.acl_users = 54 | ;listen.acl_groups = 55 | 56 | ; List of addresses (IPv4/IPv6) of FastCGI clients which are allowed to connect. 57 | ; Equivalent to the FCGI_WEB_SERVER_ADDRS environment variable in the original 58 | ; PHP FCGI (5.2.2+). Makes sense only with a tcp listening socket. Each address 59 | ; must be separated by a comma. If this value is left blank, connections will be 60 | ; accepted from any ip address. 61 | ; Default Value: any 62 | ;listen.allowed_clients = 127.0.0.1 63 | 64 | ; Specify the nice(2) priority to apply to the pool processes (only if set) 65 | ; The value can vary from -19 (highest priority) to 20 (lower priority) 66 | ; Note: - It will only work if the FPM master process is launched as root 67 | ; - The pool processes will inherit the master process priority 68 | ; unless it specified otherwise 69 | ; Default Value: no set 70 | ; process.priority = -19 71 | 72 | ; Set the process dumpable flag (PR_SET_DUMPABLE prctl) even if the process user 73 | ; or group is differrent than the master process user. It allows to create process 74 | ; core dump and ptrace the process for the pool user. 75 | ; Default Value: no 76 | ; process.dumpable = yes 77 | 78 | ; Choose how the process manager will control the number of child processes. 79 | ; Possible Values: 80 | ; static - a fixed number (pm.max_children) of child processes; 81 | ; dynamic - the number of child processes are set dynamically based on the 82 | ; following directives. With this process management, there will be 83 | ; always at least 1 children. 84 | ; pm.max_children - the maximum number of children that can 85 | ; be alive at the same time. 86 | ; pm.start_servers - the number of children created on startup. 87 | ; pm.min_spare_servers - the minimum number of children in 'idle' 88 | ; state (waiting to process). If the number 89 | ; of 'idle' processes is less than this 90 | ; number then some children will be created. 91 | ; pm.max_spare_servers - the maximum number of children in 'idle' 92 | ; state (waiting to process). If the number 93 | ; of 'idle' processes is greater than this 94 | ; number then some children will be killed. 95 | ; ondemand - no children are created at startup. Children will be forked when 96 | ; new requests will connect. The following parameter are used: 97 | ; pm.max_children - the maximum number of children that 98 | ; can be alive at the same time. 99 | ; pm.process_idle_timeout - The number of seconds after which 100 | ; an idle process will be killed. 101 | ; Note: This value is mandatory. 102 | pm = dynamic 103 | 104 | ; The number of child processes to be created when pm is set to 'static' and the 105 | ; maximum number of child processes when pm is set to 'dynamic' or 'ondemand'. 106 | ; This value sets the limit on the number of simultaneous requests that will be 107 | ; served. Equivalent to the ApacheMaxClients directive with mpm_prefork. 108 | ; Equivalent to the PHP_FCGI_CHILDREN environment variable in the original PHP 109 | ; CGI. The below defaults are based on a server without much resources. Don't 110 | ; forget to tweak pm.* to fit your needs. 111 | ; Note: Used when pm is set to 'static', 'dynamic' or 'ondemand' 112 | ; Note: This value is mandatory. 113 | pm.max_children = 5 114 | 115 | ; The number of child processes created on startup. 116 | ; Note: Used only when pm is set to 'dynamic' 117 | ; Default Value: min_spare_servers + (max_spare_servers - min_spare_servers) / 2 118 | pm.start_servers = 2 119 | 120 | ; The desired minimum number of idle server processes. 121 | ; Note: Used only when pm is set to 'dynamic' 122 | ; Note: Mandatory when pm is set to 'dynamic' 123 | pm.min_spare_servers = 1 124 | 125 | ; The desired maximum number of idle server processes. 126 | ; Note: Used only when pm is set to 'dynamic' 127 | ; Note: Mandatory when pm is set to 'dynamic' 128 | pm.max_spare_servers = 3 129 | 130 | ; The number of seconds after which an idle process will be killed. 131 | ; Note: Used only when pm is set to 'ondemand' 132 | ; Default Value: 10s 133 | ;pm.process_idle_timeout = 10s; 134 | 135 | ; The number of requests each child process should execute before respawning. 136 | ; This can be useful to work around memory leaks in 3rd party libraries. For 137 | ; endless request processing specify '0'. Equivalent to PHP_FCGI_MAX_REQUESTS. 138 | ; Default Value: 0 139 | ;pm.max_requests = 500 140 | 141 | ; The URI to view the FPM status page. If this value is not set, no URI will be 142 | ; recognized as a status page. It shows the following informations: 143 | ; pool - the name of the pool; 144 | ; process manager - static, dynamic or ondemand; 145 | ; start time - the date and time FPM has started; 146 | ; start since - number of seconds since FPM has started; 147 | ; accepted conn - the number of request accepted by the pool; 148 | ; listen queue - the number of request in the queue of pending 149 | ; connections (see backlog in listen(2)); 150 | ; max listen queue - the maximum number of requests in the queue 151 | ; of pending connections since FPM has started; 152 | ; listen queue len - the size of the socket queue of pending connections; 153 | ; idle processes - the number of idle processes; 154 | ; active processes - the number of active processes; 155 | ; total processes - the number of idle + active processes; 156 | ; max active processes - the maximum number of active processes since FPM 157 | ; has started; 158 | ; max children reached - number of times, the process limit has been reached, 159 | ; when pm tries to start more children (works only for 160 | ; pm 'dynamic' and 'ondemand'); 161 | ; Value are updated in real time. 162 | ; Example output: 163 | ; pool: www 164 | ; process manager: static 165 | ; start time: 01/Jul/2011:17:53:49 +0200 166 | ; start since: 62636 167 | ; accepted conn: 190460 168 | ; listen queue: 0 169 | ; max listen queue: 1 170 | ; listen queue len: 42 171 | ; idle processes: 4 172 | ; active processes: 11 173 | ; total processes: 15 174 | ; max active processes: 12 175 | ; max children reached: 0 176 | ; 177 | ; By default the status page output is formatted as text/plain. Passing either 178 | ; 'html', 'xml' or 'json' in the query string will return the corresponding 179 | ; output syntax. Example: 180 | ; http://www.foo.bar/status 181 | ; http://www.foo.bar/status?json 182 | ; http://www.foo.bar/status?html 183 | ; http://www.foo.bar/status?xml 184 | ; 185 | ; By default the status page only outputs short status. Passing 'full' in the 186 | ; query string will also return status for each pool process. 187 | ; Example: 188 | ; http://www.foo.bar/status?full 189 | ; http://www.foo.bar/status?json&full 190 | ; http://www.foo.bar/status?html&full 191 | ; http://www.foo.bar/status?xml&full 192 | ; The Full status returns for each process: 193 | ; pid - the PID of the process; 194 | ; state - the state of the process (Idle, Running, ...); 195 | ; start time - the date and time the process has started; 196 | ; start since - the number of seconds since the process has started; 197 | ; requests - the number of requests the process has served; 198 | ; request duration - the duration in µs of the requests; 199 | ; request method - the request method (GET, POST, ...); 200 | ; request URI - the request URI with the query string; 201 | ; content length - the content length of the request (only with POST); 202 | ; user - the user (PHP_AUTH_USER) (or '-' if not set); 203 | ; script - the main script called (or '-' if not set); 204 | ; last request cpu - the %cpu the last request consumed 205 | ; it's always 0 if the process is not in Idle state 206 | ; because CPU calculation is done when the request 207 | ; processing has terminated; 208 | ; last request memory - the max amount of memory the last request consumed 209 | ; it's always 0 if the process is not in Idle state 210 | ; because memory calculation is done when the request 211 | ; processing has terminated; 212 | ; If the process is in Idle state, then informations are related to the 213 | ; last request the process has served. Otherwise informations are related to 214 | ; the current request being served. 215 | ; Example output: 216 | ; ************************ 217 | ; pid: 31330 218 | ; state: Running 219 | ; start time: 01/Jul/2011:17:53:49 +0200 220 | ; start since: 63087 221 | ; requests: 12808 222 | ; request duration: 1250261 223 | ; request method: GET 224 | ; request URI: /test_mem.php?N=10000 225 | ; content length: 0 226 | ; user: - 227 | ; script: /home/fat/web/docs/php/test_mem.php 228 | ; last request cpu: 0.00 229 | ; last request memory: 0 230 | ; 231 | ; Note: There is a real-time FPM status monitoring sample web page available 232 | ; It's available in: /usr/local/share/php/fpm/status.html 233 | ; 234 | ; Note: The value must start with a leading slash (/). The value can be 235 | ; anything, but it may not be a good idea to use the .php extension or it 236 | ; may conflict with a real PHP file. 237 | ; Default Value: not set 238 | ;pm.status_path = /status 239 | 240 | ; The ping URI to call the monitoring page of FPM. If this value is not set, no 241 | ; URI will be recognized as a ping page. This could be used to test from outside 242 | ; that FPM is alive and responding, or to 243 | ; - create a graph of FPM availability (rrd or such); 244 | ; - remove a server from a group if it is not responding (load balancing); 245 | ; - trigger alerts for the operating team (24/7). 246 | ; Note: The value must start with a leading slash (/). The value can be 247 | ; anything, but it may not be a good idea to use the .php extension or it 248 | ; may conflict with a real PHP file. 249 | ; Default Value: not set 250 | ;ping.path = /ping 251 | 252 | ; This directive may be used to customize the response of a ping request. The 253 | ; response is formatted as text/plain with a 200 response code. 254 | ; Default Value: pong 255 | ;ping.response = pong 256 | 257 | ; The access log file 258 | ; Default: not set 259 | ;access.log = log/$pool.access.log 260 | 261 | ; The access log format. 262 | ; The following syntax is allowed 263 | ; %%: the '%' character 264 | ; %C: %CPU used by the request 265 | ; it can accept the following format: 266 | ; - %{user}C for user CPU only 267 | ; - %{system}C for system CPU only 268 | ; - %{total}C for user + system CPU (default) 269 | ; %d: time taken to serve the request 270 | ; it can accept the following format: 271 | ; - %{seconds}d (default) 272 | ; - %{miliseconds}d 273 | ; - %{mili}d 274 | ; - %{microseconds}d 275 | ; - %{micro}d 276 | ; %e: an environment variable (same as $_ENV or $_SERVER) 277 | ; it must be associated with embraces to specify the name of the env 278 | ; variable. Some exemples: 279 | ; - server specifics like: %{REQUEST_METHOD}e or %{SERVER_PROTOCOL}e 280 | ; - HTTP headers like: %{HTTP_HOST}e or %{HTTP_USER_AGENT}e 281 | ; %f: script filename 282 | ; %l: content-length of the request (for POST request only) 283 | ; %m: request method 284 | ; %M: peak of memory allocated by PHP 285 | ; it can accept the following format: 286 | ; - %{bytes}M (default) 287 | ; - %{kilobytes}M 288 | ; - %{kilo}M 289 | ; - %{megabytes}M 290 | ; - %{mega}M 291 | ; %n: pool name 292 | ; %o: output header 293 | ; it must be associated with embraces to specify the name of the header: 294 | ; - %{Content-Type}o 295 | ; - %{X-Powered-By}o 296 | ; - %{Transfert-Encoding}o 297 | ; - .... 298 | ; %p: PID of the child that serviced the request 299 | ; %P: PID of the parent of the child that serviced the request 300 | ; %q: the query string 301 | ; %Q: the '?' character if query string exists 302 | ; %r: the request URI (without the query string, see %q and %Q) 303 | ; %R: remote IP address 304 | ; %s: status (response code) 305 | ; %t: server time the request was received 306 | ; it can accept a strftime(3) format: 307 | ; %d/%b/%Y:%H:%M:%S %z (default) 308 | ; The strftime(3) format must be encapsuled in a %{}t tag 309 | ; e.g. for a ISO8601 formatted timestring, use: %{%Y-%m-%dT%H:%M:%S%z}t 310 | ; %T: time the log has been written (the request has finished) 311 | ; it can accept a strftime(3) format: 312 | ; %d/%b/%Y:%H:%M:%S %z (default) 313 | ; The strftime(3) format must be encapsuled in a %{}t tag 314 | ; e.g. for a ISO8601 formatted timestring, use: %{%Y-%m-%dT%H:%M:%S%z}t 315 | ; %u: remote user 316 | ; 317 | ; Default: "%R - %u %t \"%m %r\" %s" 318 | ;access.format = "%R - %u %t \"%m %r%Q%q\" %s %f %{mili}d %{kilo}M %C%%" 319 | 320 | ; The log file for slow requests 321 | ; Default Value: not set 322 | ; Note: slowlog is mandatory if request_slowlog_timeout is set 323 | ;slowlog = log/$pool.log.slow 324 | 325 | ; The timeout for serving a single request after which a PHP backtrace will be 326 | ; dumped to the 'slowlog' file. A value of '0s' means 'off'. 327 | ; Available units: s(econds)(default), m(inutes), h(ours), or d(ays) 328 | ; Default Value: 0 329 | ;request_slowlog_timeout = 0 330 | 331 | ; Depth of slow log stack trace. 332 | ; Default Value: 20 333 | ;request_slowlog_trace_depth = 20 334 | 335 | ; The timeout for serving a single request after which the worker process will 336 | ; be killed. This option should be used when the 'max_execution_time' ini option 337 | ; does not stop script execution for some reason. A value of '0' means 'off'. 338 | ; Available units: s(econds)(default), m(inutes), h(ours), or d(ays) 339 | ; Default Value: 0 340 | ;request_terminate_timeout = 0 341 | 342 | ; Set open file descriptor rlimit. 343 | ; Default Value: system defined value 344 | ;rlimit_files = 1024 345 | 346 | ; Set max core size rlimit. 347 | ; Possible Values: 'unlimited' or an integer greater or equal to 0 348 | ; Default Value: system defined value 349 | ;rlimit_core = 0 350 | 351 | ; Chroot to this directory at the start. This value must be defined as an 352 | ; absolute path. When this value is not set, chroot is not used. 353 | ; Note: you can prefix with '$prefix' to chroot to the pool prefix or one 354 | ; of its subdirectories. If the pool prefix is not set, the global prefix 355 | ; will be used instead. 356 | ; Note: chrooting is a great security feature and should be used whenever 357 | ; possible. However, all PHP paths will be relative to the chroot 358 | ; (error_log, sessions.save_path, ...). 359 | ; Default Value: not set 360 | ;chroot = 361 | 362 | ; Chdir to this directory at the start. 363 | ; Note: relative path can be used. 364 | ; Default Value: current directory or / when chroot 365 | ;chdir = /var/www 366 | 367 | ; Redirect worker stdout and stderr into main error log. If not set, stdout and 368 | ; stderr will be redirected to /dev/null according to FastCGI specs. 369 | ; Note: on highloaded environement, this can cause some delay in the page 370 | ; process time (several ms). 371 | ; Default Value: no 372 | ;catch_workers_output = yes 373 | 374 | ; Decorate worker output with prefix and suffix containing information about 375 | ; the child that writes to the log and if stdout or stderr is used as well as 376 | ; log level and time. This options is used only if catch_workers_output is yes. 377 | ; Settings to "no" will output data as written to the stdout or stderr. 378 | ; Default value: yes 379 | ;decorate_workers_output = no 380 | 381 | ; Clear environment in FPM workers 382 | ; Prevents arbitrary environment variables from reaching FPM worker processes 383 | ; by clearing the environment in workers before env vars specified in this 384 | ; pool configuration are added. 385 | ; Setting to "no" will make all environment variables available to PHP code 386 | ; via getenv(), $_ENV and $_SERVER. 387 | ; Default Value: yes 388 | ;clear_env = no 389 | 390 | ; Limits the extensions of the main script FPM will allow to parse. This can 391 | ; prevent configuration mistakes on the web server side. You should only limit 392 | ; FPM to .php extensions to prevent malicious users to use other extensions to 393 | ; execute php code. 394 | ; Note: set an empty value to allow all extensions. 395 | ; Default Value: .php 396 | ;security.limit_extensions = .php .php3 .php4 .php5 .php7 397 | 398 | ; Pass environment variables like LD_LIBRARY_PATH. All $VARIABLEs are taken from 399 | ; the current environment. 400 | ; Default Value: clean env 401 | ;env[HOSTNAME] = $HOSTNAME 402 | ;env[PATH] = /usr/local/bin:/usr/bin:/bin 403 | ;env[TMP] = /tmp 404 | ;env[TMPDIR] = /tmp 405 | ;env[TEMP] = /tmp 406 | 407 | ; Additional php.ini defines, specific to this pool of workers. These settings 408 | ; overwrite the values previously defined in the php.ini. The directives are the 409 | ; same as the PHP SAPI: 410 | ; php_value/php_flag - you can set classic ini defines which can 411 | ; be overwritten from PHP call 'ini_set'. 412 | ; php_admin_value/php_admin_flag - these directives won't be overwritten by 413 | ; PHP call 'ini_set' 414 | ; For php_*flag, valid values are on, off, 1, 0, true, false, yes or no. 415 | 416 | ; Defining 'extension' will load the corresponding shared extension from 417 | ; extension_dir. Defining 'disable_functions' or 'disable_classes' will not 418 | ; overwrite previously defined php.ini values, but will append the new value 419 | ; instead. 420 | 421 | ; Note: path INI options can be relative and will be expanded with the prefix 422 | ; (pool, global or /usr/local) 423 | 424 | ; Default Value: nothing is defined by default except the values in php.ini and 425 | ; specified at startup with the -d argument 426 | ;php_admin_value[sendmail_path] = /usr/sbin/sendmail -t -i -f www@my.domain.com 427 | ;php_flag[display_errors] = off 428 | ;php_admin_value[error_log] = /var/log/fpm-php.www.log 429 | ;php_admin_flag[log_errors] = on 430 | ;php_admin_value[memory_limit] = 32M 431 | -------------------------------------------------------------------------------- /php-fpm/conf-7.3/php-fpm.d/www.conf.default: -------------------------------------------------------------------------------- 1 | ; Start a new pool named 'www'. 2 | ; the variable $pool can be used in any directive and will be replaced by the 3 | ; pool name ('www' here) 4 | [www] 5 | 6 | ; Per pool prefix 7 | ; It only applies on the following directives: 8 | ; - 'access.log' 9 | ; - 'slowlog' 10 | ; - 'listen' (unixsocket) 11 | ; - 'chroot' 12 | ; - 'chdir' 13 | ; - 'php_values' 14 | ; - 'php_admin_values' 15 | ; When not set, the global prefix (or NONE) applies instead. 16 | ; Note: This directive can also be relative to the global prefix. 17 | ; Default Value: none 18 | ;prefix = /path/to/pools/$pool 19 | 20 | ; Unix user/group of processes 21 | ; Note: The user is mandatory. If the group is not set, the default user's group 22 | ; will be used. 23 | user = www-data 24 | group = www-data 25 | 26 | ; The address on which to accept FastCGI requests. 27 | ; Valid syntaxes are: 28 | ; 'ip.add.re.ss:port' - to listen on a TCP socket to a specific IPv4 address on 29 | ; a specific port; 30 | ; '[ip:6:addr:ess]:port' - to listen on a TCP socket to a specific IPv6 address on 31 | ; a specific port; 32 | ; 'port' - to listen on a TCP socket to all addresses 33 | ; (IPv6 and IPv4-mapped) on a specific port; 34 | ; '/path/to/unix/socket' - to listen on a unix socket. 35 | ; Note: This value is mandatory. 36 | listen = 127.0.0.1:9000 37 | 38 | ; Set listen(2) backlog. 39 | ; Default Value: 511 (-1 on FreeBSD and OpenBSD) 40 | ;listen.backlog = 511 41 | 42 | ; Set permissions for unix socket, if one is used. In Linux, read/write 43 | ; permissions must be set in order to allow connections from a web server. Many 44 | ; BSD-derived systems allow connections regardless of permissions. 45 | ; Default Values: user and group are set as the running user 46 | ; mode is set to 0660 47 | ;listen.owner = www-data 48 | ;listen.group = www-data 49 | ;listen.mode = 0660 50 | ; When POSIX Access Control Lists are supported you can set them using 51 | ; these options, value is a comma separated list of user/group names. 52 | ; When set, listen.owner and listen.group are ignored 53 | ;listen.acl_users = 54 | ;listen.acl_groups = 55 | 56 | ; List of addresses (IPv4/IPv6) of FastCGI clients which are allowed to connect. 57 | ; Equivalent to the FCGI_WEB_SERVER_ADDRS environment variable in the original 58 | ; PHP FCGI (5.2.2+). Makes sense only with a tcp listening socket. Each address 59 | ; must be separated by a comma. If this value is left blank, connections will be 60 | ; accepted from any ip address. 61 | ; Default Value: any 62 | ;listen.allowed_clients = 127.0.0.1 63 | 64 | ; Specify the nice(2) priority to apply to the pool processes (only if set) 65 | ; The value can vary from -19 (highest priority) to 20 (lower priority) 66 | ; Note: - It will only work if the FPM master process is launched as root 67 | ; - The pool processes will inherit the master process priority 68 | ; unless it specified otherwise 69 | ; Default Value: no set 70 | ; process.priority = -19 71 | 72 | ; Set the process dumpable flag (PR_SET_DUMPABLE prctl) even if the process user 73 | ; or group is differrent than the master process user. It allows to create process 74 | ; core dump and ptrace the process for the pool user. 75 | ; Default Value: no 76 | ; process.dumpable = yes 77 | 78 | ; Choose how the process manager will control the number of child processes. 79 | ; Possible Values: 80 | ; static - a fixed number (pm.max_children) of child processes; 81 | ; dynamic - the number of child processes are set dynamically based on the 82 | ; following directives. With this process management, there will be 83 | ; always at least 1 children. 84 | ; pm.max_children - the maximum number of children that can 85 | ; be alive at the same time. 86 | ; pm.start_servers - the number of children created on startup. 87 | ; pm.min_spare_servers - the minimum number of children in 'idle' 88 | ; state (waiting to process). If the number 89 | ; of 'idle' processes is less than this 90 | ; number then some children will be created. 91 | ; pm.max_spare_servers - the maximum number of children in 'idle' 92 | ; state (waiting to process). If the number 93 | ; of 'idle' processes is greater than this 94 | ; number then some children will be killed. 95 | ; ondemand - no children are created at startup. Children will be forked when 96 | ; new requests will connect. The following parameter are used: 97 | ; pm.max_children - the maximum number of children that 98 | ; can be alive at the same time. 99 | ; pm.process_idle_timeout - The number of seconds after which 100 | ; an idle process will be killed. 101 | ; Note: This value is mandatory. 102 | pm = dynamic 103 | 104 | ; The number of child processes to be created when pm is set to 'static' and the 105 | ; maximum number of child processes when pm is set to 'dynamic' or 'ondemand'. 106 | ; This value sets the limit on the number of simultaneous requests that will be 107 | ; served. Equivalent to the ApacheMaxClients directive with mpm_prefork. 108 | ; Equivalent to the PHP_FCGI_CHILDREN environment variable in the original PHP 109 | ; CGI. The below defaults are based on a server without much resources. Don't 110 | ; forget to tweak pm.* to fit your needs. 111 | ; Note: Used when pm is set to 'static', 'dynamic' or 'ondemand' 112 | ; Note: This value is mandatory. 113 | pm.max_children = 5 114 | 115 | ; The number of child processes created on startup. 116 | ; Note: Used only when pm is set to 'dynamic' 117 | ; Default Value: min_spare_servers + (max_spare_servers - min_spare_servers) / 2 118 | pm.start_servers = 2 119 | 120 | ; The desired minimum number of idle server processes. 121 | ; Note: Used only when pm is set to 'dynamic' 122 | ; Note: Mandatory when pm is set to 'dynamic' 123 | pm.min_spare_servers = 1 124 | 125 | ; The desired maximum number of idle server processes. 126 | ; Note: Used only when pm is set to 'dynamic' 127 | ; Note: Mandatory when pm is set to 'dynamic' 128 | pm.max_spare_servers = 3 129 | 130 | ; The number of seconds after which an idle process will be killed. 131 | ; Note: Used only when pm is set to 'ondemand' 132 | ; Default Value: 10s 133 | ;pm.process_idle_timeout = 10s; 134 | 135 | ; The number of requests each child process should execute before respawning. 136 | ; This can be useful to work around memory leaks in 3rd party libraries. For 137 | ; endless request processing specify '0'. Equivalent to PHP_FCGI_MAX_REQUESTS. 138 | ; Default Value: 0 139 | ;pm.max_requests = 500 140 | 141 | ; The URI to view the FPM status page. If this value is not set, no URI will be 142 | ; recognized as a status page. It shows the following informations: 143 | ; pool - the name of the pool; 144 | ; process manager - static, dynamic or ondemand; 145 | ; start time - the date and time FPM has started; 146 | ; start since - number of seconds since FPM has started; 147 | ; accepted conn - the number of request accepted by the pool; 148 | ; listen queue - the number of request in the queue of pending 149 | ; connections (see backlog in listen(2)); 150 | ; max listen queue - the maximum number of requests in the queue 151 | ; of pending connections since FPM has started; 152 | ; listen queue len - the size of the socket queue of pending connections; 153 | ; idle processes - the number of idle processes; 154 | ; active processes - the number of active processes; 155 | ; total processes - the number of idle + active processes; 156 | ; max active processes - the maximum number of active processes since FPM 157 | ; has started; 158 | ; max children reached - number of times, the process limit has been reached, 159 | ; when pm tries to start more children (works only for 160 | ; pm 'dynamic' and 'ondemand'); 161 | ; Value are updated in real time. 162 | ; Example output: 163 | ; pool: www 164 | ; process manager: static 165 | ; start time: 01/Jul/2011:17:53:49 +0200 166 | ; start since: 62636 167 | ; accepted conn: 190460 168 | ; listen queue: 0 169 | ; max listen queue: 1 170 | ; listen queue len: 42 171 | ; idle processes: 4 172 | ; active processes: 11 173 | ; total processes: 15 174 | ; max active processes: 12 175 | ; max children reached: 0 176 | ; 177 | ; By default the status page output is formatted as text/plain. Passing either 178 | ; 'html', 'xml' or 'json' in the query string will return the corresponding 179 | ; output syntax. Example: 180 | ; http://www.foo.bar/status 181 | ; http://www.foo.bar/status?json 182 | ; http://www.foo.bar/status?html 183 | ; http://www.foo.bar/status?xml 184 | ; 185 | ; By default the status page only outputs short status. Passing 'full' in the 186 | ; query string will also return status for each pool process. 187 | ; Example: 188 | ; http://www.foo.bar/status?full 189 | ; http://www.foo.bar/status?json&full 190 | ; http://www.foo.bar/status?html&full 191 | ; http://www.foo.bar/status?xml&full 192 | ; The Full status returns for each process: 193 | ; pid - the PID of the process; 194 | ; state - the state of the process (Idle, Running, ...); 195 | ; start time - the date and time the process has started; 196 | ; start since - the number of seconds since the process has started; 197 | ; requests - the number of requests the process has served; 198 | ; request duration - the duration in µs of the requests; 199 | ; request method - the request method (GET, POST, ...); 200 | ; request URI - the request URI with the query string; 201 | ; content length - the content length of the request (only with POST); 202 | ; user - the user (PHP_AUTH_USER) (or '-' if not set); 203 | ; script - the main script called (or '-' if not set); 204 | ; last request cpu - the %cpu the last request consumed 205 | ; it's always 0 if the process is not in Idle state 206 | ; because CPU calculation is done when the request 207 | ; processing has terminated; 208 | ; last request memory - the max amount of memory the last request consumed 209 | ; it's always 0 if the process is not in Idle state 210 | ; because memory calculation is done when the request 211 | ; processing has terminated; 212 | ; If the process is in Idle state, then informations are related to the 213 | ; last request the process has served. Otherwise informations are related to 214 | ; the current request being served. 215 | ; Example output: 216 | ; ************************ 217 | ; pid: 31330 218 | ; state: Running 219 | ; start time: 01/Jul/2011:17:53:49 +0200 220 | ; start since: 63087 221 | ; requests: 12808 222 | ; request duration: 1250261 223 | ; request method: GET 224 | ; request URI: /test_mem.php?N=10000 225 | ; content length: 0 226 | ; user: - 227 | ; script: /home/fat/web/docs/php/test_mem.php 228 | ; last request cpu: 0.00 229 | ; last request memory: 0 230 | ; 231 | ; Note: There is a real-time FPM status monitoring sample web page available 232 | ; It's available in: /usr/local/share/php/fpm/status.html 233 | ; 234 | ; Note: The value must start with a leading slash (/). The value can be 235 | ; anything, but it may not be a good idea to use the .php extension or it 236 | ; may conflict with a real PHP file. 237 | ; Default Value: not set 238 | ;pm.status_path = /status 239 | 240 | ; The ping URI to call the monitoring page of FPM. If this value is not set, no 241 | ; URI will be recognized as a ping page. This could be used to test from outside 242 | ; that FPM is alive and responding, or to 243 | ; - create a graph of FPM availability (rrd or such); 244 | ; - remove a server from a group if it is not responding (load balancing); 245 | ; - trigger alerts for the operating team (24/7). 246 | ; Note: The value must start with a leading slash (/). The value can be 247 | ; anything, but it may not be a good idea to use the .php extension or it 248 | ; may conflict with a real PHP file. 249 | ; Default Value: not set 250 | ;ping.path = /ping 251 | 252 | ; This directive may be used to customize the response of a ping request. The 253 | ; response is formatted as text/plain with a 200 response code. 254 | ; Default Value: pong 255 | ;ping.response = pong 256 | 257 | ; The access log file 258 | ; Default: not set 259 | ;access.log = log/$pool.access.log 260 | 261 | ; The access log format. 262 | ; The following syntax is allowed 263 | ; %%: the '%' character 264 | ; %C: %CPU used by the request 265 | ; it can accept the following format: 266 | ; - %{user}C for user CPU only 267 | ; - %{system}C for system CPU only 268 | ; - %{total}C for user + system CPU (default) 269 | ; %d: time taken to serve the request 270 | ; it can accept the following format: 271 | ; - %{seconds}d (default) 272 | ; - %{miliseconds}d 273 | ; - %{mili}d 274 | ; - %{microseconds}d 275 | ; - %{micro}d 276 | ; %e: an environment variable (same as $_ENV or $_SERVER) 277 | ; it must be associated with embraces to specify the name of the env 278 | ; variable. Some exemples: 279 | ; - server specifics like: %{REQUEST_METHOD}e or %{SERVER_PROTOCOL}e 280 | ; - HTTP headers like: %{HTTP_HOST}e or %{HTTP_USER_AGENT}e 281 | ; %f: script filename 282 | ; %l: content-length of the request (for POST request only) 283 | ; %m: request method 284 | ; %M: peak of memory allocated by PHP 285 | ; it can accept the following format: 286 | ; - %{bytes}M (default) 287 | ; - %{kilobytes}M 288 | ; - %{kilo}M 289 | ; - %{megabytes}M 290 | ; - %{mega}M 291 | ; %n: pool name 292 | ; %o: output header 293 | ; it must be associated with embraces to specify the name of the header: 294 | ; - %{Content-Type}o 295 | ; - %{X-Powered-By}o 296 | ; - %{Transfert-Encoding}o 297 | ; - .... 298 | ; %p: PID of the child that serviced the request 299 | ; %P: PID of the parent of the child that serviced the request 300 | ; %q: the query string 301 | ; %Q: the '?' character if query string exists 302 | ; %r: the request URI (without the query string, see %q and %Q) 303 | ; %R: remote IP address 304 | ; %s: status (response code) 305 | ; %t: server time the request was received 306 | ; it can accept a strftime(3) format: 307 | ; %d/%b/%Y:%H:%M:%S %z (default) 308 | ; The strftime(3) format must be encapsuled in a %{}t tag 309 | ; e.g. for a ISO8601 formatted timestring, use: %{%Y-%m-%dT%H:%M:%S%z}t 310 | ; %T: time the log has been written (the request has finished) 311 | ; it can accept a strftime(3) format: 312 | ; %d/%b/%Y:%H:%M:%S %z (default) 313 | ; The strftime(3) format must be encapsuled in a %{}t tag 314 | ; e.g. for a ISO8601 formatted timestring, use: %{%Y-%m-%dT%H:%M:%S%z}t 315 | ; %u: remote user 316 | ; 317 | ; Default: "%R - %u %t \"%m %r\" %s" 318 | ;access.format = "%R - %u %t \"%m %r%Q%q\" %s %f %{mili}d %{kilo}M %C%%" 319 | 320 | ; The log file for slow requests 321 | ; Default Value: not set 322 | ; Note: slowlog is mandatory if request_slowlog_timeout is set 323 | ;slowlog = log/$pool.log.slow 324 | 325 | ; The timeout for serving a single request after which a PHP backtrace will be 326 | ; dumped to the 'slowlog' file. A value of '0s' means 'off'. 327 | ; Available units: s(econds)(default), m(inutes), h(ours), or d(ays) 328 | ; Default Value: 0 329 | ;request_slowlog_timeout = 0 330 | 331 | ; Depth of slow log stack trace. 332 | ; Default Value: 20 333 | ;request_slowlog_trace_depth = 20 334 | 335 | ; The timeout for serving a single request after which the worker process will 336 | ; be killed. This option should be used when the 'max_execution_time' ini option 337 | ; does not stop script execution for some reason. A value of '0' means 'off'. 338 | ; Available units: s(econds)(default), m(inutes), h(ours), or d(ays) 339 | ; Default Value: 0 340 | ;request_terminate_timeout = 0 341 | 342 | ; Set open file descriptor rlimit. 343 | ; Default Value: system defined value 344 | ;rlimit_files = 1024 345 | 346 | ; Set max core size rlimit. 347 | ; Possible Values: 'unlimited' or an integer greater or equal to 0 348 | ; Default Value: system defined value 349 | ;rlimit_core = 0 350 | 351 | ; Chroot to this directory at the start. This value must be defined as an 352 | ; absolute path. When this value is not set, chroot is not used. 353 | ; Note: you can prefix with '$prefix' to chroot to the pool prefix or one 354 | ; of its subdirectories. If the pool prefix is not set, the global prefix 355 | ; will be used instead. 356 | ; Note: chrooting is a great security feature and should be used whenever 357 | ; possible. However, all PHP paths will be relative to the chroot 358 | ; (error_log, sessions.save_path, ...). 359 | ; Default Value: not set 360 | ;chroot = 361 | 362 | ; Chdir to this directory at the start. 363 | ; Note: relative path can be used. 364 | ; Default Value: current directory or / when chroot 365 | ;chdir = /var/www 366 | 367 | ; Redirect worker stdout and stderr into main error log. If not set, stdout and 368 | ; stderr will be redirected to /dev/null according to FastCGI specs. 369 | ; Note: on highloaded environement, this can cause some delay in the page 370 | ; process time (several ms). 371 | ; Default Value: no 372 | ;catch_workers_output = yes 373 | 374 | ; Decorate worker output with prefix and suffix containing information about 375 | ; the child that writes to the log and if stdout or stderr is used as well as 376 | ; log level and time. This options is used only if catch_workers_output is yes. 377 | ; Settings to "no" will output data as written to the stdout or stderr. 378 | ; Default value: yes 379 | ;decorate_workers_output = no 380 | 381 | ; Clear environment in FPM workers 382 | ; Prevents arbitrary environment variables from reaching FPM worker processes 383 | ; by clearing the environment in workers before env vars specified in this 384 | ; pool configuration are added. 385 | ; Setting to "no" will make all environment variables available to PHP code 386 | ; via getenv(), $_ENV and $_SERVER. 387 | ; Default Value: yes 388 | ;clear_env = no 389 | 390 | ; Limits the extensions of the main script FPM will allow to parse. This can 391 | ; prevent configuration mistakes on the web server side. You should only limit 392 | ; FPM to .php extensions to prevent malicious users to use other extensions to 393 | ; execute php code. 394 | ; Note: set an empty value to allow all extensions. 395 | ; Default Value: .php 396 | ;security.limit_extensions = .php .php3 .php4 .php5 .php7 397 | 398 | ; Pass environment variables like LD_LIBRARY_PATH. All $VARIABLEs are taken from 399 | ; the current environment. 400 | ; Default Value: clean env 401 | ;env[HOSTNAME] = $HOSTNAME 402 | ;env[PATH] = /usr/local/bin:/usr/bin:/bin 403 | ;env[TMP] = /tmp 404 | ;env[TMPDIR] = /tmp 405 | ;env[TEMP] = /tmp 406 | 407 | ; Additional php.ini defines, specific to this pool of workers. These settings 408 | ; overwrite the values previously defined in the php.ini. The directives are the 409 | ; same as the PHP SAPI: 410 | ; php_value/php_flag - you can set classic ini defines which can 411 | ; be overwritten from PHP call 'ini_set'. 412 | ; php_admin_value/php_admin_flag - these directives won't be overwritten by 413 | ; PHP call 'ini_set' 414 | ; For php_*flag, valid values are on, off, 1, 0, true, false, yes or no. 415 | 416 | ; Defining 'extension' will load the corresponding shared extension from 417 | ; extension_dir. Defining 'disable_functions' or 'disable_classes' will not 418 | ; overwrite previously defined php.ini values, but will append the new value 419 | ; instead. 420 | 421 | ; Note: path INI options can be relative and will be expanded with the prefix 422 | ; (pool, global or /usr/local) 423 | 424 | ; Default Value: nothing is defined by default except the values in php.ini and 425 | ; specified at startup with the -d argument 426 | ;php_admin_value[sendmail_path] = /usr/sbin/sendmail -t -i -f www@my.domain.com 427 | ;php_flag[display_errors] = off 428 | ;php_admin_value[error_log] = /var/log/fpm-php.www.log 429 | ;php_admin_flag[log_errors] = on 430 | ;php_admin_value[memory_limit] = 32M 431 | -------------------------------------------------------------------------------- /php-fpm/conf-7.4/php-fpm.d/www.conf: -------------------------------------------------------------------------------- 1 | ; Start a new pool named 'www'. 2 | ; the variable $pool can be used in any directive and will be replaced by the 3 | ; pool name ('www' here) 4 | [www] 5 | 6 | ; Per pool prefix 7 | ; It only applies on the following directives: 8 | ; - 'access.log' 9 | ; - 'slowlog' 10 | ; - 'listen' (unixsocket) 11 | ; - 'chroot' 12 | ; - 'chdir' 13 | ; - 'php_values' 14 | ; - 'php_admin_values' 15 | ; When not set, the global prefix (or NONE) applies instead. 16 | ; Note: This directive can also be relative to the global prefix. 17 | ; Default Value: none 18 | ;prefix = /path/to/pools/$pool 19 | 20 | ; Unix user/group of processes 21 | ; Note: The user is mandatory. If the group is not set, the default user's group 22 | ; will be used. 23 | user = www-data 24 | group = www-data 25 | 26 | ; The address on which to accept FastCGI requests. 27 | ; Valid syntaxes are: 28 | ; 'ip.add.re.ss:port' - to listen on a TCP socket to a specific IPv4 address on 29 | ; a specific port; 30 | ; '[ip:6:addr:ess]:port' - to listen on a TCP socket to a specific IPv6 address on 31 | ; a specific port; 32 | ; 'port' - to listen on a TCP socket to all addresses 33 | ; (IPv6 and IPv4-mapped) on a specific port; 34 | ; '/path/to/unix/socket' - to listen on a unix socket. 35 | ; Note: This value is mandatory. 36 | listen = 127.0.0.1:9000 37 | 38 | ; Set listen(2) backlog. 39 | ; Default Value: 511 (-1 on FreeBSD and OpenBSD) 40 | ;listen.backlog = 511 41 | 42 | ; Set permissions for unix socket, if one is used. In Linux, read/write 43 | ; permissions must be set in order to allow connections from a web server. Many 44 | ; BSD-derived systems allow connections regardless of permissions. 45 | ; Default Values: user and group are set as the running user 46 | ; mode is set to 0660 47 | ;listen.owner = www-data 48 | ;listen.group = www-data 49 | ;listen.mode = 0660 50 | ; When POSIX Access Control Lists are supported you can set them using 51 | ; these options, value is a comma separated list of user/group names. 52 | ; When set, listen.owner and listen.group are ignored 53 | ;listen.acl_users = 54 | ;listen.acl_groups = 55 | 56 | ; List of addresses (IPv4/IPv6) of FastCGI clients which are allowed to connect. 57 | ; Equivalent to the FCGI_WEB_SERVER_ADDRS environment variable in the original 58 | ; PHP FCGI (5.2.2+). Makes sense only with a tcp listening socket. Each address 59 | ; must be separated by a comma. If this value is left blank, connections will be 60 | ; accepted from any ip address. 61 | ; Default Value: any 62 | ;listen.allowed_clients = 127.0.0.1 63 | 64 | ; Specify the nice(2) priority to apply to the pool processes (only if set) 65 | ; The value can vary from -19 (highest priority) to 20 (lower priority) 66 | ; Note: - It will only work if the FPM master process is launched as root 67 | ; - The pool processes will inherit the master process priority 68 | ; unless it specified otherwise 69 | ; Default Value: no set 70 | ; process.priority = -19 71 | 72 | ; Set the process dumpable flag (PR_SET_DUMPABLE prctl) even if the process user 73 | ; or group is differrent than the master process user. It allows to create process 74 | ; core dump and ptrace the process for the pool user. 75 | ; Default Value: no 76 | ; process.dumpable = yes 77 | 78 | ; Choose how the process manager will control the number of child processes. 79 | ; Possible Values: 80 | ; static - a fixed number (pm.max_children) of child processes; 81 | ; dynamic - the number of child processes are set dynamically based on the 82 | ; following directives. With this process management, there will be 83 | ; always at least 1 children. 84 | ; pm.max_children - the maximum number of children that can 85 | ; be alive at the same time. 86 | ; pm.start_servers - the number of children created on startup. 87 | ; pm.min_spare_servers - the minimum number of children in 'idle' 88 | ; state (waiting to process). If the number 89 | ; of 'idle' processes is less than this 90 | ; number then some children will be created. 91 | ; pm.max_spare_servers - the maximum number of children in 'idle' 92 | ; state (waiting to process). If the number 93 | ; of 'idle' processes is greater than this 94 | ; number then some children will be killed. 95 | ; ondemand - no children are created at startup. Children will be forked when 96 | ; new requests will connect. The following parameter are used: 97 | ; pm.max_children - the maximum number of children that 98 | ; can be alive at the same time. 99 | ; pm.process_idle_timeout - The number of seconds after which 100 | ; an idle process will be killed. 101 | ; Note: This value is mandatory. 102 | pm = dynamic 103 | 104 | ; The number of child processes to be created when pm is set to 'static' and the 105 | ; maximum number of child processes when pm is set to 'dynamic' or 'ondemand'. 106 | ; This value sets the limit on the number of simultaneous requests that will be 107 | ; served. Equivalent to the ApacheMaxClients directive with mpm_prefork. 108 | ; Equivalent to the PHP_FCGI_CHILDREN environment variable in the original PHP 109 | ; CGI. The below defaults are based on a server without much resources. Don't 110 | ; forget to tweak pm.* to fit your needs. 111 | ; Note: Used when pm is set to 'static', 'dynamic' or 'ondemand' 112 | ; Note: This value is mandatory. 113 | pm.max_children = 5 114 | 115 | ; The number of child processes created on startup. 116 | ; Note: Used only when pm is set to 'dynamic' 117 | ; Default Value: (min_spare_servers + max_spare_servers) / 2 118 | pm.start_servers = 2 119 | 120 | ; The desired minimum number of idle server processes. 121 | ; Note: Used only when pm is set to 'dynamic' 122 | ; Note: Mandatory when pm is set to 'dynamic' 123 | pm.min_spare_servers = 1 124 | 125 | ; The desired maximum number of idle server processes. 126 | ; Note: Used only when pm is set to 'dynamic' 127 | ; Note: Mandatory when pm is set to 'dynamic' 128 | pm.max_spare_servers = 3 129 | 130 | ; The number of seconds after which an idle process will be killed. 131 | ; Note: Used only when pm is set to 'ondemand' 132 | ; Default Value: 10s 133 | ;pm.process_idle_timeout = 10s; 134 | 135 | ; The number of requests each child process should execute before respawning. 136 | ; This can be useful to work around memory leaks in 3rd party libraries. For 137 | ; endless request processing specify '0'. Equivalent to PHP_FCGI_MAX_REQUESTS. 138 | ; Default Value: 0 139 | ;pm.max_requests = 500 140 | 141 | ; The URI to view the FPM status page. If this value is not set, no URI will be 142 | ; recognized as a status page. It shows the following informations: 143 | ; pool - the name of the pool; 144 | ; process manager - static, dynamic or ondemand; 145 | ; start time - the date and time FPM has started; 146 | ; start since - number of seconds since FPM has started; 147 | ; accepted conn - the number of request accepted by the pool; 148 | ; listen queue - the number of request in the queue of pending 149 | ; connections (see backlog in listen(2)); 150 | ; max listen queue - the maximum number of requests in the queue 151 | ; of pending connections since FPM has started; 152 | ; listen queue len - the size of the socket queue of pending connections; 153 | ; idle processes - the number of idle processes; 154 | ; active processes - the number of active processes; 155 | ; total processes - the number of idle + active processes; 156 | ; max active processes - the maximum number of active processes since FPM 157 | ; has started; 158 | ; max children reached - number of times, the process limit has been reached, 159 | ; when pm tries to start more children (works only for 160 | ; pm 'dynamic' and 'ondemand'); 161 | ; Value are updated in real time. 162 | ; Example output: 163 | ; pool: www 164 | ; process manager: static 165 | ; start time: 01/Jul/2011:17:53:49 +0200 166 | ; start since: 62636 167 | ; accepted conn: 190460 168 | ; listen queue: 0 169 | ; max listen queue: 1 170 | ; listen queue len: 42 171 | ; idle processes: 4 172 | ; active processes: 11 173 | ; total processes: 15 174 | ; max active processes: 12 175 | ; max children reached: 0 176 | ; 177 | ; By default the status page output is formatted as text/plain. Passing either 178 | ; 'html', 'xml' or 'json' in the query string will return the corresponding 179 | ; output syntax. Example: 180 | ; http://www.foo.bar/status 181 | ; http://www.foo.bar/status?json 182 | ; http://www.foo.bar/status?html 183 | ; http://www.foo.bar/status?xml 184 | ; 185 | ; By default the status page only outputs short status. Passing 'full' in the 186 | ; query string will also return status for each pool process. 187 | ; Example: 188 | ; http://www.foo.bar/status?full 189 | ; http://www.foo.bar/status?json&full 190 | ; http://www.foo.bar/status?html&full 191 | ; http://www.foo.bar/status?xml&full 192 | ; The Full status returns for each process: 193 | ; pid - the PID of the process; 194 | ; state - the state of the process (Idle, Running, ...); 195 | ; start time - the date and time the process has started; 196 | ; start since - the number of seconds since the process has started; 197 | ; requests - the number of requests the process has served; 198 | ; request duration - the duration in µs of the requests; 199 | ; request method - the request method (GET, POST, ...); 200 | ; request URI - the request URI with the query string; 201 | ; content length - the content length of the request (only with POST); 202 | ; user - the user (PHP_AUTH_USER) (or '-' if not set); 203 | ; script - the main script called (or '-' if not set); 204 | ; last request cpu - the %cpu the last request consumed 205 | ; it's always 0 if the process is not in Idle state 206 | ; because CPU calculation is done when the request 207 | ; processing has terminated; 208 | ; last request memory - the max amount of memory the last request consumed 209 | ; it's always 0 if the process is not in Idle state 210 | ; because memory calculation is done when the request 211 | ; processing has terminated; 212 | ; If the process is in Idle state, then informations are related to the 213 | ; last request the process has served. Otherwise informations are related to 214 | ; the current request being served. 215 | ; Example output: 216 | ; ************************ 217 | ; pid: 31330 218 | ; state: Running 219 | ; start time: 01/Jul/2011:17:53:49 +0200 220 | ; start since: 63087 221 | ; requests: 12808 222 | ; request duration: 1250261 223 | ; request method: GET 224 | ; request URI: /test_mem.php?N=10000 225 | ; content length: 0 226 | ; user: - 227 | ; script: /home/fat/web/docs/php/test_mem.php 228 | ; last request cpu: 0.00 229 | ; last request memory: 0 230 | ; 231 | ; Note: There is a real-time FPM status monitoring sample web page available 232 | ; It's available in: /usr/local/share/php/fpm/status.html 233 | ; 234 | ; Note: The value must start with a leading slash (/). The value can be 235 | ; anything, but it may not be a good idea to use the .php extension or it 236 | ; may conflict with a real PHP file. 237 | ; Default Value: not set 238 | ;pm.status_path = /status 239 | 240 | ; The ping URI to call the monitoring page of FPM. If this value is not set, no 241 | ; URI will be recognized as a ping page. This could be used to test from outside 242 | ; that FPM is alive and responding, or to 243 | ; - create a graph of FPM availability (rrd or such); 244 | ; - remove a server from a group if it is not responding (load balancing); 245 | ; - trigger alerts for the operating team (24/7). 246 | ; Note: The value must start with a leading slash (/). The value can be 247 | ; anything, but it may not be a good idea to use the .php extension or it 248 | ; may conflict with a real PHP file. 249 | ; Default Value: not set 250 | ;ping.path = /ping 251 | 252 | ; This directive may be used to customize the response of a ping request. The 253 | ; response is formatted as text/plain with a 200 response code. 254 | ; Default Value: pong 255 | ;ping.response = pong 256 | 257 | ; The access log file 258 | ; Default: not set 259 | ;access.log = log/$pool.access.log 260 | 261 | ; The access log format. 262 | ; The following syntax is allowed 263 | ; %%: the '%' character 264 | ; %C: %CPU used by the request 265 | ; it can accept the following format: 266 | ; - %{user}C for user CPU only 267 | ; - %{system}C for system CPU only 268 | ; - %{total}C for user + system CPU (default) 269 | ; %d: time taken to serve the request 270 | ; it can accept the following format: 271 | ; - %{seconds}d (default) 272 | ; - %{miliseconds}d 273 | ; - %{mili}d 274 | ; - %{microseconds}d 275 | ; - %{micro}d 276 | ; %e: an environment variable (same as $_ENV or $_SERVER) 277 | ; it must be associated with embraces to specify the name of the env 278 | ; variable. Some exemples: 279 | ; - server specifics like: %{REQUEST_METHOD}e or %{SERVER_PROTOCOL}e 280 | ; - HTTP headers like: %{HTTP_HOST}e or %{HTTP_USER_AGENT}e 281 | ; %f: script filename 282 | ; %l: content-length of the request (for POST request only) 283 | ; %m: request method 284 | ; %M: peak of memory allocated by PHP 285 | ; it can accept the following format: 286 | ; - %{bytes}M (default) 287 | ; - %{kilobytes}M 288 | ; - %{kilo}M 289 | ; - %{megabytes}M 290 | ; - %{mega}M 291 | ; %n: pool name 292 | ; %o: output header 293 | ; it must be associated with embraces to specify the name of the header: 294 | ; - %{Content-Type}o 295 | ; - %{X-Powered-By}o 296 | ; - %{Transfert-Encoding}o 297 | ; - .... 298 | ; %p: PID of the child that serviced the request 299 | ; %P: PID of the parent of the child that serviced the request 300 | ; %q: the query string 301 | ; %Q: the '?' character if query string exists 302 | ; %r: the request URI (without the query string, see %q and %Q) 303 | ; %R: remote IP address 304 | ; %s: status (response code) 305 | ; %t: server time the request was received 306 | ; it can accept a strftime(3) format: 307 | ; %d/%b/%Y:%H:%M:%S %z (default) 308 | ; The strftime(3) format must be encapsuled in a %{}t tag 309 | ; e.g. for a ISO8601 formatted timestring, use: %{%Y-%m-%dT%H:%M:%S%z}t 310 | ; %T: time the log has been written (the request has finished) 311 | ; it can accept a strftime(3) format: 312 | ; %d/%b/%Y:%H:%M:%S %z (default) 313 | ; The strftime(3) format must be encapsuled in a %{}t tag 314 | ; e.g. for a ISO8601 formatted timestring, use: %{%Y-%m-%dT%H:%M:%S%z}t 315 | ; %u: remote user 316 | ; 317 | ; Default: "%R - %u %t \"%m %r\" %s" 318 | ;access.format = "%R - %u %t \"%m %r%Q%q\" %s %f %{mili}d %{kilo}M %C%%" 319 | 320 | ; The log file for slow requests 321 | ; Default Value: not set 322 | ; Note: slowlog is mandatory if request_slowlog_timeout is set 323 | ;slowlog = log/$pool.log.slow 324 | 325 | ; The timeout for serving a single request after which a PHP backtrace will be 326 | ; dumped to the 'slowlog' file. A value of '0s' means 'off'. 327 | ; Available units: s(econds)(default), m(inutes), h(ours), or d(ays) 328 | ; Default Value: 0 329 | ;request_slowlog_timeout = 0 330 | 331 | ; Depth of slow log stack trace. 332 | ; Default Value: 20 333 | ;request_slowlog_trace_depth = 20 334 | 335 | ; The timeout for serving a single request after which the worker process will 336 | ; be killed. This option should be used when the 'max_execution_time' ini option 337 | ; does not stop script execution for some reason. A value of '0' means 'off'. 338 | ; Available units: s(econds)(default), m(inutes), h(ours), or d(ays) 339 | ; Default Value: 0 340 | ;request_terminate_timeout = 0 341 | 342 | ; The timeout set by 'request_terminate_timeout' ini option is not engaged after 343 | ; application calls 'fastcgi_finish_request' or when application has finished and 344 | ; shutdown functions are being called (registered via register_shutdown_function). 345 | ; This option will enable timeout limit to be applied unconditionally 346 | ; even in such cases. 347 | ; Default Value: no 348 | ;request_terminate_timeout_track_finished = no 349 | 350 | ; Set open file descriptor rlimit. 351 | ; Default Value: system defined value 352 | ;rlimit_files = 1024 353 | 354 | ; Set max core size rlimit. 355 | ; Possible Values: 'unlimited' or an integer greater or equal to 0 356 | ; Default Value: system defined value 357 | ;rlimit_core = 0 358 | 359 | ; Chroot to this directory at the start. This value must be defined as an 360 | ; absolute path. When this value is not set, chroot is not used. 361 | ; Note: you can prefix with '$prefix' to chroot to the pool prefix or one 362 | ; of its subdirectories. If the pool prefix is not set, the global prefix 363 | ; will be used instead. 364 | ; Note: chrooting is a great security feature and should be used whenever 365 | ; possible. However, all PHP paths will be relative to the chroot 366 | ; (error_log, sessions.save_path, ...). 367 | ; Default Value: not set 368 | ;chroot = 369 | 370 | ; Chdir to this directory at the start. 371 | ; Note: relative path can be used. 372 | ; Default Value: current directory or / when chroot 373 | ;chdir = /var/www 374 | 375 | ; Redirect worker stdout and stderr into main error log. If not set, stdout and 376 | ; stderr will be redirected to /dev/null according to FastCGI specs. 377 | ; Note: on highloaded environement, this can cause some delay in the page 378 | ; process time (several ms). 379 | ; Default Value: no 380 | ;catch_workers_output = yes 381 | 382 | ; Decorate worker output with prefix and suffix containing information about 383 | ; the child that writes to the log and if stdout or stderr is used as well as 384 | ; log level and time. This options is used only if catch_workers_output is yes. 385 | ; Settings to "no" will output data as written to the stdout or stderr. 386 | ; Default value: yes 387 | ;decorate_workers_output = no 388 | 389 | ; Clear environment in FPM workers 390 | ; Prevents arbitrary environment variables from reaching FPM worker processes 391 | ; by clearing the environment in workers before env vars specified in this 392 | ; pool configuration are added. 393 | ; Setting to "no" will make all environment variables available to PHP code 394 | ; via getenv(), $_ENV and $_SERVER. 395 | ; Default Value: yes 396 | ;clear_env = no 397 | 398 | ; Limits the extensions of the main script FPM will allow to parse. This can 399 | ; prevent configuration mistakes on the web server side. You should only limit 400 | ; FPM to .php extensions to prevent malicious users to use other extensions to 401 | ; execute php code. 402 | ; Note: set an empty value to allow all extensions. 403 | ; Default Value: .php 404 | ;security.limit_extensions = .php .php3 .php4 .php5 .php7 405 | 406 | ; Pass environment variables like LD_LIBRARY_PATH. All $VARIABLEs are taken from 407 | ; the current environment. 408 | ; Default Value: clean env 409 | ;env[HOSTNAME] = $HOSTNAME 410 | ;env[PATH] = /usr/local/bin:/usr/bin:/bin 411 | ;env[TMP] = /tmp 412 | ;env[TMPDIR] = /tmp 413 | ;env[TEMP] = /tmp 414 | 415 | ; Additional php.ini defines, specific to this pool of workers. These settings 416 | ; overwrite the values previously defined in the php.ini. The directives are the 417 | ; same as the PHP SAPI: 418 | ; php_value/php_flag - you can set classic ini defines which can 419 | ; be overwritten from PHP call 'ini_set'. 420 | ; php_admin_value/php_admin_flag - these directives won't be overwritten by 421 | ; PHP call 'ini_set' 422 | ; For php_*flag, valid values are on, off, 1, 0, true, false, yes or no. 423 | 424 | ; Defining 'extension' will load the corresponding shared extension from 425 | ; extension_dir. Defining 'disable_functions' or 'disable_classes' will not 426 | ; overwrite previously defined php.ini values, but will append the new value 427 | ; instead. 428 | 429 | ; Note: path INI options can be relative and will be expanded with the prefix 430 | ; (pool, global or /usr/local) 431 | 432 | ; Default Value: nothing is defined by default except the values in php.ini and 433 | ; specified at startup with the -d argument 434 | ;php_admin_value[sendmail_path] = /usr/sbin/sendmail -t -i -f www@my.domain.com 435 | ;php_flag[display_errors] = off 436 | ;php_admin_value[error_log] = /var/log/fpm-php.www.log 437 | ;php_admin_flag[log_errors] = on 438 | ;php_admin_value[memory_limit] = 32M 439 | -------------------------------------------------------------------------------- /php-fpm/conf-8.0/php-fpm.d/www.conf: -------------------------------------------------------------------------------- 1 | ; Start a new pool named 'www'. 2 | ; the variable $pool can be used in any directive and will be replaced by the 3 | ; pool name ('www' here) 4 | [www] 5 | 6 | ; Per pool prefix 7 | ; It only applies on the following directives: 8 | ; - 'access.log' 9 | ; - 'slowlog' 10 | ; - 'listen' (unixsocket) 11 | ; - 'chroot' 12 | ; - 'chdir' 13 | ; - 'php_values' 14 | ; - 'php_admin_values' 15 | ; When not set, the global prefix (or NONE) applies instead. 16 | ; Note: This directive can also be relative to the global prefix. 17 | ; Default Value: none 18 | ;prefix = /path/to/pools/$pool 19 | 20 | ; Unix user/group of processes 21 | ; Note: The user is mandatory. If the group is not set, the default user's group 22 | ; will be used. 23 | user = www-data 24 | group = www-data 25 | 26 | ; The address on which to accept FastCGI requests. 27 | ; Valid syntaxes are: 28 | ; 'ip.add.re.ss:port' - to listen on a TCP socket to a specific IPv4 address on 29 | ; a specific port; 30 | ; '[ip:6:addr:ess]:port' - to listen on a TCP socket to a specific IPv6 address on 31 | ; a specific port; 32 | ; 'port' - to listen on a TCP socket to all addresses 33 | ; (IPv6 and IPv4-mapped) on a specific port; 34 | ; '/path/to/unix/socket' - to listen on a unix socket. 35 | ; Note: This value is mandatory. 36 | listen = 127.0.0.1:9000 37 | 38 | ; Set listen(2) backlog. 39 | ; Default Value: 511 (-1 on FreeBSD and OpenBSD) 40 | ;listen.backlog = 511 41 | 42 | ; Set permissions for unix socket, if one is used. In Linux, read/write 43 | ; permissions must be set in order to allow connections from a web server. Many 44 | ; BSD-derived systems allow connections regardless of permissions. The owner 45 | ; and group can be specified either by name or by their numeric IDs. 46 | ; Default Values: user and group are set as the running user 47 | ; mode is set to 0660 48 | ;listen.owner = www-data 49 | ;listen.group = www-data 50 | ;listen.mode = 0660 51 | ; When POSIX Access Control Lists are supported you can set them using 52 | ; these options, value is a comma separated list of user/group names. 53 | ; When set, listen.owner and listen.group are ignored 54 | ;listen.acl_users = 55 | ;listen.acl_groups = 56 | 57 | ; List of addresses (IPv4/IPv6) of FastCGI clients which are allowed to connect. 58 | ; Equivalent to the FCGI_WEB_SERVER_ADDRS environment variable in the original 59 | ; PHP FCGI (5.2.2+). Makes sense only with a tcp listening socket. Each address 60 | ; must be separated by a comma. If this value is left blank, connections will be 61 | ; accepted from any ip address. 62 | ; Default Value: any 63 | ;listen.allowed_clients = 127.0.0.1 64 | 65 | ; Specify the nice(2) priority to apply to the pool processes (only if set) 66 | ; The value can vary from -19 (highest priority) to 20 (lower priority) 67 | ; Note: - It will only work if the FPM master process is launched as root 68 | ; - The pool processes will inherit the master process priority 69 | ; unless it specified otherwise 70 | ; Default Value: no set 71 | ; process.priority = -19 72 | 73 | ; Set the process dumpable flag (PR_SET_DUMPABLE prctl) even if the process user 74 | ; or group is different than the master process user. It allows to create process 75 | ; core dump and ptrace the process for the pool user. 76 | ; Default Value: no 77 | ; process.dumpable = yes 78 | 79 | ; Choose how the process manager will control the number of child processes. 80 | ; Possible Values: 81 | ; static - a fixed number (pm.max_children) of child processes; 82 | ; dynamic - the number of child processes are set dynamically based on the 83 | ; following directives. With this process management, there will be 84 | ; always at least 1 children. 85 | ; pm.max_children - the maximum number of children that can 86 | ; be alive at the same time. 87 | ; pm.start_servers - the number of children created on startup. 88 | ; pm.min_spare_servers - the minimum number of children in 'idle' 89 | ; state (waiting to process). If the number 90 | ; of 'idle' processes is less than this 91 | ; number then some children will be created. 92 | ; pm.max_spare_servers - the maximum number of children in 'idle' 93 | ; state (waiting to process). If the number 94 | ; of 'idle' processes is greater than this 95 | ; number then some children will be killed. 96 | ; ondemand - no children are created at startup. Children will be forked when 97 | ; new requests will connect. The following parameter are used: 98 | ; pm.max_children - the maximum number of children that 99 | ; can be alive at the same time. 100 | ; pm.process_idle_timeout - The number of seconds after which 101 | ; an idle process will be killed. 102 | ; Note: This value is mandatory. 103 | pm = dynamic 104 | 105 | ; The number of child processes to be created when pm is set to 'static' and the 106 | ; maximum number of child processes when pm is set to 'dynamic' or 'ondemand'. 107 | ; This value sets the limit on the number of simultaneous requests that will be 108 | ; served. Equivalent to the ApacheMaxClients directive with mpm_prefork. 109 | ; Equivalent to the PHP_FCGI_CHILDREN environment variable in the original PHP 110 | ; CGI. The below defaults are based on a server without much resources. Don't 111 | ; forget to tweak pm.* to fit your needs. 112 | ; Note: Used when pm is set to 'static', 'dynamic' or 'ondemand' 113 | ; Note: This value is mandatory. 114 | pm.max_children = 5 115 | 116 | ; The number of child processes created on startup. 117 | ; Note: Used only when pm is set to 'dynamic' 118 | ; Default Value: (min_spare_servers + max_spare_servers) / 2 119 | pm.start_servers = 2 120 | 121 | ; The desired minimum number of idle server processes. 122 | ; Note: Used only when pm is set to 'dynamic' 123 | ; Note: Mandatory when pm is set to 'dynamic' 124 | pm.min_spare_servers = 1 125 | 126 | ; The desired maximum number of idle server processes. 127 | ; Note: Used only when pm is set to 'dynamic' 128 | ; Note: Mandatory when pm is set to 'dynamic' 129 | pm.max_spare_servers = 3 130 | 131 | ; The number of seconds after which an idle process will be killed. 132 | ; Note: Used only when pm is set to 'ondemand' 133 | ; Default Value: 10s 134 | ;pm.process_idle_timeout = 10s; 135 | 136 | ; The number of requests each child process should execute before respawning. 137 | ; This can be useful to work around memory leaks in 3rd party libraries. For 138 | ; endless request processing specify '0'. Equivalent to PHP_FCGI_MAX_REQUESTS. 139 | ; Default Value: 0 140 | ;pm.max_requests = 500 141 | 142 | ; The URI to view the FPM status page. If this value is not set, no URI will be 143 | ; recognized as a status page. It shows the following information: 144 | ; pool - the name of the pool; 145 | ; process manager - static, dynamic or ondemand; 146 | ; start time - the date and time FPM has started; 147 | ; start since - number of seconds since FPM has started; 148 | ; accepted conn - the number of request accepted by the pool; 149 | ; listen queue - the number of request in the queue of pending 150 | ; connections (see backlog in listen(2)); 151 | ; max listen queue - the maximum number of requests in the queue 152 | ; of pending connections since FPM has started; 153 | ; listen queue len - the size of the socket queue of pending connections; 154 | ; idle processes - the number of idle processes; 155 | ; active processes - the number of active processes; 156 | ; total processes - the number of idle + active processes; 157 | ; max active processes - the maximum number of active processes since FPM 158 | ; has started; 159 | ; max children reached - number of times, the process limit has been reached, 160 | ; when pm tries to start more children (works only for 161 | ; pm 'dynamic' and 'ondemand'); 162 | ; Value are updated in real time. 163 | ; Example output: 164 | ; pool: www 165 | ; process manager: static 166 | ; start time: 01/Jul/2011:17:53:49 +0200 167 | ; start since: 62636 168 | ; accepted conn: 190460 169 | ; listen queue: 0 170 | ; max listen queue: 1 171 | ; listen queue len: 42 172 | ; idle processes: 4 173 | ; active processes: 11 174 | ; total processes: 15 175 | ; max active processes: 12 176 | ; max children reached: 0 177 | ; 178 | ; By default the status page output is formatted as text/plain. Passing either 179 | ; 'html', 'xml' or 'json' in the query string will return the corresponding 180 | ; output syntax. Example: 181 | ; http://www.foo.bar/status 182 | ; http://www.foo.bar/status?json 183 | ; http://www.foo.bar/status?html 184 | ; http://www.foo.bar/status?xml 185 | ; 186 | ; By default the status page only outputs short status. Passing 'full' in the 187 | ; query string will also return status for each pool process. 188 | ; Example: 189 | ; http://www.foo.bar/status?full 190 | ; http://www.foo.bar/status?json&full 191 | ; http://www.foo.bar/status?html&full 192 | ; http://www.foo.bar/status?xml&full 193 | ; The Full status returns for each process: 194 | ; pid - the PID of the process; 195 | ; state - the state of the process (Idle, Running, ...); 196 | ; start time - the date and time the process has started; 197 | ; start since - the number of seconds since the process has started; 198 | ; requests - the number of requests the process has served; 199 | ; request duration - the duration in µs of the requests; 200 | ; request method - the request method (GET, POST, ...); 201 | ; request URI - the request URI with the query string; 202 | ; content length - the content length of the request (only with POST); 203 | ; user - the user (PHP_AUTH_USER) (or '-' if not set); 204 | ; script - the main script called (or '-' if not set); 205 | ; last request cpu - the %cpu the last request consumed 206 | ; it's always 0 if the process is not in Idle state 207 | ; because CPU calculation is done when the request 208 | ; processing has terminated; 209 | ; last request memory - the max amount of memory the last request consumed 210 | ; it's always 0 if the process is not in Idle state 211 | ; because memory calculation is done when the request 212 | ; processing has terminated; 213 | ; If the process is in Idle state, then informations are related to the 214 | ; last request the process has served. Otherwise informations are related to 215 | ; the current request being served. 216 | ; Example output: 217 | ; ************************ 218 | ; pid: 31330 219 | ; state: Running 220 | ; start time: 01/Jul/2011:17:53:49 +0200 221 | ; start since: 63087 222 | ; requests: 12808 223 | ; request duration: 1250261 224 | ; request method: GET 225 | ; request URI: /test_mem.php?N=10000 226 | ; content length: 0 227 | ; user: - 228 | ; script: /home/fat/web/docs/php/test_mem.php 229 | ; last request cpu: 0.00 230 | ; last request memory: 0 231 | ; 232 | ; Note: There is a real-time FPM status monitoring sample web page available 233 | ; It's available in: /usr/local/share/php/fpm/status.html 234 | ; 235 | ; Note: The value must start with a leading slash (/). The value can be 236 | ; anything, but it may not be a good idea to use the .php extension or it 237 | ; may conflict with a real PHP file. 238 | ; Default Value: not set 239 | ;pm.status_path = /status 240 | 241 | ; The address on which to accept FastCGI status request. This creates a new 242 | ; invisible pool that can handle requests independently. This is useful 243 | ; if the main pool is busy with long running requests because it is still possible 244 | ; to get the status before finishing the long running requests. 245 | ; 246 | ; Valid syntaxes are: 247 | ; 'ip.add.re.ss:port' - to listen on a TCP socket to a specific IPv4 address on 248 | ; a specific port; 249 | ; '[ip:6:addr:ess]:port' - to listen on a TCP socket to a specific IPv6 address on 250 | ; a specific port; 251 | ; 'port' - to listen on a TCP socket to all addresses 252 | ; (IPv6 and IPv4-mapped) on a specific port; 253 | ; '/path/to/unix/socket' - to listen on a unix socket. 254 | ; Default Value: value of the listen option 255 | ;pm.status_listen = 127.0.0.1:9001 256 | 257 | ; The ping URI to call the monitoring page of FPM. If this value is not set, no 258 | ; URI will be recognized as a ping page. This could be used to test from outside 259 | ; that FPM is alive and responding, or to 260 | ; - create a graph of FPM availability (rrd or such); 261 | ; - remove a server from a group if it is not responding (load balancing); 262 | ; - trigger alerts for the operating team (24/7). 263 | ; Note: The value must start with a leading slash (/). The value can be 264 | ; anything, but it may not be a good idea to use the .php extension or it 265 | ; may conflict with a real PHP file. 266 | ; Default Value: not set 267 | ;ping.path = /ping 268 | 269 | ; This directive may be used to customize the response of a ping request. The 270 | ; response is formatted as text/plain with a 200 response code. 271 | ; Default Value: pong 272 | ;ping.response = pong 273 | 274 | ; The access log file 275 | ; Default: not set 276 | ;access.log = log/$pool.access.log 277 | 278 | ; The access log format. 279 | ; The following syntax is allowed 280 | ; %%: the '%' character 281 | ; %C: %CPU used by the request 282 | ; it can accept the following format: 283 | ; - %{user}C for user CPU only 284 | ; - %{system}C for system CPU only 285 | ; - %{total}C for user + system CPU (default) 286 | ; %d: time taken to serve the request 287 | ; it can accept the following format: 288 | ; - %{seconds}d (default) 289 | ; - %{milliseconds}d 290 | ; - %{mili}d 291 | ; - %{microseconds}d 292 | ; - %{micro}d 293 | ; %e: an environment variable (same as $_ENV or $_SERVER) 294 | ; it must be associated with embraces to specify the name of the env 295 | ; variable. Some examples: 296 | ; - server specifics like: %{REQUEST_METHOD}e or %{SERVER_PROTOCOL}e 297 | ; - HTTP headers like: %{HTTP_HOST}e or %{HTTP_USER_AGENT}e 298 | ; %f: script filename 299 | ; %l: content-length of the request (for POST request only) 300 | ; %m: request method 301 | ; %M: peak of memory allocated by PHP 302 | ; it can accept the following format: 303 | ; - %{bytes}M (default) 304 | ; - %{kilobytes}M 305 | ; - %{kilo}M 306 | ; - %{megabytes}M 307 | ; - %{mega}M 308 | ; %n: pool name 309 | ; %o: output header 310 | ; it must be associated with embraces to specify the name of the header: 311 | ; - %{Content-Type}o 312 | ; - %{X-Powered-By}o 313 | ; - %{Transfert-Encoding}o 314 | ; - .... 315 | ; %p: PID of the child that serviced the request 316 | ; %P: PID of the parent of the child that serviced the request 317 | ; %q: the query string 318 | ; %Q: the '?' character if query string exists 319 | ; %r: the request URI (without the query string, see %q and %Q) 320 | ; %R: remote IP address 321 | ; %s: status (response code) 322 | ; %t: server time the request was received 323 | ; it can accept a strftime(3) format: 324 | ; %d/%b/%Y:%H:%M:%S %z (default) 325 | ; The strftime(3) format must be encapsuled in a %{}t tag 326 | ; e.g. for a ISO8601 formatted timestring, use: %{%Y-%m-%dT%H:%M:%S%z}t 327 | ; %T: time the log has been written (the request has finished) 328 | ; it can accept a strftime(3) format: 329 | ; %d/%b/%Y:%H:%M:%S %z (default) 330 | ; The strftime(3) format must be encapsuled in a %{}t tag 331 | ; e.g. for a ISO8601 formatted timestring, use: %{%Y-%m-%dT%H:%M:%S%z}t 332 | ; %u: remote user 333 | ; 334 | ; Default: "%R - %u %t \"%m %r\" %s" 335 | ;access.format = "%R - %u %t \"%m %r%Q%q\" %s %f %{mili}d %{kilo}M %C%%" 336 | 337 | ; The log file for slow requests 338 | ; Default Value: not set 339 | ; Note: slowlog is mandatory if request_slowlog_timeout is set 340 | ;slowlog = log/$pool.log.slow 341 | 342 | ; The timeout for serving a single request after which a PHP backtrace will be 343 | ; dumped to the 'slowlog' file. A value of '0s' means 'off'. 344 | ; Available units: s(econds)(default), m(inutes), h(ours), or d(ays) 345 | ; Default Value: 0 346 | ;request_slowlog_timeout = 0 347 | 348 | ; Depth of slow log stack trace. 349 | ; Default Value: 20 350 | ;request_slowlog_trace_depth = 20 351 | 352 | ; The timeout for serving a single request after which the worker process will 353 | ; be killed. This option should be used when the 'max_execution_time' ini option 354 | ; does not stop script execution for some reason. A value of '0' means 'off'. 355 | ; Available units: s(econds)(default), m(inutes), h(ours), or d(ays) 356 | ; Default Value: 0 357 | ;request_terminate_timeout = 0 358 | 359 | ; The timeout set by 'request_terminate_timeout' ini option is not engaged after 360 | ; application calls 'fastcgi_finish_request' or when application has finished and 361 | ; shutdown functions are being called (registered via register_shutdown_function). 362 | ; This option will enable timeout limit to be applied unconditionally 363 | ; even in such cases. 364 | ; Default Value: no 365 | ;request_terminate_timeout_track_finished = no 366 | 367 | ; Set open file descriptor rlimit. 368 | ; Default Value: system defined value 369 | ;rlimit_files = 1024 370 | 371 | ; Set max core size rlimit. 372 | ; Possible Values: 'unlimited' or an integer greater or equal to 0 373 | ; Default Value: system defined value 374 | ;rlimit_core = 0 375 | 376 | ; Chroot to this directory at the start. This value must be defined as an 377 | ; absolute path. When this value is not set, chroot is not used. 378 | ; Note: you can prefix with '$prefix' to chroot to the pool prefix or one 379 | ; of its subdirectories. If the pool prefix is not set, the global prefix 380 | ; will be used instead. 381 | ; Note: chrooting is a great security feature and should be used whenever 382 | ; possible. However, all PHP paths will be relative to the chroot 383 | ; (error_log, sessions.save_path, ...). 384 | ; Default Value: not set 385 | ;chroot = 386 | 387 | ; Chdir to this directory at the start. 388 | ; Note: relative path can be used. 389 | ; Default Value: current directory or / when chroot 390 | ;chdir = /var/www 391 | 392 | ; Redirect worker stdout and stderr into main error log. If not set, stdout and 393 | ; stderr will be redirected to /dev/null according to FastCGI specs. 394 | ; Note: on highloaded environment, this can cause some delay in the page 395 | ; process time (several ms). 396 | ; Default Value: no 397 | ;catch_workers_output = yes 398 | 399 | ; Decorate worker output with prefix and suffix containing information about 400 | ; the child that writes to the log and if stdout or stderr is used as well as 401 | ; log level and time. This options is used only if catch_workers_output is yes. 402 | ; Settings to "no" will output data as written to the stdout or stderr. 403 | ; Default value: yes 404 | ;decorate_workers_output = no 405 | 406 | ; Clear environment in FPM workers 407 | ; Prevents arbitrary environment variables from reaching FPM worker processes 408 | ; by clearing the environment in workers before env vars specified in this 409 | ; pool configuration are added. 410 | ; Setting to "no" will make all environment variables available to PHP code 411 | ; via getenv(), $_ENV and $_SERVER. 412 | ; Default Value: yes 413 | ;clear_env = no 414 | 415 | ; Limits the extensions of the main script FPM will allow to parse. This can 416 | ; prevent configuration mistakes on the web server side. You should only limit 417 | ; FPM to .php extensions to prevent malicious users to use other extensions to 418 | ; execute php code. 419 | ; Note: set an empty value to allow all extensions. 420 | ; Default Value: .php 421 | ;security.limit_extensions = .php .php3 .php4 .php5 .php7 422 | 423 | ; Pass environment variables like LD_LIBRARY_PATH. All $VARIABLEs are taken from 424 | ; the current environment. 425 | ; Default Value: clean env 426 | ;env[HOSTNAME] = $HOSTNAME 427 | ;env[PATH] = /usr/local/bin:/usr/bin:/bin 428 | ;env[TMP] = /tmp 429 | ;env[TMPDIR] = /tmp 430 | ;env[TEMP] = /tmp 431 | 432 | ; Additional php.ini defines, specific to this pool of workers. These settings 433 | ; overwrite the values previously defined in the php.ini. The directives are the 434 | ; same as the PHP SAPI: 435 | ; php_value/php_flag - you can set classic ini defines which can 436 | ; be overwritten from PHP call 'ini_set'. 437 | ; php_admin_value/php_admin_flag - these directives won't be overwritten by 438 | ; PHP call 'ini_set' 439 | ; For php_*flag, valid values are on, off, 1, 0, true, false, yes or no. 440 | 441 | ; Defining 'extension' will load the corresponding shared extension from 442 | ; extension_dir. Defining 'disable_functions' or 'disable_classes' will not 443 | ; overwrite previously defined php.ini values, but will append the new value 444 | ; instead. 445 | 446 | ; Note: path INI options can be relative and will be expanded with the prefix 447 | ; (pool, global or /usr/local) 448 | 449 | ; Default Value: nothing is defined by default except the values in php.ini and 450 | ; specified at startup with the -d argument 451 | ;php_admin_value[sendmail_path] = /usr/sbin/sendmail -t -i -f www@my.domain.com 452 | ;php_flag[display_errors] = off 453 | ;php_admin_value[error_log] = /var/log/fpm-php.www.log 454 | ;php_admin_flag[log_errors] = on 455 | ;php_admin_value[memory_limit] = 32M 456 | -------------------------------------------------------------------------------- /php-fpm/conf-8.0/php-fpm.d/www.conf.default: -------------------------------------------------------------------------------- 1 | ; Start a new pool named 'www'. 2 | ; the variable $pool can be used in any directive and will be replaced by the 3 | ; pool name ('www' here) 4 | [www] 5 | 6 | ; Per pool prefix 7 | ; It only applies on the following directives: 8 | ; - 'access.log' 9 | ; - 'slowlog' 10 | ; - 'listen' (unixsocket) 11 | ; - 'chroot' 12 | ; - 'chdir' 13 | ; - 'php_values' 14 | ; - 'php_admin_values' 15 | ; When not set, the global prefix (or NONE) applies instead. 16 | ; Note: This directive can also be relative to the global prefix. 17 | ; Default Value: none 18 | ;prefix = /path/to/pools/$pool 19 | 20 | ; Unix user/group of processes 21 | ; Note: The user is mandatory. If the group is not set, the default user's group 22 | ; will be used. 23 | user = www-data 24 | group = www-data 25 | 26 | ; The address on which to accept FastCGI requests. 27 | ; Valid syntaxes are: 28 | ; 'ip.add.re.ss:port' - to listen on a TCP socket to a specific IPv4 address on 29 | ; a specific port; 30 | ; '[ip:6:addr:ess]:port' - to listen on a TCP socket to a specific IPv6 address on 31 | ; a specific port; 32 | ; 'port' - to listen on a TCP socket to all addresses 33 | ; (IPv6 and IPv4-mapped) on a specific port; 34 | ; '/path/to/unix/socket' - to listen on a unix socket. 35 | ; Note: This value is mandatory. 36 | listen = 127.0.0.1:9000 37 | 38 | ; Set listen(2) backlog. 39 | ; Default Value: 511 (-1 on FreeBSD and OpenBSD) 40 | ;listen.backlog = 511 41 | 42 | ; Set permissions for unix socket, if one is used. In Linux, read/write 43 | ; permissions must be set in order to allow connections from a web server. Many 44 | ; BSD-derived systems allow connections regardless of permissions. The owner 45 | ; and group can be specified either by name or by their numeric IDs. 46 | ; Default Values: user and group are set as the running user 47 | ; mode is set to 0660 48 | ;listen.owner = www-data 49 | ;listen.group = www-data 50 | ;listen.mode = 0660 51 | ; When POSIX Access Control Lists are supported you can set them using 52 | ; these options, value is a comma separated list of user/group names. 53 | ; When set, listen.owner and listen.group are ignored 54 | ;listen.acl_users = 55 | ;listen.acl_groups = 56 | 57 | ; List of addresses (IPv4/IPv6) of FastCGI clients which are allowed to connect. 58 | ; Equivalent to the FCGI_WEB_SERVER_ADDRS environment variable in the original 59 | ; PHP FCGI (5.2.2+). Makes sense only with a tcp listening socket. Each address 60 | ; must be separated by a comma. If this value is left blank, connections will be 61 | ; accepted from any ip address. 62 | ; Default Value: any 63 | ;listen.allowed_clients = 127.0.0.1 64 | 65 | ; Specify the nice(2) priority to apply to the pool processes (only if set) 66 | ; The value can vary from -19 (highest priority) to 20 (lower priority) 67 | ; Note: - It will only work if the FPM master process is launched as root 68 | ; - The pool processes will inherit the master process priority 69 | ; unless it specified otherwise 70 | ; Default Value: no set 71 | ; process.priority = -19 72 | 73 | ; Set the process dumpable flag (PR_SET_DUMPABLE prctl) even if the process user 74 | ; or group is different than the master process user. It allows to create process 75 | ; core dump and ptrace the process for the pool user. 76 | ; Default Value: no 77 | ; process.dumpable = yes 78 | 79 | ; Choose how the process manager will control the number of child processes. 80 | ; Possible Values: 81 | ; static - a fixed number (pm.max_children) of child processes; 82 | ; dynamic - the number of child processes are set dynamically based on the 83 | ; following directives. With this process management, there will be 84 | ; always at least 1 children. 85 | ; pm.max_children - the maximum number of children that can 86 | ; be alive at the same time. 87 | ; pm.start_servers - the number of children created on startup. 88 | ; pm.min_spare_servers - the minimum number of children in 'idle' 89 | ; state (waiting to process). If the number 90 | ; of 'idle' processes is less than this 91 | ; number then some children will be created. 92 | ; pm.max_spare_servers - the maximum number of children in 'idle' 93 | ; state (waiting to process). If the number 94 | ; of 'idle' processes is greater than this 95 | ; number then some children will be killed. 96 | ; ondemand - no children are created at startup. Children will be forked when 97 | ; new requests will connect. The following parameter are used: 98 | ; pm.max_children - the maximum number of children that 99 | ; can be alive at the same time. 100 | ; pm.process_idle_timeout - The number of seconds after which 101 | ; an idle process will be killed. 102 | ; Note: This value is mandatory. 103 | pm = dynamic 104 | 105 | ; The number of child processes to be created when pm is set to 'static' and the 106 | ; maximum number of child processes when pm is set to 'dynamic' or 'ondemand'. 107 | ; This value sets the limit on the number of simultaneous requests that will be 108 | ; served. Equivalent to the ApacheMaxClients directive with mpm_prefork. 109 | ; Equivalent to the PHP_FCGI_CHILDREN environment variable in the original PHP 110 | ; CGI. The below defaults are based on a server without much resources. Don't 111 | ; forget to tweak pm.* to fit your needs. 112 | ; Note: Used when pm is set to 'static', 'dynamic' or 'ondemand' 113 | ; Note: This value is mandatory. 114 | pm.max_children = 5 115 | 116 | ; The number of child processes created on startup. 117 | ; Note: Used only when pm is set to 'dynamic' 118 | ; Default Value: (min_spare_servers + max_spare_servers) / 2 119 | pm.start_servers = 2 120 | 121 | ; The desired minimum number of idle server processes. 122 | ; Note: Used only when pm is set to 'dynamic' 123 | ; Note: Mandatory when pm is set to 'dynamic' 124 | pm.min_spare_servers = 1 125 | 126 | ; The desired maximum number of idle server processes. 127 | ; Note: Used only when pm is set to 'dynamic' 128 | ; Note: Mandatory when pm is set to 'dynamic' 129 | pm.max_spare_servers = 3 130 | 131 | ; The number of seconds after which an idle process will be killed. 132 | ; Note: Used only when pm is set to 'ondemand' 133 | ; Default Value: 10s 134 | ;pm.process_idle_timeout = 10s; 135 | 136 | ; The number of requests each child process should execute before respawning. 137 | ; This can be useful to work around memory leaks in 3rd party libraries. For 138 | ; endless request processing specify '0'. Equivalent to PHP_FCGI_MAX_REQUESTS. 139 | ; Default Value: 0 140 | ;pm.max_requests = 500 141 | 142 | ; The URI to view the FPM status page. If this value is not set, no URI will be 143 | ; recognized as a status page. It shows the following information: 144 | ; pool - the name of the pool; 145 | ; process manager - static, dynamic or ondemand; 146 | ; start time - the date and time FPM has started; 147 | ; start since - number of seconds since FPM has started; 148 | ; accepted conn - the number of request accepted by the pool; 149 | ; listen queue - the number of request in the queue of pending 150 | ; connections (see backlog in listen(2)); 151 | ; max listen queue - the maximum number of requests in the queue 152 | ; of pending connections since FPM has started; 153 | ; listen queue len - the size of the socket queue of pending connections; 154 | ; idle processes - the number of idle processes; 155 | ; active processes - the number of active processes; 156 | ; total processes - the number of idle + active processes; 157 | ; max active processes - the maximum number of active processes since FPM 158 | ; has started; 159 | ; max children reached - number of times, the process limit has been reached, 160 | ; when pm tries to start more children (works only for 161 | ; pm 'dynamic' and 'ondemand'); 162 | ; Value are updated in real time. 163 | ; Example output: 164 | ; pool: www 165 | ; process manager: static 166 | ; start time: 01/Jul/2011:17:53:49 +0200 167 | ; start since: 62636 168 | ; accepted conn: 190460 169 | ; listen queue: 0 170 | ; max listen queue: 1 171 | ; listen queue len: 42 172 | ; idle processes: 4 173 | ; active processes: 11 174 | ; total processes: 15 175 | ; max active processes: 12 176 | ; max children reached: 0 177 | ; 178 | ; By default the status page output is formatted as text/plain. Passing either 179 | ; 'html', 'xml' or 'json' in the query string will return the corresponding 180 | ; output syntax. Example: 181 | ; http://www.foo.bar/status 182 | ; http://www.foo.bar/status?json 183 | ; http://www.foo.bar/status?html 184 | ; http://www.foo.bar/status?xml 185 | ; 186 | ; By default the status page only outputs short status. Passing 'full' in the 187 | ; query string will also return status for each pool process. 188 | ; Example: 189 | ; http://www.foo.bar/status?full 190 | ; http://www.foo.bar/status?json&full 191 | ; http://www.foo.bar/status?html&full 192 | ; http://www.foo.bar/status?xml&full 193 | ; The Full status returns for each process: 194 | ; pid - the PID of the process; 195 | ; state - the state of the process (Idle, Running, ...); 196 | ; start time - the date and time the process has started; 197 | ; start since - the number of seconds since the process has started; 198 | ; requests - the number of requests the process has served; 199 | ; request duration - the duration in µs of the requests; 200 | ; request method - the request method (GET, POST, ...); 201 | ; request URI - the request URI with the query string; 202 | ; content length - the content length of the request (only with POST); 203 | ; user - the user (PHP_AUTH_USER) (or '-' if not set); 204 | ; script - the main script called (or '-' if not set); 205 | ; last request cpu - the %cpu the last request consumed 206 | ; it's always 0 if the process is not in Idle state 207 | ; because CPU calculation is done when the request 208 | ; processing has terminated; 209 | ; last request memory - the max amount of memory the last request consumed 210 | ; it's always 0 if the process is not in Idle state 211 | ; because memory calculation is done when the request 212 | ; processing has terminated; 213 | ; If the process is in Idle state, then informations are related to the 214 | ; last request the process has served. Otherwise informations are related to 215 | ; the current request being served. 216 | ; Example output: 217 | ; ************************ 218 | ; pid: 31330 219 | ; state: Running 220 | ; start time: 01/Jul/2011:17:53:49 +0200 221 | ; start since: 63087 222 | ; requests: 12808 223 | ; request duration: 1250261 224 | ; request method: GET 225 | ; request URI: /test_mem.php?N=10000 226 | ; content length: 0 227 | ; user: - 228 | ; script: /home/fat/web/docs/php/test_mem.php 229 | ; last request cpu: 0.00 230 | ; last request memory: 0 231 | ; 232 | ; Note: There is a real-time FPM status monitoring sample web page available 233 | ; It's available in: /usr/local/share/php/fpm/status.html 234 | ; 235 | ; Note: The value must start with a leading slash (/). The value can be 236 | ; anything, but it may not be a good idea to use the .php extension or it 237 | ; may conflict with a real PHP file. 238 | ; Default Value: not set 239 | ;pm.status_path = /status 240 | 241 | ; The address on which to accept FastCGI status request. This creates a new 242 | ; invisible pool that can handle requests independently. This is useful 243 | ; if the main pool is busy with long running requests because it is still possible 244 | ; to get the status before finishing the long running requests. 245 | ; 246 | ; Valid syntaxes are: 247 | ; 'ip.add.re.ss:port' - to listen on a TCP socket to a specific IPv4 address on 248 | ; a specific port; 249 | ; '[ip:6:addr:ess]:port' - to listen on a TCP socket to a specific IPv6 address on 250 | ; a specific port; 251 | ; 'port' - to listen on a TCP socket to all addresses 252 | ; (IPv6 and IPv4-mapped) on a specific port; 253 | ; '/path/to/unix/socket' - to listen on a unix socket. 254 | ; Default Value: value of the listen option 255 | ;pm.status_listen = 127.0.0.1:9001 256 | 257 | ; The ping URI to call the monitoring page of FPM. If this value is not set, no 258 | ; URI will be recognized as a ping page. This could be used to test from outside 259 | ; that FPM is alive and responding, or to 260 | ; - create a graph of FPM availability (rrd or such); 261 | ; - remove a server from a group if it is not responding (load balancing); 262 | ; - trigger alerts for the operating team (24/7). 263 | ; Note: The value must start with a leading slash (/). The value can be 264 | ; anything, but it may not be a good idea to use the .php extension or it 265 | ; may conflict with a real PHP file. 266 | ; Default Value: not set 267 | ;ping.path = /ping 268 | 269 | ; This directive may be used to customize the response of a ping request. The 270 | ; response is formatted as text/plain with a 200 response code. 271 | ; Default Value: pong 272 | ;ping.response = pong 273 | 274 | ; The access log file 275 | ; Default: not set 276 | ;access.log = log/$pool.access.log 277 | 278 | ; The access log format. 279 | ; The following syntax is allowed 280 | ; %%: the '%' character 281 | ; %C: %CPU used by the request 282 | ; it can accept the following format: 283 | ; - %{user}C for user CPU only 284 | ; - %{system}C for system CPU only 285 | ; - %{total}C for user + system CPU (default) 286 | ; %d: time taken to serve the request 287 | ; it can accept the following format: 288 | ; - %{seconds}d (default) 289 | ; - %{milliseconds}d 290 | ; - %{mili}d 291 | ; - %{microseconds}d 292 | ; - %{micro}d 293 | ; %e: an environment variable (same as $_ENV or $_SERVER) 294 | ; it must be associated with embraces to specify the name of the env 295 | ; variable. Some examples: 296 | ; - server specifics like: %{REQUEST_METHOD}e or %{SERVER_PROTOCOL}e 297 | ; - HTTP headers like: %{HTTP_HOST}e or %{HTTP_USER_AGENT}e 298 | ; %f: script filename 299 | ; %l: content-length of the request (for POST request only) 300 | ; %m: request method 301 | ; %M: peak of memory allocated by PHP 302 | ; it can accept the following format: 303 | ; - %{bytes}M (default) 304 | ; - %{kilobytes}M 305 | ; - %{kilo}M 306 | ; - %{megabytes}M 307 | ; - %{mega}M 308 | ; %n: pool name 309 | ; %o: output header 310 | ; it must be associated with embraces to specify the name of the header: 311 | ; - %{Content-Type}o 312 | ; - %{X-Powered-By}o 313 | ; - %{Transfert-Encoding}o 314 | ; - .... 315 | ; %p: PID of the child that serviced the request 316 | ; %P: PID of the parent of the child that serviced the request 317 | ; %q: the query string 318 | ; %Q: the '?' character if query string exists 319 | ; %r: the request URI (without the query string, see %q and %Q) 320 | ; %R: remote IP address 321 | ; %s: status (response code) 322 | ; %t: server time the request was received 323 | ; it can accept a strftime(3) format: 324 | ; %d/%b/%Y:%H:%M:%S %z (default) 325 | ; The strftime(3) format must be encapsuled in a %{}t tag 326 | ; e.g. for a ISO8601 formatted timestring, use: %{%Y-%m-%dT%H:%M:%S%z}t 327 | ; %T: time the log has been written (the request has finished) 328 | ; it can accept a strftime(3) format: 329 | ; %d/%b/%Y:%H:%M:%S %z (default) 330 | ; The strftime(3) format must be encapsuled in a %{}t tag 331 | ; e.g. for a ISO8601 formatted timestring, use: %{%Y-%m-%dT%H:%M:%S%z}t 332 | ; %u: remote user 333 | ; 334 | ; Default: "%R - %u %t \"%m %r\" %s" 335 | ;access.format = "%R - %u %t \"%m %r%Q%q\" %s %f %{mili}d %{kilo}M %C%%" 336 | 337 | ; The log file for slow requests 338 | ; Default Value: not set 339 | ; Note: slowlog is mandatory if request_slowlog_timeout is set 340 | ;slowlog = log/$pool.log.slow 341 | 342 | ; The timeout for serving a single request after which a PHP backtrace will be 343 | ; dumped to the 'slowlog' file. A value of '0s' means 'off'. 344 | ; Available units: s(econds)(default), m(inutes), h(ours), or d(ays) 345 | ; Default Value: 0 346 | ;request_slowlog_timeout = 0 347 | 348 | ; Depth of slow log stack trace. 349 | ; Default Value: 20 350 | ;request_slowlog_trace_depth = 20 351 | 352 | ; The timeout for serving a single request after which the worker process will 353 | ; be killed. This option should be used when the 'max_execution_time' ini option 354 | ; does not stop script execution for some reason. A value of '0' means 'off'. 355 | ; Available units: s(econds)(default), m(inutes), h(ours), or d(ays) 356 | ; Default Value: 0 357 | ;request_terminate_timeout = 0 358 | 359 | ; The timeout set by 'request_terminate_timeout' ini option is not engaged after 360 | ; application calls 'fastcgi_finish_request' or when application has finished and 361 | ; shutdown functions are being called (registered via register_shutdown_function). 362 | ; This option will enable timeout limit to be applied unconditionally 363 | ; even in such cases. 364 | ; Default Value: no 365 | ;request_terminate_timeout_track_finished = no 366 | 367 | ; Set open file descriptor rlimit. 368 | ; Default Value: system defined value 369 | ;rlimit_files = 1024 370 | 371 | ; Set max core size rlimit. 372 | ; Possible Values: 'unlimited' or an integer greater or equal to 0 373 | ; Default Value: system defined value 374 | ;rlimit_core = 0 375 | 376 | ; Chroot to this directory at the start. This value must be defined as an 377 | ; absolute path. When this value is not set, chroot is not used. 378 | ; Note: you can prefix with '$prefix' to chroot to the pool prefix or one 379 | ; of its subdirectories. If the pool prefix is not set, the global prefix 380 | ; will be used instead. 381 | ; Note: chrooting is a great security feature and should be used whenever 382 | ; possible. However, all PHP paths will be relative to the chroot 383 | ; (error_log, sessions.save_path, ...). 384 | ; Default Value: not set 385 | ;chroot = 386 | 387 | ; Chdir to this directory at the start. 388 | ; Note: relative path can be used. 389 | ; Default Value: current directory or / when chroot 390 | ;chdir = /var/www 391 | 392 | ; Redirect worker stdout and stderr into main error log. If not set, stdout and 393 | ; stderr will be redirected to /dev/null according to FastCGI specs. 394 | ; Note: on highloaded environment, this can cause some delay in the page 395 | ; process time (several ms). 396 | ; Default Value: no 397 | ;catch_workers_output = yes 398 | 399 | ; Decorate worker output with prefix and suffix containing information about 400 | ; the child that writes to the log and if stdout or stderr is used as well as 401 | ; log level and time. This options is used only if catch_workers_output is yes. 402 | ; Settings to "no" will output data as written to the stdout or stderr. 403 | ; Default value: yes 404 | ;decorate_workers_output = no 405 | 406 | ; Clear environment in FPM workers 407 | ; Prevents arbitrary environment variables from reaching FPM worker processes 408 | ; by clearing the environment in workers before env vars specified in this 409 | ; pool configuration are added. 410 | ; Setting to "no" will make all environment variables available to PHP code 411 | ; via getenv(), $_ENV and $_SERVER. 412 | ; Default Value: yes 413 | ;clear_env = no 414 | 415 | ; Limits the extensions of the main script FPM will allow to parse. This can 416 | ; prevent configuration mistakes on the web server side. You should only limit 417 | ; FPM to .php extensions to prevent malicious users to use other extensions to 418 | ; execute php code. 419 | ; Note: set an empty value to allow all extensions. 420 | ; Default Value: .php 421 | ;security.limit_extensions = .php .php3 .php4 .php5 .php7 422 | 423 | ; Pass environment variables like LD_LIBRARY_PATH. All $VARIABLEs are taken from 424 | ; the current environment. 425 | ; Default Value: clean env 426 | ;env[HOSTNAME] = $HOSTNAME 427 | ;env[PATH] = /usr/local/bin:/usr/bin:/bin 428 | ;env[TMP] = /tmp 429 | ;env[TMPDIR] = /tmp 430 | ;env[TEMP] = /tmp 431 | 432 | ; Additional php.ini defines, specific to this pool of workers. These settings 433 | ; overwrite the values previously defined in the php.ini. The directives are the 434 | ; same as the PHP SAPI: 435 | ; php_value/php_flag - you can set classic ini defines which can 436 | ; be overwritten from PHP call 'ini_set'. 437 | ; php_admin_value/php_admin_flag - these directives won't be overwritten by 438 | ; PHP call 'ini_set' 439 | ; For php_*flag, valid values are on, off, 1, 0, true, false, yes or no. 440 | 441 | ; Defining 'extension' will load the corresponding shared extension from 442 | ; extension_dir. Defining 'disable_functions' or 'disable_classes' will not 443 | ; overwrite previously defined php.ini values, but will append the new value 444 | ; instead. 445 | 446 | ; Note: path INI options can be relative and will be expanded with the prefix 447 | ; (pool, global or /usr/local) 448 | 449 | ; Default Value: nothing is defined by default except the values in php.ini and 450 | ; specified at startup with the -d argument 451 | ;php_admin_value[sendmail_path] = /usr/sbin/sendmail -t -i -f www@my.domain.com 452 | ;php_flag[display_errors] = off 453 | ;php_admin_value[error_log] = /var/log/fpm-php.www.log 454 | ;php_admin_flag[log_errors] = on 455 | ;php_admin_value[memory_limit] = 32M 456 | --------------------------------------------------------------------------------