├── 7.4 ├── README.md ├── cli │ ├── php.ini │ ├── bullseye │ │ ├── sources.list │ │ └── Dockerfile │ └── alpine │ │ └── Dockerfile └── fpm │ ├── php.ini │ ├── bullseye │ ├── sources.list │ └── Dockerfile │ ├── alpine │ └── Dockerfile │ └── php-fpm-www.conf ├── 7.3 ├── README.md ├── php.ini ├── sources.list ├── Dockerfile └── php-fpm-www.conf ├── 7.1 ├── php.ini ├── sources.list ├── Dockerfile └── php-fpm-www.conf ├── 7.2 ├── php.ini ├── README.md ├── sources.list ├── Dockerfile └── php-fpm-www.conf ├── 8.0 ├── cli │ ├── php.ini │ ├── bullseye │ │ ├── sources.list │ │ └── Dockerfile │ └── alpine │ │ └── Dockerfile └── fpm │ ├── php.ini │ ├── bullseye │ ├── sources.list │ └── Dockerfile │ ├── alpine │ └── Dockerfile │ └── php-fpm-www.conf ├── 8.1 └── cli │ ├── php.ini │ ├── alpine │ └── Dockerfile │ └── trixie │ └── Dockerfile ├── 8.2 └── cli │ ├── php.ini │ ├── alpine │ └── Dockerfile │ └── trixie │ └── Dockerfile ├── 8.3 └── cli │ ├── php.ini │ ├── alpine │ └── Dockerfile │ └── trixie │ └── Dockerfile ├── 8.4 └── cli │ ├── php.ini │ ├── alpine │ └── Dockerfile │ └── trixie │ └── Dockerfile ├── 8.5 └── cli │ ├── php.ini │ ├── alpine │ └── Dockerfile │ └── trixie │ └── Dockerfile ├── README.md ├── LICENSE └── .github └── workflows └── docker.yml /7.4/README.md: -------------------------------------------------------------------------------- 1 | ## ext && version 2 | 3 | - amqp(fpm) 4 | - bcmath 5 | - bz2 6 | - gd 7 | - iconv 8 | - mcrypt 9 | - mysqli 10 | - pdo 11 | - pdo_mysql 12 | - zip 13 | - mongodb(fpm) 14 | - redis 15 | - swoole 16 | - opcache 17 | - sockets 18 | - pcntl 19 | -------------------------------------------------------------------------------- /7.3/README.md: -------------------------------------------------------------------------------- 1 | ## ext && version 2 | 3 | - amqp 4 | - bcmath 5 | - bz2 6 | - gd 7 | - iconv 8 | - mcrypt 9 | - mysqli 10 | - pdo 11 | - pdo_mysql 12 | - zip 13 | - mongodb 14 | - redis 15 | - memcached 16 | - swoole 17 | - opcache 18 | - sockets 19 | - pcntl 20 | -------------------------------------------------------------------------------- /7.1/php.ini: -------------------------------------------------------------------------------- 1 | memory_limit = 512M 2 | post_max_size = 100M 3 | upload_max_filesize = 100M 4 | date.timezone = Asia/Shanghai 5 | max_execution_time = 60 6 | expose_php = off 7 | error_log = /proc/self/fd/2 8 | display_errors = /proc/self/fd/2 9 | opcache.error_log = /proc/self/fd/2 10 | -------------------------------------------------------------------------------- /7.2/php.ini: -------------------------------------------------------------------------------- 1 | memory_limit = 512M 2 | post_max_size = 100M 3 | upload_max_filesize = 100M 4 | date.timezone = Asia/Shanghai 5 | max_execution_time = 60 6 | expose_php = off 7 | error_log = /proc/self/fd/2 8 | display_errors = /proc/self/fd/2 9 | opcache.error_log = /proc/self/fd/2 10 | -------------------------------------------------------------------------------- /7.3/php.ini: -------------------------------------------------------------------------------- 1 | memory_limit = 512M 2 | post_max_size = 100M 3 | upload_max_filesize = 100M 4 | date.timezone = Asia/Shanghai 5 | max_execution_time = 60 6 | expose_php = off 7 | error_log = /proc/self/fd/2 8 | display_errors = /proc/self/fd/2 9 | opcache.error_log = /proc/self/fd/2 10 | -------------------------------------------------------------------------------- /7.2/README.md: -------------------------------------------------------------------------------- 1 | ## ext && version 2 | 3 | - amqp-1.10.2 4 | - bcmath 5 | - bz2 6 | - gd 7 | - iconv 8 | - mcrypt-1.0.3 9 | - mysqli 10 | - pdo 11 | - pdo_mysql 12 | - zip 13 | - mongodb-1.7.4 14 | - redis-4.3.0 15 | - memcached-3.1.5 16 | - swoole-4.4.19 17 | - opcache 18 | - sockets 19 | -------------------------------------------------------------------------------- /7.4/cli/php.ini: -------------------------------------------------------------------------------- 1 | memory_limit = 512M 2 | post_max_size = 100M 3 | upload_max_filesize = 100M 4 | date.timezone = Asia/Shanghai 5 | max_execution_time = 60 6 | expose_php = off 7 | error_log = /proc/self/fd/2 8 | display_errors = On 9 | opcache.error_log = /proc/self/fd/2 10 | opcache.enable_cli = On 11 | -------------------------------------------------------------------------------- /7.4/fpm/php.ini: -------------------------------------------------------------------------------- 1 | memory_limit = 512M 2 | post_max_size = 100M 3 | upload_max_filesize = 100M 4 | date.timezone = Asia/Shanghai 5 | max_execution_time = 60 6 | expose_php = off 7 | error_log = /proc/self/fd/2 8 | display_errors = On 9 | opcache.error_log = /proc/self/fd/2 10 | opcache.enable_cli = On 11 | -------------------------------------------------------------------------------- /8.0/cli/php.ini: -------------------------------------------------------------------------------- 1 | memory_limit = 512M 2 | post_max_size = 100M 3 | upload_max_filesize = 100M 4 | date.timezone = Asia/Shanghai 5 | max_execution_time = 60 6 | expose_php = off 7 | error_log = /proc/self/fd/2 8 | display_errors = On 9 | opcache.error_log = /proc/self/fd/2 10 | opcache.enable_cli = On 11 | -------------------------------------------------------------------------------- /8.0/fpm/php.ini: -------------------------------------------------------------------------------- 1 | memory_limit = 512M 2 | post_max_size = 100M 3 | upload_max_filesize = 100M 4 | date.timezone = Asia/Shanghai 5 | max_execution_time = 60 6 | expose_php = off 7 | error_log = /proc/self/fd/2 8 | display_errors = On 9 | opcache.error_log = /proc/self/fd/2 10 | opcache.enable_cli = On 11 | -------------------------------------------------------------------------------- /8.1/cli/php.ini: -------------------------------------------------------------------------------- 1 | memory_limit = 512M 2 | post_max_size = 100M 3 | upload_max_filesize = 100M 4 | date.timezone = Asia/Shanghai 5 | max_execution_time = 60 6 | expose_php = off 7 | error_log = /proc/self/fd/2 8 | display_errors = On 9 | opcache.error_log = /proc/self/fd/2 10 | opcache.enable_cli = On 11 | -------------------------------------------------------------------------------- /8.2/cli/php.ini: -------------------------------------------------------------------------------- 1 | memory_limit = 512M 2 | post_max_size = 100M 3 | upload_max_filesize = 100M 4 | date.timezone = Asia/Shanghai 5 | max_execution_time = 60 6 | expose_php = off 7 | error_log = /proc/self/fd/2 8 | display_errors = On 9 | opcache.error_log = /proc/self/fd/2 10 | opcache.enable_cli = On 11 | -------------------------------------------------------------------------------- /8.3/cli/php.ini: -------------------------------------------------------------------------------- 1 | memory_limit = 512M 2 | post_max_size = 100M 3 | upload_max_filesize = 100M 4 | date.timezone = Asia/Shanghai 5 | max_execution_time = 60 6 | expose_php = off 7 | error_log = /proc/self/fd/2 8 | display_errors = On 9 | opcache.error_log = /proc/self/fd/2 10 | opcache.enable_cli = On 11 | -------------------------------------------------------------------------------- /8.4/cli/php.ini: -------------------------------------------------------------------------------- 1 | memory_limit = 512M 2 | post_max_size = 100M 3 | upload_max_filesize = 100M 4 | date.timezone = Asia/Shanghai 5 | max_execution_time = 60 6 | expose_php = off 7 | error_log = /proc/self/fd/2 8 | display_errors = On 9 | opcache.error_log = /proc/self/fd/2 10 | opcache.enable_cli = On 11 | -------------------------------------------------------------------------------- /8.5/cli/php.ini: -------------------------------------------------------------------------------- 1 | memory_limit = 512M 2 | post_max_size = 100M 3 | upload_max_filesize = 100M 4 | date.timezone = Asia/Shanghai 5 | max_execution_time = 60 6 | expose_php = off 7 | error_log = /proc/self/fd/2 8 | display_errors = On 9 | opcache.error_log = /proc/self/fd/2 10 | opcache.enable_cli = On 11 | -------------------------------------------------------------------------------- /7.3/sources.list: -------------------------------------------------------------------------------- 1 | deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye main contrib non-free 2 | deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-updates main contrib non-free 3 | deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-backports main contrib non-free 4 | deb https://mirrors.tuna.tsinghua.edu.cn/debian-security bullseye-security main contrib non-free 5 | -------------------------------------------------------------------------------- /7.4/cli/bullseye/sources.list: -------------------------------------------------------------------------------- 1 | deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye main contrib non-free 2 | deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-updates main contrib non-free 3 | deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-backports main contrib non-free 4 | deb https://mirrors.tuna.tsinghua.edu.cn/debian-security bullseye-security main contrib non-free 5 | -------------------------------------------------------------------------------- /7.4/fpm/bullseye/sources.list: -------------------------------------------------------------------------------- 1 | deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye main contrib non-free 2 | deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-updates main contrib non-free 3 | deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-backports main contrib non-free 4 | deb https://mirrors.tuna.tsinghua.edu.cn/debian-security bullseye-security main contrib non-free 5 | -------------------------------------------------------------------------------- /8.0/cli/bullseye/sources.list: -------------------------------------------------------------------------------- 1 | deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye main contrib non-free 2 | deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-updates main contrib non-free 3 | deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-backports main contrib non-free 4 | deb https://mirrors.tuna.tsinghua.edu.cn/debian-security bullseye-security main contrib non-free 5 | -------------------------------------------------------------------------------- /8.0/fpm/bullseye/sources.list: -------------------------------------------------------------------------------- 1 | deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye main contrib non-free 2 | deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-updates main contrib non-free 3 | deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-backports main contrib non-free 4 | deb https://mirrors.tuna.tsinghua.edu.cn/debian-security bullseye-security main contrib non-free 5 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # docker-php 2 | Docker with php include php and cli 3 | 4 | ## Usage 5 | ### China Region 6 | docker pull registry.cn-shenzhen.aliyuncs.com/yansongda/php 7 | 8 | ### Docker Hub 9 | docker pull yansongda/php 10 | 11 | ## Added ext 12 | 13 | detail version see every floder 14 | 15 | ## Modified php.ini 16 | - memory_limit = 512M 17 | - post_max_size = 20M 18 | - upload_max_filesize = 20M 19 | - date.timezone = Asia/Shanghai 20 | - max_execution_time = 60 21 | 22 | ## Added tools 23 | - composer -------------------------------------------------------------------------------- /7.1/sources.list: -------------------------------------------------------------------------------- 1 | deb https://mirrors.tuna.tsinghua.edu.cn/debian/ buster main contrib non-free 2 | # deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ buster main contrib non-free 3 | deb https://mirrors.tuna.tsinghua.edu.cn/debian/ buster-updates main contrib non-free 4 | # deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ buster-updates main contrib non-free 5 | deb https://mirrors.tuna.tsinghua.edu.cn/debian/ buster-backports main contrib non-free 6 | # deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ buster-backports main contrib non-free 7 | deb https://mirrors.tuna.tsinghua.edu.cn/debian-security buster/updates main contrib non-free 8 | # deb-src https://mirrors.tuna.tsinghua.edu.cn/debian-security buster/updates main contrib non-free 9 | -------------------------------------------------------------------------------- /7.2/sources.list: -------------------------------------------------------------------------------- 1 | deb https://mirrors.tuna.tsinghua.edu.cn/debian/ buster main contrib non-free 2 | # deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ buster main contrib non-free 3 | deb https://mirrors.tuna.tsinghua.edu.cn/debian/ buster-updates main contrib non-free 4 | # deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ buster-updates main contrib non-free 5 | deb https://mirrors.tuna.tsinghua.edu.cn/debian/ buster-backports main contrib non-free 6 | # deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ buster-backports main contrib non-free 7 | deb https://mirrors.tuna.tsinghua.edu.cn/debian-security buster/updates main contrib non-free 8 | # deb-src https://mirrors.tuna.tsinghua.edu.cn/debian-security buster/updates main contrib non-free 9 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) yansongda 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /8.1/cli/alpine/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM php:8.1-cli-alpine 2 | 3 | LABEL maintainer="yansongda " 4 | 5 | # ENV for Global 6 | ENV TZ="Asia/Shanghai" 7 | ENV DEPENDENCIES="$PHPIZE_DEPS curl-dev openssl-dev pcre-dev pcre2-dev zlib-dev" 8 | ENV BUILD_DIR="/tmp" 9 | 10 | # ENV for PHP 11 | ENV PHP_DEPENDENCIES="libpng-dev libzip-dev freetype-dev libwebp-dev libjpeg-turbo-dev libxpm-dev bzip2-dev libstdc++" 12 | ENV PHP_EXT_PECL_INSTALL="redis-6.3.0 xlswriter-1.5.7" 13 | ENV PHP_EXT_SWOOLE_VERSION="6.1.4" 14 | ENV PHP_COMPOSER_URL="https://getcomposer.org/composer-stable.phar" 15 | 16 | # Prepare 17 | RUN apk add -U --no-cache --virtual .build-deps $DEPENDENCIES \ 18 | && apk add -U --no-cache tzdata $PHP_DEPENDENCIES \ 19 | && pecl install -o -f $PHP_EXT_PECL_INSTALL \ 20 | # Swoole 21 | && mkdir -p $BUILD_DIR && cd $BUILD_DIR \ 22 | && curl -SL "https://github.com/swoole/swoole-src/archive/v${PHP_EXT_SWOOLE_VERSION}.tar.gz" -o swoole.tar.gz \ 23 | && ls -alh \ 24 | && mkdir -p swoole \ 25 | && tar -xf swoole.tar.gz -C swoole --strip-components=1 \ 26 | && ( \ 27 | cd swoole \ 28 | && phpize \ 29 | && ./configure --enable-openssl --enable-swoole-curl \ 30 | && make -s -j$(nproc) && make install \ 31 | ) \ 32 | # Extentions 33 | && docker-php-ext-configure gd --with-webp --with-jpeg --with-xpm --with-freetype \ 34 | && docker-php-ext-install opcache bcmath bz2 gd mysqli pdo pdo_mysql zip sockets pcntl \ 35 | && docker-php-ext-enable redis xlswriter swoole \ 36 | # Composer 37 | && curl $PHP_COMPOSER_URL -o /usr/local/bin/composer \ 38 | && chmod a+x /usr/local/bin/composer \ 39 | # Clean 40 | && apk del .build-deps \ 41 | && rm -rf /tmp/* ~/.pearrc /var/cache/apk/* \ 42 | && cd && rm -rf $BUILD_DIR \ 43 | ## For me 44 | && sed -i 's/dl-cdn.alpinelinux.org/mirrors.tuna.tsinghua.edu.cn/g' /etc/apk/repositories \ 45 | && cp /usr/share/zoneinfo/$TZ /etc/localtime && date \ 46 | && php --ri swoole && php --ri xlswriter 47 | 48 | # After Build 49 | WORKDIR /www 50 | 51 | COPY php.ini /usr/local/etc/php/ 52 | -------------------------------------------------------------------------------- /8.2/cli/alpine/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM php:8.2-cli-alpine 2 | 3 | LABEL maintainer="yansongda " 4 | 5 | # ENV for Global 6 | ENV TZ="Asia/Shanghai" 7 | ENV DEPENDENCIES="$PHPIZE_DEPS curl-dev openssl-dev pcre-dev pcre2-dev zlib-dev" 8 | ENV BUILD_DIR="/tmp" 9 | 10 | # ENV for PHP 11 | ENV PHP_DEPENDENCIES="libpng-dev libzip-dev freetype-dev libwebp-dev libjpeg-turbo-dev libxpm-dev bzip2-dev libstdc++ linux-headers" 12 | ENV PHP_EXT_PECL_INSTALL="redis-6.3.0 xlswriter-1.5.8" 13 | ENV PHP_EXT_SWOOLE_VERSION="6.1.4" 14 | ENV PHP_COMPOSER_URL="https://getcomposer.org/composer-stable.phar" 15 | 16 | # Prepare 17 | RUN apk add -U --no-cache --virtual .build-deps $DEPENDENCIES \ 18 | && apk add -U --no-cache tzdata $PHP_DEPENDENCIES \ 19 | && pecl install -o -f $PHP_EXT_PECL_INSTALL \ 20 | # Swoole 21 | && mkdir -p $BUILD_DIR && cd $BUILD_DIR \ 22 | && curl -SL "https://github.com/swoole/swoole-src/archive/v${PHP_EXT_SWOOLE_VERSION}.tar.gz" -o swoole.tar.gz \ 23 | && ls -alh \ 24 | && mkdir -p swoole \ 25 | && tar -xf swoole.tar.gz -C swoole --strip-components=1 \ 26 | && ( \ 27 | cd swoole \ 28 | && phpize \ 29 | && ./configure --enable-openssl --enable-swoole-curl \ 30 | && make -s -j$(nproc) && make install \ 31 | ) \ 32 | # Extentions 33 | && docker-php-ext-configure gd --with-webp --with-jpeg --with-xpm --with-freetype \ 34 | && docker-php-ext-install opcache bcmath bz2 gd mysqli pdo pdo_mysql zip sockets pcntl \ 35 | && docker-php-ext-enable redis xlswriter swoole \ 36 | # Composer 37 | && curl $PHP_COMPOSER_URL -o /usr/local/bin/composer \ 38 | && chmod a+x /usr/local/bin/composer \ 39 | # Clean 40 | && apk del .build-deps \ 41 | && rm -rf /tmp/* ~/.pearrc /var/cache/apk/* \ 42 | && cd && rm -rf $BUILD_DIR \ 43 | ## For me 44 | && sed -i 's/dl-cdn.alpinelinux.org/mirrors.ustc.edu.cn/g' /etc/apk/repositories \ 45 | && cp /usr/share/zoneinfo/$TZ /etc/localtime && date \ 46 | && php --ri swoole && php --ri xlswriter 47 | 48 | # After Build 49 | WORKDIR /www 50 | 51 | COPY php.ini /usr/local/etc/php/ 52 | -------------------------------------------------------------------------------- /8.3/cli/alpine/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM php:8.3-cli-alpine 2 | 3 | LABEL maintainer="yansongda " 4 | 5 | # ENV for Global 6 | ENV TZ="Asia/Shanghai" 7 | ENV DEPENDENCIES="$PHPIZE_DEPS curl-dev openssl-dev pcre-dev pcre2-dev zlib-dev" 8 | ENV BUILD_DIR="/tmp" 9 | 10 | # ENV for PHP 11 | ENV PHP_DEPENDENCIES="libpng-dev libzip-dev freetype-dev libwebp-dev libjpeg-turbo-dev libxpm-dev bzip2-dev libstdc++ linux-headers" 12 | ENV PHP_EXT_PECL_INSTALL="redis-6.3.0 xlswriter-1.5.8" 13 | ENV PHP_EXT_SWOOLE_VERSION="6.1.4" 14 | ENV PHP_COMPOSER_URL="https://getcomposer.org/composer-stable.phar" 15 | 16 | # Prepare 17 | RUN apk add -U --no-cache --virtual .build-deps $DEPENDENCIES \ 18 | && apk add -U --no-cache tzdata $PHP_DEPENDENCIES \ 19 | && pecl install -o -f $PHP_EXT_PECL_INSTALL \ 20 | # Swoole 21 | && mkdir -p $BUILD_DIR && cd $BUILD_DIR \ 22 | && curl -SL "https://github.com/swoole/swoole-src/archive/v${PHP_EXT_SWOOLE_VERSION}.tar.gz" -o swoole.tar.gz \ 23 | && ls -alh \ 24 | && mkdir -p swoole \ 25 | && tar -xf swoole.tar.gz -C swoole --strip-components=1 \ 26 | && ( \ 27 | cd swoole \ 28 | && phpize \ 29 | && ./configure --enable-openssl --enable-swoole-curl --enable-cares \ 30 | && make -s -j$(nproc) && make install \ 31 | ) \ 32 | # Extentions 33 | && docker-php-ext-configure gd --with-webp --with-jpeg --with-xpm --with-freetype \ 34 | && docker-php-ext-install opcache bcmath bz2 gd mysqli pdo pdo_mysql zip sockets pcntl \ 35 | && docker-php-ext-enable redis xlswriter swoole \ 36 | # Composer 37 | && curl $PHP_COMPOSER_URL -o /usr/local/bin/composer \ 38 | && chmod a+x /usr/local/bin/composer \ 39 | # Clean 40 | && apk del .build-deps \ 41 | && rm -rf /tmp/* ~/.pearrc /var/cache/apk/* \ 42 | && cd && rm -rf $BUILD_DIR \ 43 | ## For me 44 | && sed -i 's/dl-cdn.alpinelinux.org/mirrors.ustc.edu.cn/g' /etc/apk/repositories \ 45 | && cp /usr/share/zoneinfo/$TZ /etc/localtime && date \ 46 | && php --ri swoole && php --ri xlswriter 47 | 48 | # After Build 49 | WORKDIR /www 50 | 51 | COPY php.ini /usr/local/etc/php/ 52 | -------------------------------------------------------------------------------- /8.4/cli/alpine/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM php:8.4-cli-alpine 2 | 3 | LABEL maintainer="yansongda " 4 | 5 | # ENV for Global 6 | ENV TZ="Asia/Shanghai" 7 | ENV DEPENDENCIES="$PHPIZE_DEPS curl-dev openssl-dev pcre-dev pcre2-dev zlib-dev" 8 | ENV BUILD_DIR="/tmp" 9 | 10 | # ENV for PHP 11 | ENV PHP_DEPENDENCIES="libpng-dev libzip-dev freetype-dev libwebp-dev libjpeg-turbo-dev libxpm-dev bzip2-dev libstdc++ linux-headers" 12 | ENV PHP_EXT_PECL_INSTALL="redis-6.3.0 xlswriter-1.5.8" 13 | ENV PHP_EXT_SWOOLE_VERSION="6.1.4" 14 | ENV PHP_COMPOSER_URL="https://getcomposer.org/composer-stable.phar" 15 | 16 | # Prepare 17 | RUN apk add -U --no-cache --virtual .build-deps $DEPENDENCIES \ 18 | && apk add -U --no-cache tzdata $PHP_DEPENDENCIES \ 19 | && pecl install -o -f $PHP_EXT_PECL_INSTALL \ 20 | # Swoole 21 | && mkdir -p $BUILD_DIR && cd $BUILD_DIR \ 22 | && curl -SL "https://github.com/swoole/swoole-src/archive/v${PHP_EXT_SWOOLE_VERSION}.tar.gz" -o swoole.tar.gz \ 23 | && ls -alh \ 24 | && mkdir -p swoole \ 25 | && tar -xf swoole.tar.gz -C swoole --strip-components=1 \ 26 | && ( \ 27 | cd swoole \ 28 | && phpize \ 29 | && ./configure --enable-openssl --enable-swoole-curl --enable-cares \ 30 | && make -s -j$(nproc) && make install \ 31 | ) \ 32 | # Extentions 33 | && docker-php-ext-configure gd --with-webp --with-jpeg --with-xpm --with-freetype \ 34 | && docker-php-ext-install opcache bcmath bz2 gd mysqli pdo pdo_mysql zip sockets pcntl \ 35 | && docker-php-ext-enable redis xlswriter swoole \ 36 | # Composer 37 | && curl $PHP_COMPOSER_URL -o /usr/local/bin/composer \ 38 | && chmod a+x /usr/local/bin/composer \ 39 | # Clean 40 | && apk del .build-deps \ 41 | && rm -rf /tmp/* ~/.pearrc /var/cache/apk/* \ 42 | && cd && rm -rf $BUILD_DIR \ 43 | ## For me 44 | && sed -i 's/dl-cdn.alpinelinux.org/mirrors.ustc.edu.cn/g' /etc/apk/repositories \ 45 | && cp /usr/share/zoneinfo/$TZ /etc/localtime && date \ 46 | && php --ri swoole && php --ri xlswriter 47 | 48 | # After Build 49 | WORKDIR /www 50 | 51 | COPY php.ini /usr/local/etc/php/ 52 | -------------------------------------------------------------------------------- /8.5/cli/alpine/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM php:8.5-cli-alpine 2 | 3 | LABEL maintainer="yansongda " 4 | 5 | # ENV for Global 6 | ENV TZ="Asia/Shanghai" 7 | ENV DEPENDENCIES="$PHPIZE_DEPS curl-dev openssl-dev pcre-dev pcre2-dev zlib-dev" 8 | ENV BUILD_DIR="/tmp" 9 | 10 | # ENV for PHP 11 | ENV PHP_DEPENDENCIES="libpng-dev libzip-dev freetype-dev libwebp-dev libjpeg-turbo-dev libxpm-dev bzip2-dev libstdc++ linux-headers" 12 | ENV PHP_EXT_PECL_INSTALL="redis-6.3.0 xlswriter-1.5.8" 13 | ENV PHP_EXT_SWOOLE_VERSION="6.1.4" 14 | ENV PHP_COMPOSER_URL="https://getcomposer.org/composer-stable.phar" 15 | 16 | # Prepare 17 | RUN apk add -U --no-cache --virtual .build-deps $DEPENDENCIES \ 18 | && apk add -U --no-cache tzdata $PHP_DEPENDENCIES \ 19 | && pecl install -o -f $PHP_EXT_PECL_INSTALL \ 20 | # Swoole 21 | && mkdir -p $BUILD_DIR && cd $BUILD_DIR \ 22 | && curl -SL "https://github.com/swoole/swoole-src/archive/v${PHP_EXT_SWOOLE_VERSION}.tar.gz" -o swoole.tar.gz \ 23 | && ls -alh \ 24 | && mkdir -p swoole \ 25 | && tar -xf swoole.tar.gz -C swoole --strip-components=1 \ 26 | && ( \ 27 | cd swoole \ 28 | && phpize \ 29 | && ./configure --enable-openssl --enable-swoole-curl --enable-cares \ 30 | && make -s -j$(nproc) && make install \ 31 | ) \ 32 | # Extentions 33 | && docker-php-ext-configure gd --with-webp --with-jpeg --with-xpm --with-freetype \ 34 | && docker-php-ext-install opcache bcmath bz2 gd mysqli pdo pdo_mysql zip sockets pcntl \ 35 | && docker-php-ext-enable redis xlswriter swoole \ 36 | # Composer 37 | && curl $PHP_COMPOSER_URL -o /usr/local/bin/composer \ 38 | && chmod a+x /usr/local/bin/composer \ 39 | # Clean 40 | && apk del .build-deps \ 41 | && rm -rf /tmp/* ~/.pearrc /var/cache/apk/* \ 42 | && cd && rm -rf $BUILD_DIR \ 43 | ## For me 44 | && sed -i 's/dl-cdn.alpinelinux.org/mirrors.ustc.edu.cn/g' /etc/apk/repositories \ 45 | && cp /usr/share/zoneinfo/$TZ /etc/localtime && date \ 46 | && php --ri swoole && php --ri xlswriter 47 | 48 | # After Build 49 | WORKDIR /www 50 | 51 | COPY php.ini /usr/local/etc/php/ 52 | -------------------------------------------------------------------------------- /8.1/cli/trixie/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM php:8.1-cli-trixie 2 | 3 | LABEL maintainer="yansongda " 4 | 5 | # ENV for Global 6 | ENV TZ="Asia/Shanghai" 7 | ENV DEPENDENCIES="gnupg git gcc g++" 8 | ENV WORKING_DIR="/tmp" 9 | 10 | # ENV for PHP 11 | ENV PHP_DEPENDENCIES="curl wget unzip ca-certificates libcurl4-openssl-dev libwebp-dev libbz2-dev libpng-dev libxpm-dev libfreetype6-dev libjpeg-dev libssh-dev libzip-dev" 12 | ENV PHP_EXT_INSTALLED_PECL="redis-6.3.0 xlswriter-1.5.8" 13 | ENV PHP_EXT_SWOOLE_VERSION="6.1.4" 14 | ENV PHP_COMPOSER_URL="https://getcomposer.org/composer-stable.phar" 15 | 16 | # Prepare 17 | RUN apt-get update \ 18 | && apt-get install -y $PHP_DEPENDENCIES $DEPENDENCIES \ 19 | && pecl install -o -f $PHP_EXT_INSTALLED_PECL \ 20 | # Swoole 21 | && mkdir -p $WORKING_DIR && cd $WORKING_DIR \ 22 | && curl -SL "https://github.com/swoole/swoole-src/archive/v${PHP_EXT_SWOOLE_VERSION}.tar.gz" -o swoole.tar.gz \ 23 | && ls -alh \ 24 | && mkdir -p swoole \ 25 | && tar -xf swoole.tar.gz -C swoole --strip-components=1 \ 26 | && ( \ 27 | cd swoole \ 28 | && phpize \ 29 | && ./configure --enable-openssl --enable-swoole-curl \ 30 | && make -s -j$(nproc) && make install \ 31 | ) \ 32 | # Extentions 33 | && docker-php-ext-configure gd --with-webp --with-jpeg --with-xpm --with-freetype \ 34 | && docker-php-ext-install opcache bcmath bz2 gd mysqli pdo pdo_mysql zip sockets pcntl \ 35 | && docker-php-ext-enable opcache redis xlswriter swoole \ 36 | # Composer 37 | && curl $PHP_COMPOSER_URL -o /usr/local/bin/composer \ 38 | && chmod a+x /usr/local/bin/composer \ 39 | # Clean 40 | && apt-get -y remove $DEPENDENCIES \ 41 | && apt-get purge -y --auto-remove \ 42 | && rm -rf /var/lib/apt/lists/* /tmp/pear ~/.pearrc && cd $WORKING_DIR && cd .. && rm -rf $WORKING_DIR \ 43 | # For me 44 | && ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone \ 45 | && sed -i 's/deb.debian.org/mirrors.ustc.edu.cn/g' /etc/apt/sources.list.d/debian.sources \ 46 | && php --ri swoole && php --ri xlswriter 47 | 48 | # After Build 49 | WORKDIR /www 50 | 51 | COPY php.ini /usr/local/etc/php/ 52 | -------------------------------------------------------------------------------- /8.2/cli/trixie/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM php:8.2-cli-trixie 2 | 3 | LABEL maintainer="yansongda " 4 | 5 | # ENV for Global 6 | ENV TZ="Asia/Shanghai" 7 | ENV DEPENDENCIES="gnupg git gcc g++" 8 | ENV WORKING_DIR="/tmp" 9 | 10 | # ENV for PHP 11 | ENV PHP_DEPENDENCIES="curl wget unzip ca-certificates libcurl4-openssl-dev libwebp-dev libbz2-dev libpng-dev libxpm-dev libfreetype6-dev libjpeg-dev libssh-dev libzip-dev" 12 | ENV PHP_EXT_INSTALLED_PECL="redis-6.3.0 xlswriter-1.5.8" 13 | ENV PHP_EXT_SWOOLE_VERSION="6.1.4" 14 | ENV PHP_COMPOSER_URL="https://getcomposer.org/composer-stable.phar" 15 | 16 | # Prepare 17 | RUN apt-get update \ 18 | && apt-get install -y $PHP_DEPENDENCIES $DEPENDENCIES \ 19 | && pecl install -o -f $PHP_EXT_INSTALLED_PECL \ 20 | # Swoole 21 | && mkdir -p $WORKING_DIR && cd $WORKING_DIR \ 22 | && curl -SL "https://github.com/swoole/swoole-src/archive/v${PHP_EXT_SWOOLE_VERSION}.tar.gz" -o swoole.tar.gz \ 23 | && ls -alh \ 24 | && mkdir -p swoole \ 25 | && tar -xf swoole.tar.gz -C swoole --strip-components=1 \ 26 | && ( \ 27 | cd swoole \ 28 | && phpize \ 29 | && ./configure --enable-openssl --enable-swoole-curl \ 30 | && make -s -j$(nproc) && make install \ 31 | ) \ 32 | # Extentions 33 | && docker-php-ext-configure gd --with-webp --with-jpeg --with-xpm --with-freetype \ 34 | && docker-php-ext-install opcache bcmath bz2 gd mysqli pdo pdo_mysql zip sockets pcntl \ 35 | && docker-php-ext-enable opcache redis xlswriter swoole \ 36 | # Composer 37 | && curl $PHP_COMPOSER_URL -o /usr/local/bin/composer \ 38 | && chmod a+x /usr/local/bin/composer \ 39 | # Clean 40 | && apt-get -y remove $DEPENDENCIES \ 41 | && apt-get purge -y --auto-remove \ 42 | && rm -rf /var/lib/apt/lists/* /tmp/pear ~/.pearrc && cd $WORKING_DIR && cd .. && rm -rf $WORKING_DIR \ 43 | # For me 44 | && ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone \ 45 | && sed -i 's/deb.debian.org/mirrors.ustc.edu.cn/g' /etc/apt/sources.list.d/debian.sources \ 46 | && php --ri swoole && php --ri xlswriter 47 | 48 | # After Build 49 | WORKDIR /www 50 | 51 | COPY php.ini /usr/local/etc/php/ 52 | -------------------------------------------------------------------------------- /8.0/cli/alpine/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM php:8.0-cli-alpine 2 | 3 | LABEL maintainer="yansongda " 4 | 5 | # ENV for Global 6 | ENV TZ=Asia/Shanghai 7 | ENV DEPENDENCIES $PHPIZE_DEPS curl-dev openssl-dev pcre-dev pcre2-dev zlib-dev 8 | ENV BUILD_DIR /tmp 9 | 10 | # ENV for PHP 11 | ENV PHP_DEPENDENCIES \ 12 | libpng-dev libzip-dev freetype-dev \ 13 | libwebp-dev libjpeg-turbo-dev libxpm-dev \ 14 | bzip2-dev libstdc++ 15 | ENV PHP_EXT_PECL_INSTALL \ 16 | redis-6.0.2 xlswriter-1.5.5 17 | ENV PHP_EXT_SWOOLE_VERSION 5.1.1 18 | ENV PHP_COMPOSER_URL https://getcomposer.org/composer-stable.phar 19 | 20 | # Prepare 21 | RUN apk add -U --no-cache --virtual .build-deps $DEPENDENCIES \ 22 | && apk add -U --no-cache tzdata $PHP_DEPENDENCIES \ 23 | && pecl install -o -f $PHP_EXT_PECL_INSTALL \ 24 | # Swoole 25 | && mkdir -p $BUILD_DIR && cd $BUILD_DIR \ 26 | && curl -SL "https://github.com/swoole/swoole-src/archive/v${PHP_EXT_SWOOLE_VERSION}.tar.gz" -o swoole.tar.gz \ 27 | && ls -alh \ 28 | && mkdir -p swoole \ 29 | && tar -xf swoole.tar.gz -C swoole --strip-components=1 \ 30 | && ( \ 31 | cd swoole \ 32 | && phpize \ 33 | && ./configure --enable-openssl --enable-swoole-curl \ 34 | && make -s -j$(nproc) && make install \ 35 | ) \ 36 | # Extentions 37 | && docker-php-ext-configure gd --with-webp --with-jpeg --with-xpm --with-freetype \ 38 | && docker-php-ext-install opcache bcmath bz2 gd mysqli pdo pdo_mysql zip sockets pcntl \ 39 | && docker-php-ext-enable redis xlswriter swoole \ 40 | # Composer 41 | && curl $PHP_COMPOSER_URL -o /usr/local/bin/composer \ 42 | && chmod a+x /usr/local/bin/composer \ 43 | # Clean 44 | && apk del .build-deps \ 45 | && rm -rf /tmp/* ~/.pearrc /var/cache/apk/* \ 46 | && cd && rm -rf $BUILD_DIR \ 47 | ## For me 48 | && sed -i 's/dl-cdn.alpinelinux.org/mirrors.tuna.tsinghua.edu.cn/g' /etc/apk/repositories \ 49 | && cp /usr/share/zoneinfo/$TZ /etc/localtime && date \ 50 | && php --ri swoole && php --ri xlswriter 51 | 52 | # After Build 53 | WORKDIR /www 54 | 55 | COPY php.ini /usr/local/etc/php/ 56 | -------------------------------------------------------------------------------- /8.3/cli/trixie/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM php:8.3-cli-trixie 2 | 3 | LABEL maintainer="yansongda " 4 | 5 | # ENV for Global 6 | ENV TZ="Asia/Shanghai" 7 | ENV DEPENDENCIES="gnupg git gcc g++" 8 | ENV WORKING_DIR="/tmp" 9 | 10 | # ENV for PHP 11 | ENV PHP_DEPENDENCIES="curl wget unzip ca-certificates libcurl4-openssl-dev libwebp-dev libbz2-dev libpng-dev libxpm-dev libc-ares-dev libfreetype6-dev libjpeg-dev libssh-dev libzip-dev" 12 | ENV PHP_EXT_INSTALLED_PECL="redis-6.3.0 xlswriter-1.5.8" 13 | ENV PHP_EXT_SWOOLE_VERSION="6.1.4" 14 | ENV PHP_COMPOSER_URL="https://getcomposer.org/composer-stable.phar" 15 | 16 | # Prepare 17 | RUN apt-get update \ 18 | && apt-get install -y $PHP_DEPENDENCIES $DEPENDENCIES \ 19 | && pecl install -o -f $PHP_EXT_INSTALLED_PECL \ 20 | # Swoole 21 | && mkdir -p $WORKING_DIR && cd $WORKING_DIR \ 22 | && curl -SL "https://github.com/swoole/swoole-src/archive/v${PHP_EXT_SWOOLE_VERSION}.tar.gz" -o swoole.tar.gz \ 23 | && ls -alh \ 24 | && mkdir -p swoole \ 25 | && tar -xf swoole.tar.gz -C swoole --strip-components=1 \ 26 | && ( \ 27 | cd swoole \ 28 | && phpize \ 29 | && ./configure --enable-openssl --enable-swoole-curl --enable-cares \ 30 | && make -s -j$(nproc) && make install \ 31 | ) \ 32 | # Extentions 33 | && docker-php-ext-configure gd --with-webp --with-jpeg --with-xpm --with-freetype \ 34 | && docker-php-ext-install opcache bcmath bz2 gd mysqli pdo pdo_mysql zip sockets pcntl \ 35 | && docker-php-ext-enable opcache redis xlswriter swoole \ 36 | # Composer 37 | && curl $PHP_COMPOSER_URL -o /usr/local/bin/composer \ 38 | && chmod a+x /usr/local/bin/composer \ 39 | # Clean 40 | && apt-get -y remove $DEPENDENCIES \ 41 | && apt-get purge -y --auto-remove \ 42 | && rm -rf /var/lib/apt/lists/* /tmp/pear ~/.pearrc && cd $WORKING_DIR && cd .. && rm -rf $WORKING_DIR \ 43 | # For me 44 | && ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone \ 45 | && sed -i 's/deb.debian.org/mirrors.ustc.edu.cn/g' /etc/apt/sources.list.d/debian.sources \ 46 | && php --ri swoole && php --ri xlswriter 47 | 48 | # After Build 49 | WORKDIR /www 50 | 51 | COPY php.ini /usr/local/etc/php/ 52 | -------------------------------------------------------------------------------- /8.4/cli/trixie/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM php:8.4-cli-trixie 2 | 3 | LABEL maintainer="yansongda " 4 | 5 | # ENV for Global 6 | ENV TZ="Asia/Shanghai" 7 | ENV DEPENDENCIES="gnupg git gcc g++" 8 | ENV WORKING_DIR="/tmp" 9 | 10 | # ENV for PHP 11 | ENV PHP_DEPENDENCIES="curl wget unzip ca-certificates libcurl4-openssl-dev libwebp-dev libbz2-dev libpng-dev libxpm-dev libc-ares-dev libfreetype6-dev libjpeg-dev libssh-dev libzip-dev" 12 | ENV PHP_EXT_INSTALLED_PECL="redis-6.3.0 xlswriter-1.5.8" 13 | ENV PHP_EXT_SWOOLE_VERSION="6.1.4" 14 | ENV PHP_COMPOSER_URL="https://getcomposer.org/composer-stable.phar" 15 | 16 | # Prepare 17 | RUN apt-get update \ 18 | && apt-get install -y $PHP_DEPENDENCIES $DEPENDENCIES \ 19 | && pecl install -o -f $PHP_EXT_INSTALLED_PECL \ 20 | # Swoole 21 | && mkdir -p $WORKING_DIR && cd $WORKING_DIR \ 22 | && curl -SL "https://github.com/swoole/swoole-src/archive/v${PHP_EXT_SWOOLE_VERSION}.tar.gz" -o swoole.tar.gz \ 23 | && ls -alh \ 24 | && mkdir -p swoole \ 25 | && tar -xf swoole.tar.gz -C swoole --strip-components=1 \ 26 | && ( \ 27 | cd swoole \ 28 | && phpize \ 29 | && ./configure --enable-openssl --enable-swoole-curl --enable-cares \ 30 | && make -s -j$(nproc) && make install \ 31 | ) \ 32 | # Extentions 33 | && docker-php-ext-configure gd --with-webp --with-jpeg --with-xpm --with-freetype \ 34 | && docker-php-ext-install opcache bcmath bz2 gd mysqli pdo pdo_mysql zip sockets pcntl \ 35 | && docker-php-ext-enable opcache redis xlswriter swoole \ 36 | # Composer 37 | && curl $PHP_COMPOSER_URL -o /usr/local/bin/composer \ 38 | && chmod a+x /usr/local/bin/composer \ 39 | # Clean 40 | && apt-get -y remove $DEPENDENCIES \ 41 | && apt-get purge -y --auto-remove \ 42 | && rm -rf /var/lib/apt/lists/* /tmp/pear ~/.pearrc && cd $WORKING_DIR && cd .. && rm -rf $WORKING_DIR \ 43 | # For me 44 | && ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone \ 45 | && sed -i 's/deb.debian.org/mirrors.ustc.edu.cn/g' /etc/apt/sources.list.d/debian.sources \ 46 | && php --ri swoole && php --ri xlswriter 47 | 48 | # After Build 49 | WORKDIR /www 50 | 51 | COPY php.ini /usr/local/etc/php/ 52 | -------------------------------------------------------------------------------- /8.5/cli/trixie/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM php:8.5-cli-trixie 2 | 3 | LABEL maintainer="yansongda " 4 | 5 | # ENV for Global 6 | ENV TZ="Asia/Shanghai" 7 | ENV DEPENDENCIES="gnupg git gcc g++" 8 | ENV WORKING_DIR="/tmp" 9 | 10 | # ENV for PHP 11 | ENV PHP_DEPENDENCIES="curl wget unzip ca-certificates libcurl4-openssl-dev libwebp-dev libbz2-dev libpng-dev libxpm-dev libc-ares-dev libfreetype6-dev libjpeg-dev libssh-dev libzip-dev" 12 | ENV PHP_EXT_INSTALLED_PECL="redis-6.3.0 xlswriter-1.5.8" 13 | ENV PHP_EXT_SWOOLE_VERSION="6.1.4" 14 | ENV PHP_COMPOSER_URL="https://getcomposer.org/composer-stable.phar" 15 | 16 | # Prepare 17 | RUN apt-get update \ 18 | && apt-get install -y $PHP_DEPENDENCIES $DEPENDENCIES \ 19 | && pecl install -o -f $PHP_EXT_INSTALLED_PECL \ 20 | # Swoole 21 | && mkdir -p $WORKING_DIR && cd $WORKING_DIR \ 22 | && curl -SL "https://github.com/swoole/swoole-src/archive/v${PHP_EXT_SWOOLE_VERSION}.tar.gz" -o swoole.tar.gz \ 23 | && ls -alh \ 24 | && mkdir -p swoole \ 25 | && tar -xf swoole.tar.gz -C swoole --strip-components=1 \ 26 | && ( \ 27 | cd swoole \ 28 | && phpize \ 29 | && ./configure --enable-openssl --enable-swoole-curl --enable-cares \ 30 | && make -s -j$(nproc) && make install \ 31 | ) \ 32 | # Extentions 33 | && docker-php-ext-configure gd --with-webp --with-jpeg --with-xpm --with-freetype \ 34 | && docker-php-ext-install opcache bcmath bz2 gd mysqli pdo pdo_mysql zip sockets pcntl \ 35 | && docker-php-ext-enable opcache redis xlswriter swoole \ 36 | # Composer 37 | && curl $PHP_COMPOSER_URL -o /usr/local/bin/composer \ 38 | && chmod a+x /usr/local/bin/composer \ 39 | # Clean 40 | && apt-get -y remove $DEPENDENCIES \ 41 | && apt-get purge -y --auto-remove \ 42 | && rm -rf /var/lib/apt/lists/* /tmp/pear ~/.pearrc && cd $WORKING_DIR && cd .. && rm -rf $WORKING_DIR \ 43 | # For me 44 | && ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone \ 45 | && sed -i 's/deb.debian.org/mirrors.ustc.edu.cn/g' /etc/apt/sources.list.d/debian.sources \ 46 | && php --ri swoole && php --ri xlswriter 47 | 48 | # After Build 49 | WORKDIR /www 50 | 51 | COPY php.ini /usr/local/etc/php/ 52 | -------------------------------------------------------------------------------- /8.0/cli/bullseye/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM php:8.0-cli-bullseye 2 | 3 | LABEL maintainer="yansongda " 4 | 5 | # ENV for Global 6 | ENV TZ=Asia/Shanghai 7 | ENV DEPENDENCIES gnupg git gcc g++ 8 | ENV WORKING_DIR /tmp 9 | 10 | # ENV for PHP 11 | ENV PHP_DEPENDENCIES \ 12 | curl wget unzip libcurl4-openssl-dev libwebp-dev \ 13 | libbz2-dev libpng-dev libxpm-dev \ 14 | libfreetype6-dev libjpeg-dev libssh-dev libzip-dev 15 | ENV PHP_EXT_INSTALLED_PECL \ 16 | redis-6.0.2 xlswriter-1.5.5 17 | ENV PHP_EXT_SWOOLE_VERSION 5.1.1 18 | ENV PHP_COMPOSER_URL https://getcomposer.org/composer-stable.phar 19 | 20 | # Prepare 21 | RUN apt-get update \ 22 | && apt-get install -y $PHP_DEPENDENCIES $DEPENDENCIES \ 23 | && pecl install -o -f $PHP_EXT_INSTALLED_PECL \ 24 | # Swoole 25 | && mkdir -p $WORKING_DIR && cd $WORKING_DIR \ 26 | && curl -SL "https://github.com/swoole/swoole-src/archive/v${PHP_EXT_SWOOLE_VERSION}.tar.gz" -o swoole.tar.gz \ 27 | && ls -alh \ 28 | && mkdir -p swoole \ 29 | && tar -xf swoole.tar.gz -C swoole --strip-components=1 \ 30 | && ( \ 31 | cd swoole \ 32 | && phpize \ 33 | && ./configure --enable-openssl --enable-swoole-curl \ 34 | && make -s -j$(nproc) && make install \ 35 | ) \ 36 | # Extentions 37 | && docker-php-ext-configure gd --with-webp --with-jpeg --with-xpm --with-freetype \ 38 | && docker-php-ext-install opcache bcmath bz2 gd mysqli pdo pdo_mysql zip sockets pcntl \ 39 | && docker-php-ext-enable opcache redis xlswriter swoole \ 40 | # Composer 41 | && curl $PHP_COMPOSER_URL -o /usr/local/bin/composer \ 42 | && chmod a+x /usr/local/bin/composer \ 43 | # Clean 44 | && apt-get -y remove $DEPENDENCIES \ 45 | && apt-get purge -y --auto-remove \ 46 | && rm -rf /var/lib/apt/lists/* /tmp/pear ~/.pearrc && cd $WORKING_DIR && cd .. && rm -rf $WORKING_DIR \ 47 | # For me 48 | && ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone \ 49 | && php --ri swoole && php --ri xlswriter 50 | 51 | # After Build 52 | WORKDIR /www 53 | 54 | COPY ./bullseye/sources.list /etc/apt/sources.list 55 | COPY php.ini /usr/local/etc/php/ 56 | -------------------------------------------------------------------------------- /7.4/cli/alpine/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM php:7.4-cli-alpine 2 | 3 | LABEL maintainer="yansongda " 4 | 5 | # ENV for Global 6 | ENV TZ=Asia/Shanghai 7 | ENV DEPENDENCIES $PHPIZE_DEPS curl-dev openssl-dev pcre-dev pcre2-dev zlib-dev 8 | ENV BUILD_DIR /tmp 9 | 10 | # ENV for PHP 11 | ENV PHP_DEPENDENCIES \ 12 | libpng-dev libzip-dev freetype-dev \ 13 | libwebp-dev libjpeg-turbo-dev libxpm-dev \ 14 | bzip2-dev libstdc++ 15 | ENV PHP_EXT_PECL_INSTALL \ 16 | redis-5.3.7 xlswriter-1.5.4 17 | ENV PHP_EXT_SWOOLE_VERSION 4.8.13 18 | ENV PHP_COMPOSER_URL https://getcomposer.org/composer-stable.phar 19 | 20 | # Prepare 21 | RUN apk add -U --no-cache --virtual .build-deps $DEPENDENCIES \ 22 | && apk add -U --no-cache tzdata $PHP_DEPENDENCIES \ 23 | && pecl install -o -f $PHP_EXT_PECL_INSTALL \ 24 | # Swoole 25 | && mkdir -p $BUILD_DIR && cd $BUILD_DIR \ 26 | && curl -SL "https://github.com/swoole/swoole-src/archive/v${PHP_EXT_SWOOLE_VERSION}.tar.gz" -o swoole.tar.gz \ 27 | && ls -alh \ 28 | && mkdir -p swoole \ 29 | && tar -xf swoole.tar.gz -C swoole --strip-components=1 \ 30 | && ( \ 31 | cd swoole \ 32 | && phpize \ 33 | && ./configure --enable-openssl --enable-http2 --enable-swoole-json --enable-swoole-curl \ 34 | && make -s -j$(nproc) && make install \ 35 | ) \ 36 | # Extentions 37 | && docker-php-ext-configure gd --with-webp --with-jpeg --with-xpm --with-freetype \ 38 | && docker-php-ext-install opcache bcmath bz2 gd mysqli pdo pdo_mysql zip sockets pcntl \ 39 | && docker-php-ext-enable redis xlswriter swoole \ 40 | # Composer 41 | && curl $PHP_COMPOSER_URL -o /usr/local/bin/composer \ 42 | && chmod a+x /usr/local/bin/composer \ 43 | # Clean 44 | && apk del .build-deps \ 45 | && rm -rf /tmp/* ~/.pearrc /var/cache/apk/* \ 46 | && cd && rm -rf $BUILD_DIR \ 47 | ## For me 48 | && sed -i 's/dl-cdn.alpinelinux.org/mirrors.tuna.tsinghua.edu.cn/g' /etc/apk/repositories \ 49 | && cp /usr/share/zoneinfo/$TZ /etc/localtime && date \ 50 | && php --ri swoole && php --ri xlswriter 51 | 52 | # After Build 53 | WORKDIR /www 54 | 55 | COPY php.ini /usr/local/etc/php/ 56 | -------------------------------------------------------------------------------- /7.4/cli/bullseye/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM php:7.4-cli-bullseye 2 | 3 | LABEL maintainer="yansongda " 4 | 5 | # ENV for Global 6 | ENV TZ=Asia/Shanghai 7 | ENV DEPENDENCIES gnupg git gcc g++ 8 | ENV WORKING_DIR /tmp 9 | 10 | # ENV for PHP 11 | ENV PHP_DEPENDENCIES \ 12 | curl wget unzip libcurl4-openssl-dev libwebp-dev \ 13 | libbz2-dev libpng-dev libxpm-dev \ 14 | libfreetype6-dev libjpeg-dev libssh-dev libzip-dev 15 | ENV PHP_EXT_INSTALLED_PECL \ 16 | redis-5.3.7 xlswriter-1.5.4 17 | ENV PHP_EXT_SWOOLE_VERSION 4.8.13 18 | ENV PHP_COMPOSER_URL https://getcomposer.org/composer-stable.phar 19 | 20 | # Prepare 21 | RUN apt-get update \ 22 | && apt-get install -y $PHP_DEPENDENCIES $DEPENDENCIES \ 23 | && pecl install -o -f $PHP_EXT_INSTALLED_PECL \ 24 | # Swoole 25 | && mkdir -p $WORKING_DIR && cd $WORKING_DIR \ 26 | && curl -SL "https://github.com/swoole/swoole-src/archive/v${PHP_EXT_SWOOLE_VERSION}.tar.gz" -o swoole.tar.gz \ 27 | && ls -alh \ 28 | && mkdir -p swoole \ 29 | && tar -xf swoole.tar.gz -C swoole --strip-components=1 \ 30 | && ( \ 31 | cd swoole \ 32 | && phpize \ 33 | && ./configure --enable-openssl --enable-http2 --enable-swoole-json --enable-swoole-curl \ 34 | && make -s -j$(nproc) && make install \ 35 | ) \ 36 | # Extentions 37 | && docker-php-ext-configure gd --with-webp --with-jpeg --with-xpm --with-freetype \ 38 | && docker-php-ext-install opcache bcmath bz2 gd mysqli pdo pdo_mysql zip sockets pcntl \ 39 | && docker-php-ext-enable opcache redis xlswriter swoole \ 40 | # Composer 41 | && curl $PHP_COMPOSER_URL -o /usr/local/bin/composer \ 42 | && chmod a+x /usr/local/bin/composer \ 43 | # Clean 44 | && apt-get -y remove $DEPENDENCIES \ 45 | && apt-get purge -y --auto-remove \ 46 | && rm -rf /var/lib/apt/lists/* /tmp/pear ~/.pearrc && cd $WORKING_DIR && cd .. && rm -rf $WORKING_DIR \ 47 | # For me 48 | && ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone \ 49 | && php --ri swoole && php --ri xlswriter 50 | 51 | # After Build 52 | WORKDIR /www 53 | 54 | COPY ./bullseye/sources.list /etc/apt/sources.list 55 | COPY php.ini /usr/local/etc/php/ 56 | -------------------------------------------------------------------------------- /8.0/fpm/alpine/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM php:8.0-fpm-alpine 2 | 3 | LABEL maintainer="yansongda " 4 | 5 | # ENV for Global 6 | ENV TZ=Asia/Shanghai 7 | ENV DEPENDENCIES $PHPIZE_DEPS curl-dev openssl-dev pcre-dev pcre2-dev zlib-dev 8 | ENV BUILD_DIR /tmp 9 | 10 | # ENV for PHP 11 | ENV PHP_DEPENDENCIES \ 12 | libstdc++ rabbitmq-c-dev libpng-dev \ 13 | libwebp-dev libjpeg-turbo-dev libxpm-dev \ 14 | bzip2-dev libzip-dev freetype-dev 15 | ENV PHP_EXT_PECL_INSTALL \ 16 | redis-6.0.2 xlswriter-1.5.5 mongodb-1.16.2 amqp-2.1.1 17 | ENV PHP_EXT_SWOOLE_VERSION 5.1.1 18 | ENV PHP_COMPOSER_URL https://getcomposer.org/composer-stable.phar 19 | 20 | # Prepare 21 | RUN apk add -U --no-cache --virtual .build-deps $DEPENDENCIES \ 22 | && apk add -U --no-cache tzdata $PHP_DEPENDENCIES \ 23 | && pecl install -o -f $PHP_EXT_PECL_INSTALL \ 24 | # Swoole 25 | && mkdir -p $BUILD_DIR && cd $BUILD_DIR \ 26 | && curl -SL "https://github.com/swoole/swoole-src/archive/v${PHP_EXT_SWOOLE_VERSION}.tar.gz" -o swoole.tar.gz \ 27 | && ls -alh \ 28 | && mkdir -p swoole \ 29 | && tar -xf swoole.tar.gz -C swoole --strip-components=1 \ 30 | && ( \ 31 | cd swoole \ 32 | && phpize \ 33 | && ./configure --enable-openssl --enable-swoole-curl \ 34 | && make -s -j$(nproc) && make install \ 35 | ) \ 36 | # Extentions 37 | && docker-php-ext-configure gd --with-webp --with-jpeg --with-xpm --with-freetype \ 38 | && docker-php-ext-install opcache bcmath bz2 gd mysqli pdo pdo_mysql zip sockets pcntl \ 39 | && docker-php-ext-enable mongodb redis amqp xlswriter swoole \ 40 | # Composer 41 | && curl $PHP_COMPOSER_URL -o /usr/local/bin/composer \ 42 | && chmod a+x /usr/local/bin/composer \ 43 | # Clean 44 | && apk del .build-deps \ 45 | && rm -rf /tmp/* ~/.pearrc /var/cache/apk/* \ 46 | && cd && rm -rf $BUILD_DIR \ 47 | ## For me 48 | && sed -i 's/dl-cdn.alpinelinux.org/mirrors.tuna.tsinghua.edu.cn/g' /etc/apk/repositories \ 49 | && cp /usr/share/zoneinfo/$TZ /etc/localtime && date \ 50 | && php --ri swoole && php --ri xlswriter 51 | 52 | # After Build 53 | WORKDIR /www 54 | 55 | COPY php.ini /usr/local/etc/php/ 56 | COPY php-fpm-www.conf /usr/local/etc/php-fpm.d/www.conf 57 | -------------------------------------------------------------------------------- /8.0/fpm/bullseye/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM php:8.0-fpm-bullseye 2 | 3 | LABEL maintainer="yansongda " 4 | 5 | # ENV for Global 6 | ENV TZ=Asia/Shanghai 7 | ENV DEPENDENCIES gnupg git gcc g++ 8 | ENV WORKING_DIR /tmp 9 | 10 | # ENV for PHP 11 | ENV PHP_DEPENDENCIES \ 12 | curl wget unzip libcurl4-openssl-dev libwebp-dev \ 13 | libbz2-dev libpng-dev libxpm-dev librabbitmq-dev \ 14 | libfreetype6-dev libjpeg-dev libssh-dev libzip-dev 15 | ENV PHP_EXT_INSTALLED_PECL \ 16 | redis-6.0.2 xlswriter-1.5.5 mongodb-1.16.2 amqp-2.1.1 17 | ENV PHP_EXT_SWOOLE_VERSION 5.1.1 18 | ENV PHP_COMPOSER_URL https://getcomposer.org/composer-stable.phar 19 | 20 | # Prepare 21 | RUN apt-get update \ 22 | && apt-get install -y $PHP_DEPENDENCIES $DEPENDENCIES \ 23 | && pecl install -o -f $PHP_EXT_INSTALLED_PECL \ 24 | # Swoole 25 | && mkdir -p $WORKING_DIR && cd $WORKING_DIR \ 26 | && curl -SL "https://github.com/swoole/swoole-src/archive/v${PHP_EXT_SWOOLE_VERSION}.tar.gz" -o swoole.tar.gz \ 27 | && ls -alh \ 28 | && mkdir -p swoole \ 29 | && tar -xf swoole.tar.gz -C swoole --strip-components=1 \ 30 | && ( \ 31 | cd swoole \ 32 | && phpize \ 33 | && ./configure --enable-openssl --enable-swoole-curl \ 34 | && make -s -j$(nproc) && make install \ 35 | ) \ 36 | # Extentions 37 | && docker-php-ext-configure gd --with-webp --with-jpeg --with-xpm --with-freetype \ 38 | && docker-php-ext-install opcache bcmath bz2 gd mysqli pdo pdo_mysql zip sockets pcntl \ 39 | && docker-php-ext-enable opcache mongodb redis amqp xlswriter swoole \ 40 | # Composer 41 | && curl $PHP_COMPOSER_URL -o /usr/local/bin/composer \ 42 | && chmod a+x /usr/local/bin/composer \ 43 | # Clean 44 | && apt-get -y remove $DEPENDENCIES \ 45 | && apt-get purge -y --auto-remove \ 46 | && rm -rf /var/lib/apt/lists/* /tmp/pear ~/.pearrc && cd $WORKING_DIR && cd .. && rm -rf $WORKING_DIR \ 47 | # For me 48 | && ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone \ 49 | && php --ri swoole && php --ri xlswriter 50 | 51 | # After Build 52 | WORKDIR /www 53 | 54 | COPY ./bullseye/sources.list /etc/apt/sources.list 55 | COPY php.ini /usr/local/etc/php/ 56 | COPY php-fpm-www.conf /usr/local/etc/php-fpm.d/www.conf 57 | -------------------------------------------------------------------------------- /7.4/fpm/alpine/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM php:7.4-fpm-alpine 2 | 3 | LABEL maintainer="yansongda " 4 | 5 | # ENV for Global 6 | ENV TZ=Asia/Shanghai 7 | ENV DEPENDENCIES $PHPIZE_DEPS curl-dev openssl-dev pcre-dev pcre2-dev zlib-dev 8 | ENV BUILD_DIR /tmp 9 | 10 | # ENV for PHP 11 | ENV PHP_DEPENDENCIES \ 12 | libstdc++ rabbitmq-c-dev libpng-dev \ 13 | libwebp-dev libjpeg-turbo-dev libxpm-dev \ 14 | bzip2-dev libzip-dev freetype-dev 15 | ENV PHP_EXT_PECL_INSTALL \ 16 | mongodb-1.14.2 redis-5.3.7 amqp-1.11.0 xlswriter-1.5.4 17 | ENV PHP_EXT_SWOOLE_VERSION 4.8.13 18 | ENV PHP_COMPOSER_URL https://getcomposer.org/composer-stable.phar 19 | 20 | # Prepare 21 | RUN apk add -U --no-cache --virtual .build-deps $DEPENDENCIES \ 22 | && apk add -U --no-cache tzdata $PHP_DEPENDENCIES \ 23 | && pecl install -o -f $PHP_EXT_PECL_INSTALL \ 24 | # Swoole 25 | && mkdir -p $BUILD_DIR && cd $BUILD_DIR \ 26 | && curl -SL "https://github.com/swoole/swoole-src/archive/v${PHP_EXT_SWOOLE_VERSION}.tar.gz" -o swoole.tar.gz \ 27 | && ls -alh \ 28 | && mkdir -p swoole \ 29 | && tar -xf swoole.tar.gz -C swoole --strip-components=1 \ 30 | && ( \ 31 | cd swoole \ 32 | && phpize \ 33 | && ./configure --enable-openssl --enable-http2 --enable-swoole-json --enable-swoole-curl \ 34 | && make -s -j$(nproc) && make install \ 35 | ) \ 36 | # Extentions 37 | && docker-php-ext-configure gd --with-webp --with-jpeg --with-xpm --with-freetype \ 38 | && docker-php-ext-install opcache bcmath bz2 gd mysqli pdo pdo_mysql zip sockets pcntl \ 39 | && docker-php-ext-enable mongodb redis amqp xlswriter swoole \ 40 | # Composer 41 | && curl $PHP_COMPOSER_URL -o /usr/local/bin/composer \ 42 | && chmod a+x /usr/local/bin/composer \ 43 | # Clean 44 | && apk del .build-deps \ 45 | && rm -rf /tmp/* ~/.pearrc /var/cache/apk/* \ 46 | && cd && rm -rf $BUILD_DIR \ 47 | ## For me 48 | && sed -i 's/dl-cdn.alpinelinux.org/mirrors.tuna.tsinghua.edu.cn/g' /etc/apk/repositories \ 49 | && cp /usr/share/zoneinfo/$TZ /etc/localtime && date \ 50 | && php --ri swoole && php --ri xlswriter 51 | 52 | # After Build 53 | WORKDIR /www 54 | 55 | COPY php.ini /usr/local/etc/php/ 56 | COPY php-fpm-www.conf /usr/local/etc/php-fpm.d/www.conf 57 | -------------------------------------------------------------------------------- /7.4/fpm/bullseye/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM php:7.4-fpm-bullseye 2 | 3 | LABEL maintainer="yansongda " 4 | 5 | # ENV for Global 6 | ENV TZ=Asia/Shanghai 7 | ENV DEPENDENCIES gnupg git gcc g++ 8 | ENV WORKING_DIR /tmp 9 | 10 | # ENV for PHP 11 | ENV PHP_DEPENDENCIES \ 12 | curl wget unzip libcurl4-openssl-dev libwebp-dev \ 13 | libbz2-dev libpng-dev libxpm-dev librabbitmq-dev \ 14 | libfreetype6-dev libjpeg-dev libssh-dev libzip-dev 15 | ENV PHP_EXT_INSTALLED_PECL \ 16 | mongodb-1.14.2 redis-5.3.7 amqp-1.11.0 xlswriter-1.5.4 17 | ENV PHP_EXT_SWOOLE_VERSION 4.8.13 18 | ENV PHP_COMPOSER_URL https://getcomposer.org/composer-stable.phar 19 | 20 | # Prepare 21 | RUN apt-get update \ 22 | && apt-get install -y $PHP_DEPENDENCIES $DEPENDENCIES \ 23 | && pecl install -o -f $PHP_EXT_INSTALLED_PECL \ 24 | # Swoole 25 | && mkdir -p $WORKING_DIR && cd $WORKING_DIR \ 26 | && curl -SL "https://github.com/swoole/swoole-src/archive/v${PHP_EXT_SWOOLE_VERSION}.tar.gz" -o swoole.tar.gz \ 27 | && ls -alh \ 28 | && mkdir -p swoole \ 29 | && tar -xf swoole.tar.gz -C swoole --strip-components=1 \ 30 | && ( \ 31 | cd swoole \ 32 | && phpize \ 33 | && ./configure --enable-openssl --enable-http2 --enable-swoole-json --enable-swoole-curl \ 34 | && make -s -j$(nproc) && make install \ 35 | ) \ 36 | # Extentions 37 | && docker-php-ext-configure gd --with-webp --with-jpeg --with-xpm --with-freetype \ 38 | && docker-php-ext-install opcache bcmath bz2 gd mysqli pdo pdo_mysql zip sockets pcntl \ 39 | && docker-php-ext-enable opcache mongodb redis amqp xlswriter swoole \ 40 | # Composer 41 | && curl $PHP_COMPOSER_URL -o /usr/local/bin/composer \ 42 | && chmod a+x /usr/local/bin/composer \ 43 | # Clean 44 | && apt-get -y remove $DEPENDENCIES \ 45 | && apt-get purge -y --auto-remove \ 46 | && rm -rf /var/lib/apt/lists/* /tmp/pear ~/.pearrc && cd $WORKING_DIR && cd .. && rm -rf $WORKING_DIR \ 47 | # For me 48 | && ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone \ 49 | && php --ri swoole && php --ri xlswriter 50 | 51 | # After Build 52 | WORKDIR /www 53 | 54 | COPY ./bullseye/sources.list /etc/apt/sources.list 55 | COPY php.ini /usr/local/etc/php/ 56 | COPY php-fpm-www.conf /usr/local/etc/php-fpm.d/www.conf 57 | -------------------------------------------------------------------------------- /7.1/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM php:7.1.33-fpm 2 | 3 | LABEL maintainer="yansongda " 4 | 5 | # Global 6 | ENV TZ=Asia/Shanghai 7 | ENV DEPENDENCIES curl gnupg git wget gcc g++ 8 | ENV WORKING_DIR /www/software 9 | 10 | # ENV for PHP 11 | ENV PHP_DEPENDENCIES \ 12 | unzip libwebp-dev libmcrypt-dev libmemcached-dev libbz2-dev libpng-dev \ 13 | libxpm-dev librabbitmq-dev libfreetype6-dev libjpeg-dev libssh-dev 14 | ENV PHP_EXT_INSTALLED_PECL \ 15 | mongodb-1.6.0 redis-4.3.0 memcached-3.1.4 mcrypt-1.0.3 amqp-1.9.4 16 | ENV PHP_EXT_SWOOLE_VERSION 4.4.12 17 | ENV PHP_COMPOSER_URL https://getcomposer.org/composer-stable.phar 18 | ENV PHP_COMPOSER_REPO https://mirrors.aliyun.com/composer/ 19 | 20 | # INSTALL PHP 21 | RUN apt-get update \ 22 | && apt-get install -y $PHP_DEPENDENCIES $DEPENDENCIES \ 23 | # INSTALL PHP EXT-SWOOLE 24 | && mkdir -p $WORKING_DIR && cd $WORKING_DIR \ 25 | && curl -SL "https://github.com/swoole/swoole-src/archive/v${PHP_EXT_SWOOLE_VERSION}.tar.gz" -o swoole.tar.gz \ 26 | && ls -alh \ 27 | && mkdir -p swoole \ 28 | && tar -xf swoole.tar.gz -C swoole --strip-components=1 \ 29 | && ( \ 30 | cd swoole \ 31 | && phpize \ 32 | && ./configure --enable-mysqlnd --enable-openssl --enable-http2 \ 33 | && make -s -j$(nproc) && make install \ 34 | ) \ 35 | # INSTALL PHP EXT 36 | && pecl install -o -f $PHP_EXT_INSTALLED_PECL \ 37 | && docker-php-ext-configure gd --with-gd --with-webp-dir --with-jpeg-dir \ 38 | --with-png-dir --with-zlib-dir --with-xpm-dir --with-freetype-dir \ 39 | && docker-php-ext-install opcache bcmath bz2 gd iconv mysqli pdo pdo_mysql zip sockets \ 40 | && docker-php-ext-enable opcache redis memcached mongodb mcrypt amqp swoole \ 41 | && curl $PHP_COMPOSER_URL -o /usr/local/bin/composer \ 42 | && chmod a+x /usr/local/bin/composer \ 43 | && composer config -g repo.packagist composer $PHP_COMPOSER_REPO \ 44 | # CLEAN 45 | && ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone \ 46 | && apt-get -y remove $DEPENDENCIES \ 47 | && apt-get purge -y --auto-remove \ 48 | && rm -rf /var/lib/apt/lists/* \ 49 | && rm -rf /tmp/pear ~/.pearrc \ 50 | && cd $WORKING_DIR && cd .. && rm -rf $WORKING_DIR 51 | 52 | # After Build 53 | WORKDIR /www 54 | 55 | COPY sources.list /etc/apt/sources.list 56 | COPY php.ini /usr/local/etc/php/ 57 | COPY php-fpm-www.conf /usr/local/etc/php-fpm.d/www.conf 58 | -------------------------------------------------------------------------------- /7.3/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM php:7.3-fpm 2 | 3 | LABEL maintainer="yansongda " 4 | 5 | # ENV for Global 6 | ENV TZ=Asia/Shanghai 7 | ENV DEPENDENCIES gnupg git gcc g++ 8 | ENV WORKING_DIR /www/software 9 | 10 | # ENV for PHP 11 | ENV PHP_DEPENDENCIES \ 12 | curl wget unzip libcurl4-openssl-dev libwebp-dev libmcrypt-dev \ 13 | libbz2-dev libpng-dev libxpm-dev librabbitmq-dev \ 14 | libfreetype6-dev libjpeg-dev libssh-dev libzip-dev 15 | ENV PHP_EXT_INSTALLED_PECL \ 16 | mongodb-1.9.1 redis-5.3.4 mcrypt-1.0.4 amqp-1.10.2 17 | ENV PHP_EXT_SWOOLE_VERSION 4.8.2 18 | ENV PHP_COMPOSER_URL https://getcomposer.org/composer-stable.phar 19 | ENV PHP_COMPOSER_REPO https://mirrors.aliyun.com/composer/ 20 | 21 | # INSTALL PHP 22 | RUN apt-get update \ 23 | && apt-get install -y $PHP_DEPENDENCIES $DEPENDENCIES \ 24 | # INSTALL PHP EXT-SWOOLE 25 | && mkdir -p $WORKING_DIR && cd $WORKING_DIR \ 26 | && curl -SL "https://github.com/swoole/swoole-src/archive/v${PHP_EXT_SWOOLE_VERSION}.tar.gz" -o swoole.tar.gz \ 27 | && ls -alh \ 28 | && mkdir -p swoole \ 29 | && tar -xf swoole.tar.gz -C swoole --strip-components=1 \ 30 | && ( \ 31 | cd swoole \ 32 | && phpize \ 33 | && ./configure --enable-openssl --enable-http2 --enable-swoole-json --enable-swoole-curl \ 34 | && make -s -j$(nproc) && make install \ 35 | ) \ 36 | # INSTALL PHP EXT 37 | && pecl install -o -f $PHP_EXT_INSTALLED_PECL \ 38 | && docker-php-ext-configure gd --with-gd --with-webp-dir --with-jpeg-dir \ 39 | --with-png-dir --with-zlib-dir --with-xpm-dir --with-freetype-dir \ 40 | && docker-php-ext-install opcache bcmath bz2 gd iconv mysqli pdo pdo_mysql zip sockets pcntl \ 41 | && docker-php-ext-enable opcache redis mongodb mcrypt amqp swoole \ 42 | && curl $PHP_COMPOSER_URL -o /usr/local/bin/composer \ 43 | && chmod a+x /usr/local/bin/composer \ 44 | && composer config -g repo.packagist composer $PHP_COMPOSER_REPO \ 45 | # CLEAN 46 | && ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone \ 47 | && apt-get -y remove $DEPENDENCIES \ 48 | && apt-get purge -y --auto-remove \ 49 | && rm -rf /var/lib/apt/lists/* \ 50 | && rm -rf /tmp/pear ~/.pearrc \ 51 | && cd $WORKING_DIR && cd .. && rm -rf $WORKING_DIR 52 | 53 | # After Build 54 | WORKDIR /www 55 | 56 | COPY sources.list /etc/apt/sources.list 57 | COPY php.ini /usr/local/etc/php/ 58 | COPY php-fpm-www.conf /usr/local/etc/php-fpm.d/www.conf 59 | -------------------------------------------------------------------------------- /7.2/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM php:7.2.34-fpm 2 | 3 | LABEL maintainer="yansongda " 4 | 5 | # ENV for Global 6 | ENV TZ=Asia/Shanghai 7 | ENV DEPENDENCIES gnupg git gcc g++ 8 | ENV WORKING_DIR /www/software 9 | 10 | # ENV for PHP 11 | ENV PHP_DEPENDENCIES \ 12 | curl wget unzip libcurl4-openssl-dev libwebp-dev libmcrypt-dev \ 13 | libmemcached-dev libbz2-dev libpng-dev libxpm-dev librabbitmq-dev \ 14 | libfreetype6-dev libjpeg-dev libssh-dev 15 | ENV PHP_EXT_INSTALLED_PECL \ 16 | mongodb-1.7.4 redis-4.3.0 memcached-3.1.5 mcrypt-1.0.3 amqp-1.10.2 grpc-1.30.0 17 | ENV PHP_EXT_SWOOLE_VERSION 4.4.22 18 | ENV PHP_COMPOSER_URL https://getcomposer.org/composer-stable.phar 19 | ENV PHP_COMPOSER_REPO https://mirrors.aliyun.com/composer/ 20 | 21 | # INSTALL PHP 22 | RUN apt update \ 23 | && apt install -y $PHP_DEPENDENCIES $DEPENDENCIES \ 24 | # INSTALL PHP EXT-SWOOLE 25 | && mkdir -p $WORKING_DIR && cd $WORKING_DIR \ 26 | && curl -SL "https://github.com/swoole/swoole-src/archive/v${PHP_EXT_SWOOLE_VERSION}.tar.gz" -o swoole.tar.gz \ 27 | && ls -alh \ 28 | && mkdir -p swoole \ 29 | && tar -xf swoole.tar.gz -C swoole --strip-components=1 \ 30 | && ( \ 31 | cd swoole \ 32 | && phpize \ 33 | && ./configure --enable-mysqlnd --enable-openssl --enable-http2 \ 34 | && make -s -j$(nproc) && make install \ 35 | ) \ 36 | # INSTALL PHP EXT 37 | && pecl install -o -f $PHP_EXT_INSTALLED_PECL \ 38 | && docker-php-ext-configure gd --with-gd --with-webp-dir --with-jpeg-dir \ 39 | --with-png-dir --with-zlib-dir --with-xpm-dir --with-freetype-dir \ 40 | && docker-php-ext-install opcache bcmath bz2 gd iconv mysqli pdo pdo_mysql zip sockets \ 41 | && docker-php-ext-enable opcache redis memcached mongodb mcrypt amqp swoole grpc \ 42 | && curl $PHP_COMPOSER_URL -o /usr/local/bin/composer \ 43 | && chmod a+x /usr/local/bin/composer \ 44 | && composer config -g repo.packagist composer $PHP_COMPOSER_REPO \ 45 | # CLEAN 46 | && ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone \ 47 | && apt -y remove $DEPENDENCIES \ 48 | && apt purge -y --auto-remove \ 49 | && rm -rf /var/lib/apt/lists/* \ 50 | && rm -rf /tmp/pear ~/.pearrc \ 51 | && cd $WORKING_DIR && cd .. && rm -rf $WORKING_DIR 52 | 53 | # After Build 54 | WORKDIR /www 55 | 56 | COPY sources.list /etc/apt/sources.list 57 | COPY php.ini /usr/local/etc/php/ 58 | COPY php-fpm-www.conf /usr/local/etc/php-fpm.d/www.conf 59 | -------------------------------------------------------------------------------- /.github/workflows/docker.yml: -------------------------------------------------------------------------------- 1 | name: Docker Image 2 | 3 | on: 4 | push: 5 | branchs: 6 | - master 7 | schedule: 8 | - cron: '0 0 * * 1' 9 | 10 | env: 11 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 12 | GITHUB_IMAGE_REPOSITORY: ghcr.io/${{ github.repository }} 13 | DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_ACCESSTOKEN }} 14 | DOCKERHUB_IMAGE_REPOSITORY: yansongda/php 15 | ALIYUN_IMAGE_TOKEN: ${{ secrets.ALIYUN_IMAGE_ACCESSTOKEN }} 16 | ALIYUN_IMAGE_REPOSITORY: registry.cn-shenzhen.aliyuncs.com/yansongda/php 17 | 18 | jobs: 19 | build: 20 | name: Image ${{ matrix.php-mode }}-${{ matrix.php-version }}-${{ matrix.system }}-${{ matrix.platform }} 21 | runs-on: ubuntu-latest 22 | permissions: 23 | packages: write 24 | strategy: 25 | fail-fast: false 26 | matrix: 27 | php-version: 28 | # - '8.5' 29 | - '8.4' 30 | - '8.3' 31 | - '8.2' 32 | - '8.1' 33 | php-mode: 34 | - cli 35 | system: 36 | - alpine 37 | - trixie 38 | platform: 39 | - linux/amd64 40 | - linux/arm64 41 | steps: 42 | - name: Checkout 43 | uses: actions/checkout@v4 44 | - name: Recognize tag 45 | run: | 46 | platform=$(echo ${{ matrix.platform }} | sed 's/linux\///g') 47 | tag=$platform'-'${{ matrix.php-mode }}-${{ matrix.php-version }}-${{ matrix.system }} 48 | 49 | echo $tag 50 | echo "tag=$tag" >> $GITHUB_ENV 51 | - name: Set up QEMU 52 | uses: docker/setup-qemu-action@v3 53 | with: 54 | platforms: arm64 55 | - name: Build the docker image 56 | run: | 57 | docker buildx ls 58 | docker buildx build -t app --platform ${{ matrix.platform }} -f ./${{ matrix.php-version }}/${{ matrix.php-mode }}/${{ matrix.system }}/Dockerfile ./${{ matrix.php-version }}/${{ matrix.php-mode }} 59 | - name: Push the image to Aliyun registry 60 | run: | 61 | docker tag app $ALIYUN_IMAGE_REPOSITORY:$tag 62 | echo $ALIYUN_IMAGE_TOKEN | docker login --username=yansongda registry.cn-shenzhen.aliyuncs.com --password-stdin 63 | docker push $ALIYUN_IMAGE_REPOSITORY:$tag 64 | docker logout 65 | - name: Push the image to Docker registry 66 | run: | 67 | docker tag app $DOCKERHUB_IMAGE_REPOSITORY:$tag 68 | echo $DOCKERHUB_TOKEN | docker login --username yansongda --password-stdin 69 | docker push $DOCKERHUB_IMAGE_REPOSITORY:$tag 70 | docker logout 71 | - name: Push the image to Github registry 72 | run: | 73 | docker tag app $GITHUB_IMAGE_REPOSITORY:$tag 74 | echo $GITHUB_TOKEN | docker login --username=${{ github.actor }} ghcr.io --password-stdin 75 | docker push $GITHUB_IMAGE_REPOSITORY:$tag 76 | docker logout 77 | 78 | manifest: 79 | name: Manifest ${{ matrix.php-mode }}-${{ matrix.php-version }}-${{ matrix.system }} 80 | runs-on: ubuntu-latest 81 | needs: 82 | - build 83 | strategy: 84 | fail-fast: false 85 | matrix: 86 | php-version: 87 | # - '8.5' 88 | - '8.4' 89 | - '8.3' 90 | - '8.2' 91 | - '8.1' 92 | php-mode: 93 | - cli 94 | system: 95 | - alpine 96 | - trixie 97 | env: 98 | PLATFORMS: "linux/arm64 linux/amd64" 99 | steps: 100 | - name: Recognize manifest 101 | run: | 102 | tag=${{ matrix.php-mode }}-${{ matrix.php-version }}-${{ matrix.system }} 103 | 104 | echo $tag 105 | echo "tag=$tag" >> $GITHUB_ENV 106 | - name: Push the manifest to Aliyun registry 107 | run: | 108 | echo $ALIYUN_IMAGE_TOKEN | docker login --username=yansongda registry.cn-shenzhen.aliyuncs.com --password-stdin 109 | 110 | list=$(echo $PLATFORMS | sed 's/linux\///g') 111 | 112 | aliyun='' 113 | for platform in $list; 114 | do 115 | aliyun=$aliyun$ALIYUN_IMAGE_REPOSITORY':'$platform'-'$tag' ' 116 | done 117 | 118 | docker manifest create $ALIYUN_IMAGE_REPOSITORY:$tag $aliyun 119 | docker manifest push $ALIYUN_IMAGE_REPOSITORY:$tag 120 | docker logout 121 | - name: Push the manifest to Docker registry 122 | run: | 123 | echo $DOCKERHUB_TOKEN | docker login --username yansongda --password-stdin 124 | 125 | list=$(echo $PLATFORMS | sed 's/linux\///g') 126 | 127 | hub='' 128 | for platform in $list; 129 | do 130 | hub=$hub$DOCKERHUB_IMAGE_REPOSITORY':'$platform'-'$tag' ' 131 | done 132 | 133 | docker manifest create $DOCKERHUB_IMAGE_REPOSITORY:$tag $hub 134 | docker manifest push $DOCKERHUB_IMAGE_REPOSITORY:$tag 135 | docker logout 136 | - name: Push the manifest to Github registry 137 | run: | 138 | echo $GITHUB_TOKEN | docker login --username=${{ github.actor }} ghcr.io --password-stdin 139 | 140 | list=$(echo $PLATFORMS | sed 's/linux\///g') 141 | 142 | github='' 143 | for platform in $list; 144 | do 145 | github=$github$GITHUB_IMAGE_REPOSITORY':'$platform'-'$tag' ' 146 | done 147 | 148 | docker manifest create $GITHUB_IMAGE_REPOSITORY:$tag $github 149 | docker manifest push $GITHUB_IMAGE_REPOSITORY:$tag 150 | docker logout -------------------------------------------------------------------------------- /7.1/php-fpm-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 = 100 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 = 20 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 = 5 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 = 35 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 = /proc/self/fd/2 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 = 20 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 | -------------------------------------------------------------------------------- /7.2/php-fpm-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 = 100 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 = 20 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 = 5 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 = 35 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 = /proc/self/fd/2 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 = 20 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 | -------------------------------------------------------------------------------- /7.3/php-fpm-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 = 100 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 = 20 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 = 5 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 = 35 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 = /proc/self/fd/2 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 = 20 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 | -------------------------------------------------------------------------------- /7.4/fpm/php-fpm-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 = 100 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 = 20 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 = 5 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 = 35 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 = /proc/self/fd/2 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 = 20 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 | -------------------------------------------------------------------------------- /8.0/fpm/php-fpm-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 = 100 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 = 20 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 = 5 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 = 35 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 = /proc/self/fd/2 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 = 20 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 | --------------------------------------------------------------------------------