├── .gitignore ├── Dockerfile-5.6 ├── Dockerfile-7.1 ├── Dockerfile-7.2 ├── Dockerfile-7.3 ├── README.md ├── conf ├── nginx-site.conf ├── nginx.conf ├── php-fpm.conf ├── php-www.conf ├── php.ini ├── supervisor.d │ ├── cron.conf │ ├── nginx.conf │ └── php-fpm.conf └── supervisord.conf ├── dependencies ├── nginx-custom.php ├── nginx-vts-exporter └── php-fpm-exporter.linux.amd64 ├── examples └── hello-world │ ├── Dockerfile │ └── src │ └── index.php ├── healthz.php ├── scripts ├── healthcheck.py ├── start-web.sh ├── start-worker.sh └── supervisor-healthcheck.sh └── test └── php └── slow.php /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store -------------------------------------------------------------------------------- /Dockerfile-5.6: -------------------------------------------------------------------------------- 1 | FROM alpine:3.7 2 | 3 | RUN apk add --no-cache bash supervisor curl 4 | 5 | # Install nginx 6 | 7 | ENV NGINX_VERSION 1.17.0 8 | 9 | # Add PHP public keys 10 | ADD https://dl.bintray.com/php-alpine/key/php-alpine.rsa.pub /etc/apk/keys/php-alpine.rsa.pub 11 | 12 | RUN GPG_KEYS=B0F4253373F8F6F510D42178520A9993A1C052F8 \ 13 | && CONFIG="\ 14 | --prefix=/etc/nginx \ 15 | --sbin-path=/usr/sbin/nginx \ 16 | --modules-path=/usr/lib/nginx/modules \ 17 | --conf-path=/etc/nginx/nginx.conf \ 18 | --error-log-path=/var/log/nginx/error.log \ 19 | --http-log-path=/var/log/nginx/access.log \ 20 | --pid-path=/var/run/nginx.pid \ 21 | --lock-path=/var/run/nginx.lock \ 22 | --http-client-body-temp-path=/var/cache/nginx/client_temp \ 23 | --http-proxy-temp-path=/var/cache/nginx/proxy_temp \ 24 | --http-fastcgi-temp-path=/var/cache/nginx/fastcgi_temp \ 25 | --http-uwsgi-temp-path=/var/cache/nginx/uwsgi_temp \ 26 | --http-scgi-temp-path=/var/cache/nginx/scgi_temp \ 27 | --user=nginx \ 28 | --group=nginx \ 29 | --with-http_ssl_module \ 30 | --with-http_realip_module \ 31 | --with-http_addition_module \ 32 | --with-http_sub_module \ 33 | --with-http_dav_module \ 34 | --with-http_flv_module \ 35 | --with-http_mp4_module \ 36 | --with-http_gunzip_module \ 37 | --with-http_gzip_static_module \ 38 | --with-http_random_index_module \ 39 | --with-http_secure_link_module \ 40 | --with-http_stub_status_module \ 41 | --with-http_auth_request_module \ 42 | --with-http_xslt_module=dynamic \ 43 | --with-http_image_filter_module=dynamic \ 44 | --with-http_geoip_module=dynamic \ 45 | --with-threads \ 46 | --with-stream \ 47 | --with-stream_ssl_module \ 48 | --with-stream_ssl_preread_module \ 49 | --with-stream_realip_module \ 50 | --with-stream_geoip_module=dynamic \ 51 | --with-http_slice_module \ 52 | --with-mail \ 53 | --with-mail_ssl_module \ 54 | --with-compat \ 55 | --with-file-aio \ 56 | --with-http_v2_module \ 57 | --add-module=/usr/src/ngx_http_redis-0.3.9 \ 58 | --add-module=/usr/src/ngx_devel_kit-0.3.0 \ 59 | --add-module=/usr/src/set-misc-nginx-module-0.32 \ 60 | --add-module=/usr/src/ngx_http_substitutions_filter_module-0.6.4 \ 61 | " \ 62 | && addgroup -S nginx \ 63 | && adduser -D -S -h /var/cache/nginx -s /sbin/nologin -G nginx nginx \ 64 | && apk add --no-cache --virtual .build-deps \ 65 | gcc \ 66 | libc-dev \ 67 | make \ 68 | openssl-dev \ 69 | pcre-dev \ 70 | zlib-dev \ 71 | linux-headers \ 72 | curl \ 73 | gnupg1 \ 74 | libxslt-dev \ 75 | gd-dev \ 76 | geoip-dev \ 77 | && curl -fSL https://nginx.org/download/nginx-$NGINX_VERSION.tar.gz -o nginx.tar.gz \ 78 | && curl -fSL https://nginx.org/download/nginx-$NGINX_VERSION.tar.gz.asc -o nginx.tar.gz.asc \ 79 | && curl -fSL https://people.freebsd.org/~osa/ngx_http_redis-0.3.9.tar.gz -o http-redis.tar.gz \ 80 | && curl -fSL https://github.com/openresty/set-misc-nginx-module/archive/v0.32.tar.gz -o set-misc.tar.gz \ 81 | && curl -fSL https://github.com/simplresty/ngx_devel_kit/archive/v0.3.0.tar.gz -o ngx_devel_kit.tar.gz \ 82 | && curl -fSL https://github.com/yaoweibin/ngx_http_substitutions_filter_module/archive/v0.6.4.tar.gz -o ngx_http_substitutions_filter_module.tar.gz \ 83 | && export GNUPGHOME="$(mktemp -d)" \ 84 | && found=''; \ 85 | for server in \ 86 | ha.pool.sks-keyservers.net \ 87 | hkp://keyserver.ubuntu.com:80 \ 88 | hkp://p80.pool.sks-keyservers.net:80 \ 89 | pgp.mit.edu \ 90 | ; do \ 91 | echo "Fetching GPG key $GPG_KEYS from $server"; \ 92 | gpg --keyserver "$server" --keyserver-options timeout=10 --recv-keys "$GPG_KEYS" && found=yes && break; \ 93 | done; \ 94 | test -z "$found" && echo >&2 "error: failed to fetch GPG key $GPG_KEYS" && exit 1; \ 95 | gpg --batch --verify nginx.tar.gz.asc nginx.tar.gz \ 96 | && rm -rf "$GNUPGHOME" nginx.tar.gz.asc \ 97 | && mkdir -p /usr/src \ 98 | && tar -zxC /usr/src -f nginx.tar.gz \ 99 | && rm nginx.tar.gz \ 100 | && tar -zxC /usr/src -f http-redis.tar.gz \ 101 | && rm http-redis.tar.gz \ 102 | && tar -zxC /usr/src -f set-misc.tar.gz \ 103 | && rm set-misc.tar.gz \ 104 | && tar -zxC /usr/src -f ngx_http_substitutions_filter_module.tar.gz \ 105 | && rm ngx_http_substitutions_filter_module.tar.gz \ 106 | && tar -zxC /usr/src -f ngx_devel_kit.tar.gz \ 107 | && rm ngx_devel_kit.tar.gz \ 108 | && cd /usr/src/nginx-$NGINX_VERSION \ 109 | && ./configure $CONFIG --with-debug \ 110 | && make -j$(getconf _NPROCESSORS_ONLN) \ 111 | && mv objs/nginx objs/nginx-debug \ 112 | && mv objs/ngx_http_xslt_filter_module.so objs/ngx_http_xslt_filter_module-debug.so \ 113 | && mv objs/ngx_http_image_filter_module.so objs/ngx_http_image_filter_module-debug.so \ 114 | && mv objs/ngx_http_geoip_module.so objs/ngx_http_geoip_module-debug.so \ 115 | && mv objs/ngx_stream_geoip_module.so objs/ngx_stream_geoip_module-debug.so \ 116 | && ./configure $CONFIG \ 117 | && make -j$(getconf _NPROCESSORS_ONLN) \ 118 | && make install \ 119 | && rm -rf /etc/nginx/html/ \ 120 | && mkdir /etc/nginx/conf.d/ \ 121 | && mkdir -p /usr/share/nginx/html/ \ 122 | && install -m644 html/index.html /usr/share/nginx/html/ \ 123 | && install -m644 html/50x.html /usr/share/nginx/html/ \ 124 | && install -m755 objs/nginx-debug /usr/sbin/nginx-debug \ 125 | && install -m755 objs/ngx_http_xslt_filter_module-debug.so /usr/lib/nginx/modules/ngx_http_xslt_filter_module-debug.so \ 126 | && install -m755 objs/ngx_http_image_filter_module-debug.so /usr/lib/nginx/modules/ngx_http_image_filter_module-debug.so \ 127 | && install -m755 objs/ngx_http_geoip_module-debug.so /usr/lib/nginx/modules/ngx_http_geoip_module-debug.so \ 128 | && install -m755 objs/ngx_stream_geoip_module-debug.so /usr/lib/nginx/modules/ngx_stream_geoip_module-debug.so \ 129 | && ln -s ../../usr/lib/nginx/modules /etc/nginx/modules \ 130 | && strip /usr/sbin/nginx* \ 131 | && strip /usr/lib/nginx/modules/*.so \ 132 | && rm -rf /usr/src/nginx-$NGINX_VERSION \ 133 | \ 134 | # Bring in gettext so we can get `envsubst`, then throw 135 | # the rest away. To do this, we need to install `gettext` 136 | # then move `envsubst` out of the way so `gettext` can 137 | # be deleted completely, then move `envsubst` back. 138 | && apk add --no-cache --virtual .gettext gettext \ 139 | && mv /usr/bin/envsubst /tmp/ \ 140 | \ 141 | && runDeps="$( \ 142 | scanelf --needed --nobanner --format '%n#p' /usr/sbin/nginx /usr/lib/nginx/modules/*.so /tmp/envsubst \ 143 | | tr ',' '\n' \ 144 | | sort -u \ 145 | | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \ 146 | )" \ 147 | && apk add --no-cache --virtual .nginx-rundeps $runDeps \ 148 | && apk del .build-deps \ 149 | && apk del .gettext \ 150 | && mv /tmp/envsubst /usr/local/bin/ \ 151 | \ 152 | # Bring in tzdata so users could set the timezones through the environment 153 | # variables 154 | && apk add --no-cache tzdata \ 155 | \ 156 | # forward request and error logs to docker log collector 157 | && ln -sf /dev/stdout /var/log/nginx/access.log \ 158 | && ln -sf /dev/stderr /var/log/nginx/error.log 159 | 160 | # Nginx temp upload dir 161 | RUN mkdir -p /var/nginx-uploads && chown nobody:nobody /var/nginx-uploads 162 | 163 | RUN mkdir -p /var/cache/nginx/client_temp && \ 164 | mkdir -p /var/cache/nginx/proxy_temp && \ 165 | mkdir -p /var/cache/nginx/fastcgi_temp && \ 166 | mkdir -p /var/cache/nginx/uwsgi_temp && \ 167 | mkdir -p /var/cache/nginx/scgi_temp 168 | 169 | RUN chown -R nobody:nobody /var/cache/nginx/client_temp && \ 170 | chown -R nobody:nobody /var/cache/nginx/proxy_temp && \ 171 | chown -R nobody:nobody /var/cache/nginx/fastcgi_temp && \ 172 | chown -R nobody:nobody /var/cache/nginx/uwsgi_temp && \ 173 | chown -R nobody:nobody /var/cache/nginx/scgi_temp 174 | 175 | COPY scripts/supervisor-healthcheck.sh /supervisor-healthcheck.sh 176 | COPY scripts/healthcheck.py /healthcheck.py 177 | RUN chmod +x /supervisor-healthcheck.sh 178 | 179 | RUN apk add --no-cache \ 180 | php5 \ 181 | php5-common \ 182 | php5-curl \ 183 | php5-dom \ 184 | php5-exif \ 185 | php5-ftp \ 186 | php5-gd \ 187 | php5-iconv \ 188 | php5-mysqli \ 189 | php5-openssl \ 190 | php5-pdo \ 191 | php5-posix \ 192 | php5-soap \ 193 | php5-zip \ 194 | php5-ldap \ 195 | php5-bcmath \ 196 | php5-calendar \ 197 | php5-gettext \ 198 | php5-json \ 199 | php5-pcntl \ 200 | php5-apcu \ 201 | php5-phar \ 202 | php5-sockets \ 203 | php5-wddx \ 204 | php5-xmlreader \ 205 | php5-zip \ 206 | php5-zlib \ 207 | php5-xsl \ 208 | php5-opcache \ 209 | php5-ctype \ 210 | php5-pdo_mysql \ 211 | php5-pdo_sqlite \ 212 | php5-sqlite3 \ 213 | php5-intl \ 214 | php5-fpm 215 | 216 | # Memcached 217 | RUN apk add --no-cache libmemcached 218 | RUN apk --no-cache add ca-certificates && \ 219 | wget -q -O /etc/apk/keys/sgerrand.rsa.pub https://raw.githubusercontent.com/sgerrand/alpine-pkg-php5-memcached/master/sgerrand.rsa.pub && \ 220 | wget https://github.com/sgerrand/alpine-pkg-php5-memcached/releases/download/2.2.0-r0/php5-memcached-2.2.0-r0.apk && \ 221 | apk add php5-memcached-2.2.0-r0.apk && rm -f php5-memcached-2.2.0-r0.apk 222 | 223 | # These only exist in versions prior to 7.2 224 | RUN apk add --no-cache php5-mcrypt \ 225 | php5-xmlrpc php5-mysqli php5-mysql 226 | 227 | # Missing: php5-imagick, php5-redis 228 | 229 | # Imagick 230 | RUN apk --no-cache add ca-certificates wget && \ 231 | apk add --no-cache imagemagick-dev && \ 232 | wget -q -O /etc/apk/keys/sgerrand.rsa.pub https://raw.githubusercontent.com/sgerrand/alpine-pkg-php5-imagick/master/sgerrand.rsa.pub && \ 233 | wget https://github.com/sgerrand/alpine-pkg-php5-imagick/releases/download/3.4.3-r0/php5-imagick-3.4.3-r0.apk && \ 234 | apk add php5-imagick-3.4.3-r0.apk && \ 235 | apk del imagemagick-dev && \ 236 | rm -f php5-imagick-3.4.3-r0.apk 237 | 238 | # Imagick support file types 239 | RUN apk add --no-cache imagemagick 240 | 241 | # Add php5-redis 242 | RUN apk --no-cache add ca-certificates wget && \ 243 | wget --quiet --output-document=/etc/apk/keys/sgerrand.rsa.pub https://alpine-pkgs.sgerrand.com/sgerrand.rsa.pub && \ 244 | wget https://github.com/sgerrand/alpine-pkg-php5-redis/releases/download/3.1.6-r0/php5-redis-3.1.6-r0.apk && \ 245 | apk add php5-redis-3.1.6-r0.apk && \ 246 | rm -f php5-redis-3.1.6-r0.apk 247 | 248 | RUN mkdir -p /src && \ 249 | ln -s /etc/php5 /etc/php && \ 250 | ln -s /usr/bin/php5 /usr/bin/php && \ 251 | ln -s /usr/bin/php-fpm5 /usr/bin/php-fpm 252 | 253 | # Add Composer 254 | RUN curl https://getcomposer.org/installer -o /tmp/composer-installer && php /tmp/composer-installer --install-dir=/usr/local/bin --filename=composer && rm -f /tmp/composer-installer 255 | 256 | # Atatus 257 | RUN wget https://s3.amazonaws.com/atatus-artifacts/atatus-php/downloads/atatus-php-1.7.0-x64-musl.tar.gz && tar -xzvf atatus-php-1.7.0-x64-musl.tar.gz && cd atatus-php-1.7.0-x64-musl && ./install.sh 258 | 259 | # Atatus configurations 260 | RUN sed -i -e 's#atatus.trace.response_time = 2000#atatus.trace.response_time = 1500#g' /etc/php/conf.d/atatus.ini && \ 261 | sed -i -e 's#atatus.collector.pidfile = "/var/run/atatus-php-collector.pid"#atatus.collector.pidfile = "/run/atatus-php-collector.pid"#g' /etc/php/conf.d/atatus.ini && \ 262 | sed -i -e 's#atatus.collector.connection = "/tmp/.atatus.sock"#atatus.collector.connection = "/run/atatus.sock"#g' /etc/php/conf.d/atatus.ini 263 | 264 | 265 | # Supervisor 266 | ADD conf/supervisord.conf /etc/supervisord.conf 267 | ADD conf/supervisor.d /etc/supervisor.d 268 | RUN mkdir -p /etc/supervisord-enabled && mkdir -p /etc/supervisord-worker 269 | 270 | # Scripts 271 | ADD scripts/start-web.sh /start-web.sh 272 | RUN chmod 755 /start-web.sh 273 | ADD scripts/start-worker.sh /start-worker.sh 274 | RUN chmod 755 /start-worker.sh 275 | 276 | ADD conf/nginx.conf /etc/nginx/nginx.conf 277 | 278 | ADD conf/nginx-site.conf /etc/nginx/sites-enabled/site.conf 279 | ADD dependencies/nginx-custom.php /usr/local/bin/nginx-custom 280 | 281 | # Test Nginx 282 | RUN nginx -c /etc/nginx/nginx.conf -t 283 | 284 | ## PHP 285 | ADD conf/php-fpm.conf /etc/php/php-fpm.conf 286 | ADD conf/php.ini /etc/php/php.ini 287 | ADD conf/php-www.conf /etc/php/php-fpm.d/www.conf 288 | 289 | # Test PHP-FPM 290 | RUN /usr/bin/php-fpm --fpm-config /etc/php/php-fpm.conf -t 291 | 292 | # Cron 293 | RUN mkdir -p /etc/cron.d 294 | 295 | CMD ["/start-web.sh"] -------------------------------------------------------------------------------- /Dockerfile-7.1: -------------------------------------------------------------------------------- 1 | FROM alpine:3.7 2 | 3 | ENV PHP_VERSION 7.1 4 | 5 | RUN apk add --no-cache bash supervisor curl 6 | 7 | RUN apk --no-cache add ca-certificates openssl && \ 8 | apk add --no-cache wget ca-certificates \ 9 | && wget -O /etc/apk/keys/phpearth.rsa.pub https://repos.php.earth/alpine/phpearth.rsa.pub \ 10 | && echo "@php https://repos.php.earth/alpine/v3.7" >> /etc/apk/repositories 11 | 12 | # Install nginx 13 | 14 | ENV NGINX_VERSION 1.17.0 15 | 16 | # Add PHP public keys 17 | ADD https://dl.bintray.com/php-alpine/key/php-alpine.rsa.pub /etc/apk/keys/php-alpine.rsa.pub 18 | 19 | RUN GPG_KEYS=B0F4253373F8F6F510D42178520A9993A1C052F8 \ 20 | && CONFIG="\ 21 | --prefix=/etc/nginx \ 22 | --sbin-path=/usr/sbin/nginx \ 23 | --modules-path=/usr/lib/nginx/modules \ 24 | --conf-path=/etc/nginx/nginx.conf \ 25 | --error-log-path=/var/log/nginx/error.log \ 26 | --http-log-path=/var/log/nginx/access.log \ 27 | --pid-path=/var/run/nginx.pid \ 28 | --lock-path=/var/run/nginx.lock \ 29 | --http-client-body-temp-path=/var/cache/nginx/client_temp \ 30 | --http-proxy-temp-path=/var/cache/nginx/proxy_temp \ 31 | --http-fastcgi-temp-path=/var/cache/nginx/fastcgi_temp \ 32 | --http-uwsgi-temp-path=/var/cache/nginx/uwsgi_temp \ 33 | --http-scgi-temp-path=/var/cache/nginx/scgi_temp \ 34 | --user=nginx \ 35 | --group=nginx \ 36 | --with-http_ssl_module \ 37 | --with-http_realip_module \ 38 | --with-http_addition_module \ 39 | --with-http_sub_module \ 40 | --with-http_dav_module \ 41 | --with-http_flv_module \ 42 | --with-http_mp4_module \ 43 | --with-http_gunzip_module \ 44 | --with-http_gzip_static_module \ 45 | --with-http_random_index_module \ 46 | --with-http_secure_link_module \ 47 | --with-http_stub_status_module \ 48 | --with-http_auth_request_module \ 49 | --with-http_xslt_module=dynamic \ 50 | --with-http_image_filter_module=dynamic \ 51 | --with-http_geoip_module=dynamic \ 52 | --with-threads \ 53 | --with-stream \ 54 | --with-stream_ssl_module \ 55 | --with-stream_ssl_preread_module \ 56 | --with-stream_realip_module \ 57 | --with-stream_geoip_module=dynamic \ 58 | --with-http_slice_module \ 59 | --with-mail \ 60 | --with-mail_ssl_module \ 61 | --with-compat \ 62 | --with-file-aio \ 63 | --with-http_v2_module \ 64 | --add-module=/usr/src/ngx_http_redis-0.3.9 \ 65 | --add-module=/usr/src/ngx_devel_kit-0.3.0 \ 66 | --add-module=/usr/src/set-misc-nginx-module-0.32 \ 67 | --add-module=/usr/src/ngx_http_substitutions_filter_module-0.6.4 \ 68 | " \ 69 | && addgroup -S nginx \ 70 | && adduser -D -S -h /var/cache/nginx -s /sbin/nologin -G nginx nginx \ 71 | && apk add --no-cache --virtual .build-deps \ 72 | gcc \ 73 | libc-dev \ 74 | make \ 75 | openssl-dev \ 76 | pcre-dev \ 77 | zlib-dev \ 78 | linux-headers \ 79 | curl \ 80 | gnupg1 \ 81 | libxslt-dev \ 82 | gd-dev \ 83 | geoip-dev \ 84 | && curl -fSL https://nginx.org/download/nginx-$NGINX_VERSION.tar.gz -o nginx.tar.gz \ 85 | && curl -fSL https://nginx.org/download/nginx-$NGINX_VERSION.tar.gz.asc -o nginx.tar.gz.asc \ 86 | && curl -fSL https://people.freebsd.org/~osa/ngx_http_redis-0.3.9.tar.gz -o http-redis.tar.gz \ 87 | && curl -fSL https://github.com/openresty/set-misc-nginx-module/archive/v0.32.tar.gz -o set-misc.tar.gz \ 88 | && curl -fSL https://github.com/simplresty/ngx_devel_kit/archive/v0.3.0.tar.gz -o ngx_devel_kit.tar.gz \ 89 | && curl -fSL https://github.com/yaoweibin/ngx_http_substitutions_filter_module/archive/v0.6.4.tar.gz -o ngx_http_substitutions_filter_module.tar.gz \ 90 | && export GNUPGHOME="$(mktemp -d)" \ 91 | && found=''; \ 92 | for server in \ 93 | ha.pool.sks-keyservers.net \ 94 | hkp://keyserver.ubuntu.com:80 \ 95 | hkp://p80.pool.sks-keyservers.net:80 \ 96 | pgp.mit.edu \ 97 | ; do \ 98 | echo "Fetching GPG key $GPG_KEYS from $server"; \ 99 | gpg --keyserver "$server" --keyserver-options timeout=10 --recv-keys "$GPG_KEYS" && found=yes && break; \ 100 | done; \ 101 | test -z "$found" && echo >&2 "error: failed to fetch GPG key $GPG_KEYS" && exit 1; \ 102 | gpg --batch --verify nginx.tar.gz.asc nginx.tar.gz \ 103 | && rm -rf "$GNUPGHOME" nginx.tar.gz.asc \ 104 | && mkdir -p /usr/src \ 105 | && tar -zxC /usr/src -f nginx.tar.gz \ 106 | && rm nginx.tar.gz \ 107 | && tar -zxC /usr/src -f http-redis.tar.gz \ 108 | && rm http-redis.tar.gz \ 109 | && tar -zxC /usr/src -f set-misc.tar.gz \ 110 | && rm set-misc.tar.gz \ 111 | && tar -zxC /usr/src -f ngx_http_substitutions_filter_module.tar.gz \ 112 | && rm ngx_http_substitutions_filter_module.tar.gz \ 113 | && tar -zxC /usr/src -f ngx_devel_kit.tar.gz \ 114 | && rm ngx_devel_kit.tar.gz \ 115 | && cd /usr/src/nginx-$NGINX_VERSION \ 116 | && ./configure $CONFIG --with-debug \ 117 | && make -j$(getconf _NPROCESSORS_ONLN) \ 118 | && mv objs/nginx objs/nginx-debug \ 119 | && mv objs/ngx_http_xslt_filter_module.so objs/ngx_http_xslt_filter_module-debug.so \ 120 | && mv objs/ngx_http_image_filter_module.so objs/ngx_http_image_filter_module-debug.so \ 121 | && mv objs/ngx_http_geoip_module.so objs/ngx_http_geoip_module-debug.so \ 122 | && mv objs/ngx_stream_geoip_module.so objs/ngx_stream_geoip_module-debug.so \ 123 | && ./configure $CONFIG \ 124 | && make -j$(getconf _NPROCESSORS_ONLN) \ 125 | && make install \ 126 | && rm -rf /etc/nginx/html/ \ 127 | && mkdir /etc/nginx/conf.d/ \ 128 | && mkdir -p /usr/share/nginx/html/ \ 129 | && install -m644 html/index.html /usr/share/nginx/html/ \ 130 | && install -m644 html/50x.html /usr/share/nginx/html/ \ 131 | && install -m755 objs/nginx-debug /usr/sbin/nginx-debug \ 132 | && install -m755 objs/ngx_http_xslt_filter_module-debug.so /usr/lib/nginx/modules/ngx_http_xslt_filter_module-debug.so \ 133 | && install -m755 objs/ngx_http_image_filter_module-debug.so /usr/lib/nginx/modules/ngx_http_image_filter_module-debug.so \ 134 | && install -m755 objs/ngx_http_geoip_module-debug.so /usr/lib/nginx/modules/ngx_http_geoip_module-debug.so \ 135 | && install -m755 objs/ngx_stream_geoip_module-debug.so /usr/lib/nginx/modules/ngx_stream_geoip_module-debug.so \ 136 | && ln -s ../../usr/lib/nginx/modules /etc/nginx/modules \ 137 | && strip /usr/sbin/nginx* \ 138 | && strip /usr/lib/nginx/modules/*.so \ 139 | && rm -rf /usr/src/nginx-$NGINX_VERSION \ 140 | \ 141 | # Bring in gettext so we can get `envsubst`, then throw 142 | # the rest away. To do this, we need to install `gettext` 143 | # then move `envsubst` out of the way so `gettext` can 144 | # be deleted completely, then move `envsubst` back. 145 | && apk add --no-cache --virtual .gettext gettext \ 146 | && mv /usr/bin/envsubst /tmp/ \ 147 | \ 148 | && runDeps="$( \ 149 | scanelf --needed --nobanner --format '%n#p' /usr/sbin/nginx /usr/lib/nginx/modules/*.so /tmp/envsubst \ 150 | | tr ',' '\n' \ 151 | | sort -u \ 152 | | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \ 153 | )" \ 154 | && apk add --no-cache --virtual .nginx-rundeps $runDeps \ 155 | && apk del .build-deps \ 156 | && apk del .gettext \ 157 | && mv /tmp/envsubst /usr/local/bin/ \ 158 | \ 159 | # Bring in tzdata so users could set the timezones through the environment 160 | # variables 161 | && apk add --no-cache tzdata \ 162 | \ 163 | # forward request and error logs to docker log collector 164 | && ln -sf /dev/stdout /var/log/nginx/access.log \ 165 | && ln -sf /dev/stderr /var/log/nginx/error.log 166 | 167 | # Nginx temp upload dir 168 | RUN mkdir -p /var/nginx-uploads && chown nobody:nobody /var/nginx-uploads 169 | 170 | RUN mkdir -p /var/cache/nginx/client_temp && \ 171 | mkdir -p /var/cache/nginx/proxy_temp && \ 172 | mkdir -p /var/cache/nginx/fastcgi_temp && \ 173 | mkdir -p /var/cache/nginx/uwsgi_temp && \ 174 | mkdir -p /var/cache/nginx/scgi_temp 175 | 176 | RUN chown -R nobody:nobody /var/cache/nginx/client_temp && \ 177 | chown -R nobody:nobody /var/cache/nginx/proxy_temp && \ 178 | chown -R nobody:nobody /var/cache/nginx/fastcgi_temp && \ 179 | chown -R nobody:nobody /var/cache/nginx/uwsgi_temp && \ 180 | chown -R nobody:nobody /var/cache/nginx/scgi_temp 181 | 182 | COPY scripts/supervisor-healthcheck.sh /supervisor-healthcheck.sh 183 | COPY scripts/healthcheck.py /healthcheck.py 184 | RUN chmod +x /supervisor-healthcheck.sh 185 | 186 | RUN apk add --no-cache \ 187 | php7.1@php \ 188 | php7.1-common@php \ 189 | php7.1-memcached@php \ 190 | php7.1-curl@php \ 191 | php7.1-dom@php \ 192 | php7.1-exif@php \ 193 | php7.1-fileinfo@php \ 194 | php7.1-ftp@php \ 195 | php7.1-gd@php \ 196 | php7.1-iconv@php \ 197 | php7.1-mbstring@php \ 198 | php7.1-mcrypt@php \ 199 | php7.1-mysqli@php \ 200 | php7.1-mysqlnd@php \ 201 | php7.1-simplexml@php \ 202 | php7.1-openssl@php \ 203 | php7.1-pdo@php \ 204 | php7.1-session@php \ 205 | php7.1-posix@php \ 206 | php7.1-soap@php \ 207 | php7.1-zip@php \ 208 | php7.1-ldap@php \ 209 | php7.1-bcmath@php \ 210 | php7.1-calendar@php \ 211 | php7.1-gettext@php \ 212 | php7.1-json@php \ 213 | php7.1-pcntl@php \ 214 | php7.1-apcu@php \ 215 | php7.1-phar@php \ 216 | php7.1-sockets@php \ 217 | php7.1-tidy@php \ 218 | php7.1-wddx@php \ 219 | php7.1-xmlreader@php \ 220 | php7.1-zip@php \ 221 | php7.1-tokenizer@php \ 222 | php7.1-zlib@php \ 223 | php7.1-xsl@php \ 224 | php7.1-opcache@php \ 225 | php7.1-imagick@php \ 226 | php7.1-ctype@php \ 227 | php7.1-pdo_mysql@php \ 228 | php7.1-pdo_sqlite@php \ 229 | php7.1-sqlite3@php \ 230 | php7.1-redis@php \ 231 | php7.1-intl@php \ 232 | php7.1-xmlrpc@php \ 233 | php7.1-xmlwriter@php \ 234 | php7.1-fpm@php 235 | 236 | # These only exist in 7.1, not 7.2 237 | RUN apk add --no-cache php7-mcrypt@php \ 238 | php7-xmlrpc@php 239 | 240 | # Imagick support file types 241 | RUN apk add --no-cache imagemagick 242 | 243 | RUN mv /etc/php/7.1 /tmp/7.1 && rm -rf /etc/php && rm -rf /etc/php7 && mv /tmp/7.1 /etc/php7 && ln -s /etc/php7 /etc/php 244 | 245 | RUN ln -s /etc/php /etc/php/7.1 246 | 247 | RUN mkdir -p /src && \ 248 | ln -s /etc/php7 /etc/php && \ 249 | ln -s /usr/bin/php /usr/bin/php7 && \ 250 | ln -s /usr/sbin/php-fpm /usr/bin/php-fpm 251 | 252 | # Add Composer 253 | RUN curl https://getcomposer.org/installer -o /tmp/composer-installer && php /tmp/composer-installer --install-dir=/usr/local/bin --filename=composer && rm -f /tmp/composer-installer 254 | 255 | # Atatus 256 | RUN wget https://s3.amazonaws.com/atatus-artifacts/atatus-php/downloads/atatus-php-1.7.0-x64-musl.tar.gz && tar -xzvf atatus-php-1.7.0-x64-musl.tar.gz && cd atatus-php-1.7.0-x64-musl && ./install.sh 257 | 258 | # Atatus configurations 259 | RUN sed -i -e 's#atatus.trace.response_time = 2000#atatus.trace.response_time = 1500#g' /etc/php/conf.d/atatus.ini && \ 260 | sed -i -e 's#atatus.collector.pidfile = "/var/run/atatus-php-collector.pid"#atatus.collector.pidfile = "/run/atatus-php-collector.pid"#g' /etc/php/conf.d/atatus.ini && \ 261 | sed -i -e 's#atatus.collector.connection = "/tmp/.atatus.sock"#atatus.collector.connection = "/run/atatus.sock"#g' /etc/php/conf.d/atatus.ini 262 | 263 | 264 | # Supervisor 265 | ADD conf/supervisord.conf /etc/supervisord.conf 266 | ADD conf/supervisor.d /etc/supervisor.d 267 | RUN mkdir -p /etc/supervisord-enabled && mkdir -p /etc/supervisord-worker 268 | 269 | # Scripts 270 | ADD scripts/start-web.sh /start-web.sh 271 | RUN chmod 755 /start-web.sh 272 | ADD scripts/start-worker.sh /start-worker.sh 273 | RUN chmod 755 /start-worker.sh 274 | 275 | ADD conf/nginx.conf /etc/nginx/nginx.conf 276 | 277 | ADD conf/nginx-site.conf /etc/nginx/sites-enabled/site.conf 278 | ADD dependencies/nginx-custom.php /usr/local/bin/nginx-custom 279 | 280 | # Test Nginx 281 | RUN nginx -c /etc/nginx/nginx.conf -t 282 | 283 | ## PHP 284 | ADD conf/php-fpm.conf /etc/php/php-fpm.conf 285 | ADD conf/php.ini /etc/php/php.ini 286 | ADD conf/php-www.conf /etc/php/php-fpm.d/www.conf 287 | 288 | # Test PHP-FPM 289 | RUN /usr/bin/php-fpm --fpm-config /etc/php/php-fpm.conf -t 290 | 291 | # Cron 292 | RUN mkdir -p /etc/cron.d 293 | 294 | CMD ["/start-web.sh"] 295 | -------------------------------------------------------------------------------- /Dockerfile-7.2: -------------------------------------------------------------------------------- 1 | FROM alpine:3.8 2 | 3 | RUN apk add --no-cache bash supervisor curl 4 | 5 | RUN apk --no-cache add ca-certificates openssl && \ 6 | echo "@php https://dl.bintray.com/php-alpine/v3.8/php-7.2" >> /etc/apk/repositories 7 | 8 | # Install nginx 9 | 10 | ENV NGINX_VERSION 1.17.0 11 | 12 | # Add PHP public keys 13 | ADD https://dl.bintray.com/php-alpine/key/php-alpine.rsa.pub /etc/apk/keys/php-alpine.rsa.pub 14 | 15 | RUN GPG_KEYS=B0F4253373F8F6F510D42178520A9993A1C052F8 \ 16 | && CONFIG="\ 17 | --prefix=/etc/nginx \ 18 | --sbin-path=/usr/sbin/nginx \ 19 | --modules-path=/usr/lib/nginx/modules \ 20 | --conf-path=/etc/nginx/nginx.conf \ 21 | --error-log-path=/var/log/nginx/error.log \ 22 | --http-log-path=/var/log/nginx/access.log \ 23 | --pid-path=/var/run/nginx.pid \ 24 | --lock-path=/var/run/nginx.lock \ 25 | --http-client-body-temp-path=/var/cache/nginx/client_temp \ 26 | --http-proxy-temp-path=/var/cache/nginx/proxy_temp \ 27 | --http-fastcgi-temp-path=/var/cache/nginx/fastcgi_temp \ 28 | --http-uwsgi-temp-path=/var/cache/nginx/uwsgi_temp \ 29 | --http-scgi-temp-path=/var/cache/nginx/scgi_temp \ 30 | --user=nginx \ 31 | --group=nginx \ 32 | --with-http_ssl_module \ 33 | --with-http_realip_module \ 34 | --with-http_addition_module \ 35 | --with-http_sub_module \ 36 | --with-http_dav_module \ 37 | --with-http_flv_module \ 38 | --with-http_mp4_module \ 39 | --with-http_gunzip_module \ 40 | --with-http_gzip_static_module \ 41 | --with-http_random_index_module \ 42 | --with-http_secure_link_module \ 43 | --with-http_stub_status_module \ 44 | --with-http_auth_request_module \ 45 | --with-http_xslt_module=dynamic \ 46 | --with-http_image_filter_module=dynamic \ 47 | --with-http_geoip_module=dynamic \ 48 | --with-threads \ 49 | --with-stream \ 50 | --with-stream_ssl_module \ 51 | --with-stream_ssl_preread_module \ 52 | --with-stream_realip_module \ 53 | --with-stream_geoip_module=dynamic \ 54 | --with-http_slice_module \ 55 | --with-mail \ 56 | --with-mail_ssl_module \ 57 | --with-compat \ 58 | --with-file-aio \ 59 | --with-http_v2_module \ 60 | --add-module=/usr/src/ngx_http_redis-0.3.9 \ 61 | --add-module=/usr/src/ngx_devel_kit-0.3.0 \ 62 | --add-module=/usr/src/set-misc-nginx-module-0.32 \ 63 | --add-module=/usr/src/ngx_http_substitutions_filter_module-0.6.4 \ 64 | " \ 65 | && addgroup -S nginx \ 66 | && adduser -D -S -h /var/cache/nginx -s /sbin/nologin -G nginx nginx \ 67 | && apk add --no-cache --virtual .build-deps \ 68 | gcc \ 69 | libc-dev \ 70 | make \ 71 | openssl-dev \ 72 | pcre-dev \ 73 | zlib-dev \ 74 | linux-headers \ 75 | curl \ 76 | gnupg1 \ 77 | libxslt-dev \ 78 | gd-dev \ 79 | geoip-dev \ 80 | && curl -fSL https://nginx.org/download/nginx-$NGINX_VERSION.tar.gz -o nginx.tar.gz \ 81 | && curl -fSL https://nginx.org/download/nginx-$NGINX_VERSION.tar.gz.asc -o nginx.tar.gz.asc \ 82 | && curl -fSL https://people.freebsd.org/~osa/ngx_http_redis-0.3.9.tar.gz -o http-redis.tar.gz \ 83 | && curl -fSL https://github.com/openresty/set-misc-nginx-module/archive/v0.32.tar.gz -o set-misc.tar.gz \ 84 | && curl -fSL https://github.com/simplresty/ngx_devel_kit/archive/v0.3.0.tar.gz -o ngx_devel_kit.tar.gz \ 85 | && curl -fSL https://github.com/yaoweibin/ngx_http_substitutions_filter_module/archive/v0.6.4.tar.gz -o ngx_http_substitutions_filter_module.tar.gz \ 86 | && export GNUPGHOME="$(mktemp -d)" \ 87 | && found=''; \ 88 | for server in \ 89 | ha.pool.sks-keyservers.net \ 90 | hkp://keyserver.ubuntu.com:80 \ 91 | hkp://p80.pool.sks-keyservers.net:80 \ 92 | pgp.mit.edu \ 93 | ; do \ 94 | echo "Fetching GPG key $GPG_KEYS from $server"; \ 95 | gpg --keyserver "$server" --keyserver-options timeout=10 --recv-keys "$GPG_KEYS" && found=yes && break; \ 96 | done; \ 97 | test -z "$found" && echo >&2 "error: failed to fetch GPG key $GPG_KEYS" && exit 1; \ 98 | gpg --batch --verify nginx.tar.gz.asc nginx.tar.gz \ 99 | && rm -rf "$GNUPGHOME" nginx.tar.gz.asc \ 100 | && mkdir -p /usr/src \ 101 | && tar -zxC /usr/src -f nginx.tar.gz \ 102 | && rm nginx.tar.gz \ 103 | && tar -zxC /usr/src -f http-redis.tar.gz \ 104 | && rm http-redis.tar.gz \ 105 | && tar -zxC /usr/src -f set-misc.tar.gz \ 106 | && rm set-misc.tar.gz \ 107 | && tar -zxC /usr/src -f ngx_http_substitutions_filter_module.tar.gz \ 108 | && rm ngx_http_substitutions_filter_module.tar.gz \ 109 | && tar -zxC /usr/src -f ngx_devel_kit.tar.gz \ 110 | && rm ngx_devel_kit.tar.gz \ 111 | && cd /usr/src/nginx-$NGINX_VERSION \ 112 | && ./configure $CONFIG --with-debug \ 113 | && make -j$(getconf _NPROCESSORS_ONLN) \ 114 | && mv objs/nginx objs/nginx-debug \ 115 | && mv objs/ngx_http_xslt_filter_module.so objs/ngx_http_xslt_filter_module-debug.so \ 116 | && mv objs/ngx_http_image_filter_module.so objs/ngx_http_image_filter_module-debug.so \ 117 | && mv objs/ngx_http_geoip_module.so objs/ngx_http_geoip_module-debug.so \ 118 | && mv objs/ngx_stream_geoip_module.so objs/ngx_stream_geoip_module-debug.so \ 119 | && ./configure $CONFIG \ 120 | && make -j$(getconf _NPROCESSORS_ONLN) \ 121 | && make install \ 122 | && rm -rf /etc/nginx/html/ \ 123 | && mkdir /etc/nginx/conf.d/ \ 124 | && mkdir -p /usr/share/nginx/html/ \ 125 | && install -m644 html/index.html /usr/share/nginx/html/ \ 126 | && install -m644 html/50x.html /usr/share/nginx/html/ \ 127 | && install -m755 objs/nginx-debug /usr/sbin/nginx-debug \ 128 | && install -m755 objs/ngx_http_xslt_filter_module-debug.so /usr/lib/nginx/modules/ngx_http_xslt_filter_module-debug.so \ 129 | && install -m755 objs/ngx_http_image_filter_module-debug.so /usr/lib/nginx/modules/ngx_http_image_filter_module-debug.so \ 130 | && install -m755 objs/ngx_http_geoip_module-debug.so /usr/lib/nginx/modules/ngx_http_geoip_module-debug.so \ 131 | && install -m755 objs/ngx_stream_geoip_module-debug.so /usr/lib/nginx/modules/ngx_stream_geoip_module-debug.so \ 132 | && ln -s ../../usr/lib/nginx/modules /etc/nginx/modules \ 133 | && strip /usr/sbin/nginx* \ 134 | && strip /usr/lib/nginx/modules/*.so \ 135 | && rm -rf /usr/src/nginx-$NGINX_VERSION \ 136 | \ 137 | # Bring in gettext so we can get `envsubst`, then throw 138 | # the rest away. To do this, we need to install `gettext` 139 | # then move `envsubst` out of the way so `gettext` can 140 | # be deleted completely, then move `envsubst` back. 141 | && apk add --no-cache --virtual .gettext gettext \ 142 | && mv /usr/bin/envsubst /tmp/ \ 143 | \ 144 | && runDeps="$( \ 145 | scanelf --needed --nobanner --format '%n#p' /usr/sbin/nginx /usr/lib/nginx/modules/*.so /tmp/envsubst \ 146 | | tr ',' '\n' \ 147 | | sort -u \ 148 | | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \ 149 | )" \ 150 | && apk add --no-cache --virtual .nginx-rundeps $runDeps \ 151 | && apk del .build-deps \ 152 | && apk del .gettext \ 153 | && mv /tmp/envsubst /usr/local/bin/ \ 154 | \ 155 | # Bring in tzdata so users could set the timezones through the environment 156 | # variables 157 | && apk add --no-cache tzdata \ 158 | \ 159 | # forward request and error logs to docker log collector 160 | && ln -sf /dev/stdout /var/log/nginx/access.log \ 161 | && ln -sf /dev/stderr /var/log/nginx/error.log 162 | 163 | # Nginx temp upload dir 164 | RUN mkdir -p /var/nginx-uploads && chown nobody:nobody /var/nginx-uploads 165 | 166 | RUN mkdir -p /var/cache/nginx/client_temp && \ 167 | mkdir -p /var/cache/nginx/proxy_temp && \ 168 | mkdir -p /var/cache/nginx/fastcgi_temp && \ 169 | mkdir -p /var/cache/nginx/uwsgi_temp && \ 170 | mkdir -p /var/cache/nginx/scgi_temp 171 | 172 | RUN chown -R nobody:nobody /var/cache/nginx/client_temp && \ 173 | chown -R nobody:nobody /var/cache/nginx/proxy_temp && \ 174 | chown -R nobody:nobody /var/cache/nginx/fastcgi_temp && \ 175 | chown -R nobody:nobody /var/cache/nginx/uwsgi_temp && \ 176 | chown -R nobody:nobody /var/cache/nginx/scgi_temp 177 | 178 | COPY scripts/supervisor-healthcheck.sh /supervisor-healthcheck.sh 179 | COPY scripts/healthcheck.py /healthcheck.py 180 | RUN chmod +x /supervisor-healthcheck.sh 181 | 182 | RUN apk add --no-cache \ 183 | php7@php \ 184 | php7-common@php \ 185 | php7-memcached@php \ 186 | php7-curl@php \ 187 | php7-dom@php \ 188 | php7-exif@php \ 189 | php7-ftp@php \ 190 | php7-gd@php \ 191 | php7-iconv@php \ 192 | php7-mbstring@php \ 193 | php7-mysqli@php \ 194 | php7-mysqlnd@php \ 195 | php7-openssl@php \ 196 | php7-pdo@php \ 197 | php7-session@php \ 198 | php7-posix@php \ 199 | php7-soap@php \ 200 | php7-zip@php \ 201 | php7-ldap@php \ 202 | php7-bcmath@php \ 203 | php7-calendar@php \ 204 | php7-gettext@php \ 205 | php7-json@php \ 206 | php7-pcntl@php \ 207 | php7-apcu@php \ 208 | php7-phar@php \ 209 | php7-sockets@php \ 210 | php7-tidy@php \ 211 | php7-wddx@php \ 212 | php7-xmlreader@php \ 213 | php7-zip@php \ 214 | php7-zlib@php \ 215 | php7-xsl@php \ 216 | php7-opcache@php \ 217 | php7-imagick@php \ 218 | php7-ctype@php \ 219 | php7-pdo_mysql@php \ 220 | php7-pdo_sqlite@php \ 221 | php7-sqlite3@php \ 222 | php7-redis@php \ 223 | php7-intl@php \ 224 | php7-fpm@php 225 | 226 | # Imagick support file types 227 | RUN apk add --no-cache imagemagick 228 | 229 | RUN mkdir -p /src && \ 230 | ln -s /etc/php7 /etc/php && \ 231 | ln -s /usr/bin/php7 /usr/bin/php && \ 232 | ln -s /usr/sbin/php-fpm7 /usr/bin/php-fpm 233 | 234 | # Add Composer 235 | RUN curl https://getcomposer.org/installer -o /tmp/composer-installer && php /tmp/composer-installer --install-dir=/usr/local/bin --filename=composer && rm -f /tmp/composer-installer 236 | 237 | # Atatus 238 | RUN wget https://s3.amazonaws.com/atatus-artifacts/atatus-php/downloads/atatus-php-1.7.0-x64-musl.tar.gz && tar -xzvf atatus-php-1.7.0-x64-musl.tar.gz && cd atatus-php-1.7.0-x64-musl && ./install.sh 239 | 240 | # Atatus configurations 241 | RUN sed -i -e 's#atatus.trace.response_time = 2000#atatus.trace.response_time = 1500#g' /etc/php/conf.d/atatus.ini && \ 242 | sed -i -e 's#atatus.collector.pidfile = "/var/run/atatus-php-collector.pid"#atatus.collector.pidfile = "/run/atatus-php-collector.pid"#g' /etc/php/conf.d/atatus.ini && \ 243 | sed -i -e 's#atatus.collector.connection = "/tmp/.atatus.sock"#atatus.collector.connection = "/run/atatus.sock"#g' /etc/php/conf.d/atatus.ini 244 | 245 | # Supervisor 246 | ADD conf/supervisord.conf /etc/supervisord.conf 247 | ADD conf/supervisor.d /etc/supervisor.d 248 | RUN mkdir -p /etc/supervisord-enabled && mkdir -p /etc/supervisord-worker 249 | 250 | # Scripts 251 | ADD scripts/start-web.sh /start-web.sh 252 | RUN chmod 755 /start-web.sh 253 | ADD scripts/start-worker.sh /start-worker.sh 254 | RUN chmod 755 /start-worker.sh 255 | 256 | ADD conf/nginx.conf /etc/nginx/nginx.conf 257 | 258 | ADD conf/nginx-site.conf /etc/nginx/sites-enabled/site.conf 259 | ADD dependencies/nginx-custom.php /usr/local/bin/nginx-custom 260 | 261 | # Test Nginx 262 | RUN nginx -c /etc/nginx/nginx.conf -t 263 | 264 | ## PHP 265 | ADD conf/php-fpm.conf /etc/php/php-fpm.conf 266 | ADD conf/php.ini /etc/php/php.ini 267 | ADD conf/php-www.conf /etc/php/php-fpm.d/www.conf 268 | 269 | # Test PHP-FPM 270 | RUN /usr/bin/php-fpm --fpm-config /etc/php/php-fpm.conf -t 271 | 272 | # Cron 273 | RUN mkdir -p /etc/cron.d 274 | 275 | CMD ["/start-web.sh"] -------------------------------------------------------------------------------- /Dockerfile-7.3: -------------------------------------------------------------------------------- 1 | FROM alpine:3.9 2 | 3 | RUN apk add --no-cache bash supervisor curl 4 | 5 | RUN apk --no-cache add ca-certificates openssl && \ 6 | echo "@php https://dl.bintray.com/php-alpine/v3.9/php-7.3" >> /etc/apk/repositories 7 | 8 | # Install nginx 9 | 10 | ENV NGINX_VERSION 1.17.0 11 | 12 | # Add PHP public keys 13 | ADD https://dl.bintray.com/php-alpine/key/php-alpine.rsa.pub /etc/apk/keys/php-alpine.rsa.pub 14 | 15 | RUN GPG_KEYS=B0F4253373F8F6F510D42178520A9993A1C052F8 \ 16 | && CONFIG="\ 17 | --prefix=/etc/nginx \ 18 | --sbin-path=/usr/sbin/nginx \ 19 | --modules-path=/usr/lib/nginx/modules \ 20 | --conf-path=/etc/nginx/nginx.conf \ 21 | --error-log-path=/var/log/nginx/error.log \ 22 | --http-log-path=/var/log/nginx/access.log \ 23 | --pid-path=/var/run/nginx.pid \ 24 | --lock-path=/var/run/nginx.lock \ 25 | --http-client-body-temp-path=/var/cache/nginx/client_temp \ 26 | --http-proxy-temp-path=/var/cache/nginx/proxy_temp \ 27 | --http-fastcgi-temp-path=/var/cache/nginx/fastcgi_temp \ 28 | --http-uwsgi-temp-path=/var/cache/nginx/uwsgi_temp \ 29 | --http-scgi-temp-path=/var/cache/nginx/scgi_temp \ 30 | --user=nginx \ 31 | --group=nginx \ 32 | --with-http_ssl_module \ 33 | --with-http_realip_module \ 34 | --with-http_addition_module \ 35 | --with-http_sub_module \ 36 | --with-http_dav_module \ 37 | --with-http_flv_module \ 38 | --with-http_mp4_module \ 39 | --with-http_gunzip_module \ 40 | --with-http_gzip_static_module \ 41 | --with-http_random_index_module \ 42 | --with-http_secure_link_module \ 43 | --with-http_stub_status_module \ 44 | --with-http_auth_request_module \ 45 | --with-http_xslt_module=dynamic \ 46 | --with-http_image_filter_module=dynamic \ 47 | --with-http_geoip_module=dynamic \ 48 | --with-threads \ 49 | --with-stream \ 50 | --with-stream_ssl_module \ 51 | --with-stream_ssl_preread_module \ 52 | --with-stream_realip_module \ 53 | --with-stream_geoip_module=dynamic \ 54 | --with-http_slice_module \ 55 | --with-mail \ 56 | --with-mail_ssl_module \ 57 | --with-compat \ 58 | --with-file-aio \ 59 | --with-http_v2_module \ 60 | --add-module=/usr/src/ngx_http_redis-0.3.9 \ 61 | --add-module=/usr/src/ngx_devel_kit-0.3.0 \ 62 | --add-module=/usr/src/set-misc-nginx-module-0.32 \ 63 | --add-module=/usr/src/ngx_http_substitutions_filter_module-0.6.4 \ 64 | " \ 65 | && addgroup -S nginx \ 66 | && adduser -D -S -h /var/cache/nginx -s /sbin/nologin -G nginx nginx \ 67 | && apk add --no-cache --virtual .build-deps \ 68 | gcc \ 69 | libc-dev \ 70 | make \ 71 | openssl-dev \ 72 | pcre-dev \ 73 | zlib-dev \ 74 | linux-headers \ 75 | curl \ 76 | gnupg1 \ 77 | libxslt-dev \ 78 | gd-dev \ 79 | geoip-dev \ 80 | && curl -fSL https://nginx.org/download/nginx-$NGINX_VERSION.tar.gz -o nginx.tar.gz \ 81 | && curl -fSL https://nginx.org/download/nginx-$NGINX_VERSION.tar.gz.asc -o nginx.tar.gz.asc \ 82 | && curl -fSL https://people.freebsd.org/~osa/ngx_http_redis-0.3.9.tar.gz -o http-redis.tar.gz \ 83 | && curl -fSL https://github.com/openresty/set-misc-nginx-module/archive/v0.32.tar.gz -o set-misc.tar.gz \ 84 | && curl -fSL https://github.com/simplresty/ngx_devel_kit/archive/v0.3.0.tar.gz -o ngx_devel_kit.tar.gz \ 85 | && curl -fSL https://github.com/yaoweibin/ngx_http_substitutions_filter_module/archive/v0.6.4.tar.gz -o ngx_http_substitutions_filter_module.tar.gz \ 86 | && export GNUPGHOME="$(mktemp -d)" \ 87 | && found=''; \ 88 | for server in \ 89 | ha.pool.sks-keyservers.net \ 90 | hkp://keyserver.ubuntu.com:80 \ 91 | hkp://p80.pool.sks-keyservers.net:80 \ 92 | pgp.mit.edu \ 93 | ; do \ 94 | echo "Fetching GPG key $GPG_KEYS from $server"; \ 95 | gpg --keyserver "$server" --keyserver-options timeout=10 --recv-keys "$GPG_KEYS" && found=yes && break; \ 96 | done; \ 97 | test -z "$found" && echo >&2 "error: failed to fetch GPG key $GPG_KEYS" && exit 1; \ 98 | gpg --batch --verify nginx.tar.gz.asc nginx.tar.gz \ 99 | && rm -rf "$GNUPGHOME" nginx.tar.gz.asc \ 100 | && mkdir -p /usr/src \ 101 | && tar -zxC /usr/src -f nginx.tar.gz \ 102 | && rm nginx.tar.gz \ 103 | && tar -zxC /usr/src -f http-redis.tar.gz \ 104 | && rm http-redis.tar.gz \ 105 | && tar -zxC /usr/src -f set-misc.tar.gz \ 106 | && rm set-misc.tar.gz \ 107 | && tar -zxC /usr/src -f ngx_http_substitutions_filter_module.tar.gz \ 108 | && rm ngx_http_substitutions_filter_module.tar.gz \ 109 | && tar -zxC /usr/src -f ngx_devel_kit.tar.gz \ 110 | && rm ngx_devel_kit.tar.gz \ 111 | && cd /usr/src/nginx-$NGINX_VERSION \ 112 | && ./configure $CONFIG --with-debug \ 113 | && make -j$(getconf _NPROCESSORS_ONLN) \ 114 | && mv objs/nginx objs/nginx-debug \ 115 | && mv objs/ngx_http_xslt_filter_module.so objs/ngx_http_xslt_filter_module-debug.so \ 116 | && mv objs/ngx_http_image_filter_module.so objs/ngx_http_image_filter_module-debug.so \ 117 | && mv objs/ngx_http_geoip_module.so objs/ngx_http_geoip_module-debug.so \ 118 | && mv objs/ngx_stream_geoip_module.so objs/ngx_stream_geoip_module-debug.so \ 119 | && ./configure $CONFIG \ 120 | && make -j$(getconf _NPROCESSORS_ONLN) \ 121 | && make install \ 122 | && rm -rf /etc/nginx/html/ \ 123 | && mkdir /etc/nginx/conf.d/ \ 124 | && mkdir -p /usr/share/nginx/html/ \ 125 | && install -m644 html/index.html /usr/share/nginx/html/ \ 126 | && install -m644 html/50x.html /usr/share/nginx/html/ \ 127 | && install -m755 objs/nginx-debug /usr/sbin/nginx-debug \ 128 | && install -m755 objs/ngx_http_xslt_filter_module-debug.so /usr/lib/nginx/modules/ngx_http_xslt_filter_module-debug.so \ 129 | && install -m755 objs/ngx_http_image_filter_module-debug.so /usr/lib/nginx/modules/ngx_http_image_filter_module-debug.so \ 130 | && install -m755 objs/ngx_http_geoip_module-debug.so /usr/lib/nginx/modules/ngx_http_geoip_module-debug.so \ 131 | && install -m755 objs/ngx_stream_geoip_module-debug.so /usr/lib/nginx/modules/ngx_stream_geoip_module-debug.so \ 132 | && ln -s ../../usr/lib/nginx/modules /etc/nginx/modules \ 133 | && strip /usr/sbin/nginx* \ 134 | && strip /usr/lib/nginx/modules/*.so \ 135 | && rm -rf /usr/src/nginx-$NGINX_VERSION \ 136 | \ 137 | # Bring in gettext so we can get `envsubst`, then throw 138 | # the rest away. To do this, we need to install `gettext` 139 | # then move `envsubst` out of the way so `gettext` can 140 | # be deleted completely, then move `envsubst` back. 141 | && apk add --no-cache --virtual .gettext gettext \ 142 | && mv /usr/bin/envsubst /tmp/ \ 143 | \ 144 | && runDeps="$( \ 145 | scanelf --needed --nobanner --format '%n#p' /usr/sbin/nginx /usr/lib/nginx/modules/*.so /tmp/envsubst \ 146 | | tr ',' '\n' \ 147 | | sort -u \ 148 | | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \ 149 | )" \ 150 | && apk add --no-cache --virtual .nginx-rundeps $runDeps \ 151 | && apk del .build-deps \ 152 | && apk del .gettext \ 153 | && mv /tmp/envsubst /usr/local/bin/ \ 154 | \ 155 | # Bring in tzdata so users could set the timezones through the environment 156 | # variables 157 | && apk add --no-cache tzdata \ 158 | \ 159 | # forward request and error logs to docker log collector 160 | && ln -sf /dev/stdout /var/log/nginx/access.log \ 161 | && ln -sf /dev/stderr /var/log/nginx/error.log 162 | 163 | # Nginx temp upload dir 164 | RUN mkdir -p /var/nginx-uploads && chown nobody:nobody /var/nginx-uploads 165 | 166 | RUN mkdir -p /var/cache/nginx/client_temp && \ 167 | mkdir -p /var/cache/nginx/proxy_temp && \ 168 | mkdir -p /var/cache/nginx/fastcgi_temp && \ 169 | mkdir -p /var/cache/nginx/uwsgi_temp && \ 170 | mkdir -p /var/cache/nginx/scgi_temp 171 | 172 | RUN chown -R nobody:nobody /var/cache/nginx/client_temp && \ 173 | chown -R nobody:nobody /var/cache/nginx/proxy_temp && \ 174 | chown -R nobody:nobody /var/cache/nginx/fastcgi_temp && \ 175 | chown -R nobody:nobody /var/cache/nginx/uwsgi_temp && \ 176 | chown -R nobody:nobody /var/cache/nginx/scgi_temp 177 | 178 | COPY scripts/supervisor-healthcheck.sh /supervisor-healthcheck.sh 179 | COPY scripts/healthcheck.py /healthcheck.py 180 | RUN chmod +x /supervisor-healthcheck.sh 181 | 182 | RUN apk add --no-cache \ 183 | php7@php \ 184 | php7-common@php \ 185 | php7-memcached@php \ 186 | php7-curl@php \ 187 | php7-dom@php \ 188 | php7-exif@php \ 189 | php7-ftp@php \ 190 | php7-gd@php \ 191 | php7-iconv@php \ 192 | php7-mbstring@php \ 193 | php7-mysqli@php \ 194 | php7-mysqlnd@php \ 195 | php7-openssl@php \ 196 | php7-pdo@php \ 197 | php7-session@php \ 198 | php7-posix@php \ 199 | php7-soap@php \ 200 | php7-zip@php \ 201 | php7-ldap@php \ 202 | php7-bcmath@php \ 203 | php7-calendar@php \ 204 | php7-gettext@php \ 205 | php7-json@php \ 206 | php7-pcntl@php \ 207 | php7-apcu@php \ 208 | php7-phar@php \ 209 | php7-sockets@php \ 210 | php7-tidy@php \ 211 | php7-wddx@php \ 212 | php7-xmlreader@php \ 213 | php7-zip@php \ 214 | php7-zlib@php \ 215 | php7-xsl@php \ 216 | php7-opcache@php \ 217 | php7-imagick@php \ 218 | php7-ctype@php \ 219 | php7-pdo_mysql@php \ 220 | php7-pdo_sqlite@php \ 221 | php7-sqlite3@php \ 222 | php7-redis@php \ 223 | php7-intl@php \ 224 | php7-fpm@php 225 | 226 | # Imagick support file types 227 | RUN apk add --no-cache imagemagick 228 | 229 | RUN mkdir -p /src && \ 230 | ln -s /etc/php7 /etc/php && \ 231 | ln -s /usr/bin/php7 /usr/bin/php && \ 232 | ln -s /usr/sbin/php-fpm7 /usr/bin/php-fpm 233 | 234 | # Add Composer 235 | RUN curl https://getcomposer.org/installer -o /tmp/composer-installer && php /tmp/composer-installer --install-dir=/usr/local/bin --filename=composer && rm -f /tmp/composer-installer 236 | 237 | # Atatus 238 | RUN wget https://s3.amazonaws.com/atatus-artifacts/atatus-php/downloads/atatus-php-1.7.0-x64-musl.tar.gz && tar -xzvf atatus-php-1.7.0-x64-musl.tar.gz && cd atatus-php-1.7.0-x64-musl && ./install.sh 239 | 240 | # Atatus configurations 241 | RUN sed -i -e 's#atatus.trace.response_time = 2000#atatus.trace.response_time = 1500#g' /etc/php/conf.d/atatus.ini && \ 242 | sed -i -e 's#atatus.collector.pidfile = "/var/run/atatus-php-collector.pid"#atatus.collector.pidfile = "/run/atatus-php-collector.pid"#g' /etc/php/conf.d/atatus.ini && \ 243 | sed -i -e 's#atatus.collector.connection = "/tmp/.atatus.sock"#atatus.collector.connection = "/run/atatus.sock"#g' /etc/php/conf.d/atatus.ini 244 | 245 | # Supervisor 246 | ADD conf/supervisord.conf /etc/supervisord.conf 247 | ADD conf/supervisor.d /etc/supervisor.d 248 | RUN mkdir -p /etc/supervisord-enabled && mkdir -p /etc/supervisord-worker 249 | 250 | # Scripts 251 | ADD scripts/start-web.sh /start-web.sh 252 | RUN chmod 755 /start-web.sh 253 | ADD scripts/start-worker.sh /start-worker.sh 254 | RUN chmod 755 /start-worker.sh 255 | 256 | ADD conf/nginx.conf /etc/nginx/nginx.conf 257 | 258 | ADD conf/nginx-site.conf /etc/nginx/sites-enabled/site.conf 259 | ADD dependencies/nginx-custom.php /usr/local/bin/nginx-custom 260 | 261 | # Test Nginx 262 | RUN nginx -c /etc/nginx/nginx.conf -t 263 | 264 | ## PHP 265 | ADD conf/php-fpm.conf /etc/php/php-fpm.conf 266 | ADD conf/php.ini /etc/php/php.ini 267 | ADD conf/php-www.conf /etc/php/php-fpm.d/www.conf 268 | 269 | # Test PHP-FPM 270 | RUN /usr/bin/php-fpm --fpm-config /etc/php/php-fpm.conf -t 271 | 272 | # Cron 273 | RUN mkdir -p /etc/cron.d 274 | 275 | CMD ["/start-web.sh"] -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # prlx-nginx-php-fpm 2 | 3 | > A relatively clean but full-featured, usable nginx and php-fpm docker image supporting PHP versions 5.6, 7.1, 7.2 maintained by [Parallax](https://parall.ax/) 4 | 5 | ## Docker Tags 6 | 7 | | PHP | Nginx | Docker tag | 8 | | ------------- | ------------- | ------------- | 9 | | 5.6 | 1.17.0 | prlx/prlx-nginx-php-fpm:5.6-master | 10 | | 7.1 | 1.17.0 | prlx/prlx-nginx-php-fpm:7.1-master | 11 | | 7.2 | 1.17.0 | prlx/prlx-nginx-php-fpm:7.2-master | 12 | | 7.3 | 1.17.0 | prlx/prlx-nginx-php-fpm:7.3-master | 13 | 14 | [Browse all tags on Docker Hub](https://hub.docker.com/r/prlx/prlx-nginx-php-fpm/tags/) 15 | 16 | # Environment Variables 17 | 18 | These containers work with certain environment variables to control their operation. Environment variables marked as required may be omitted and things may seem to work OK but we do not test against omitting these so you may see some pretty interesting behaviour as a result. 19 | 20 | Web/Worker just means whether these have any effect - nothing bad will happen if they are set on both. 21 | 22 | For help running these locally with docker run see the [docker run reference](https://docs.docker.com/engine/reference/run/#env-environment-variables) 23 | 24 | | Key | Description | Required | Web | Worker | 25 | | --- | --- | --- | --- | --- | 26 | | SITE_NAME | The name of your project, i.e. 'mywebsite'. Used by NR for app name. | ✓ | ✓ | ✓ | 27 | | SITE_BRANCH | The running branch of your project, i.e. 'master'. Used by NR for app name. | ✓ | ✓ | ✓ | 28 | | ENVIRONMENT | The environment you're running in, i.e. 'qa' or 'production'. Used by NR for app name. | ✓ | ✓ | ✓ | 29 | | ATATUS_APM_LICENSE_KEY | Your Atatus license key. Atatus won't be used if this is not set. | ✖ | ✓ | ✓ | 30 | | ATATUS_APM_RAW_SQL | Set to any value (1, true, etc) to use raw sql logging into Atatus | ✖ | ✓ | ✓ | 31 | | ATATUS_APM_LARAVEL_QUEUES | Set to any value (1, true, etc) to use laravel queue transactions in Atatus | ✖ | ✓ | ✓ | 32 | | NGINX_PORT | Defaults to 80 | ✖ | ✓ | ✖ | 33 | | NGINX_WEB_ROOT | Defaults to /src/public, use absolute paths if you wish to change this behaviour. Doesn't support '#' in paths! | ✖ | ✓ | ✖ | 34 | | PHP_MEMORY_MAX | Maximum PHP request memory, in megabytes (i.e. '256'). Defaults to 128. | ✖ | ✓ | ✓ | 35 | | MAX_EXECUTION_TIME | Maximum PHP and Nginx execution/fastcgi read timeout | ✖ | ✓ | ✓ | 36 | | PHP_FPM_WORKERS | Maximum PHP-FPM workers. Defaults to 4 if not set. | ✖ | ✓ | ✖ | 37 | | DISABLE_OPCACHE | Set to any value (1, true, etc) to disable PHP Opcache | ✖ | ✓ | ✓ | 38 | | PHP_OPCACHE_MEMORY | Maximum PHP request memory, in megabytes (i.e. '64'). Defaults to 16. | ✖ | ✓ | ✓ | 39 | | DISABLE_CRON | Set to any value (1, true, etc) to disable Cron. Only runs on the worker! | ✖ | ✖ | ✓ | 40 | | PHP_SESSION_STORE | If not set, PHP uses /tmp for sessions. If set to 'redis', uses redis for sessions | ✖ | ✓ | ✓ | 41 | | PHP_SESSION_STORE_REDIS_HOST | If not set, defaults to 'redis'. Only used if PHP_SESSION_STORE is set to redis | ✖ | ✓ | ✓ | 42 | | PHP_SESSION_STORE_REDIS_PORT | If not set, defaults to 6379. Only used if PHP_SESSION_STORE is set to redis | ✖ | ✓ | ✓ | 43 | | PHP_DISABLE_CACHE_HEADERS | Set to any value (1, true, etc) to disable PHP's default pragma: no-cache headers | ✖ | ✓ | ✖ | 44 | | PHP_ENABLE_SHORT_TAGS | Set to any value (1, true, etc) to enable PHP short tagging | ✖ | ✓ | ✓ | 45 | 46 | # The web mode/command 47 | 48 | The web mode is what you use to run a web server - unless you're using workers this is the only one you'll be using. It runs all the things you need to be able to run a PHP-FPM container in Kubernetes. 49 | 50 | It is also the default behaviour for the docker containers meaning you don't need to specify a command or working directory to run. 51 | 52 | ## Ports and Services 53 | 54 | Not everything is as straightforward as the idealistic world of Docker would have you believe. The "one process per container" doesn't really work for us in the real world so we've gone with "one logical service per container" instead. 55 | 56 | We use [Supervisord](http://supervisord.org/) to bootstrap the following services in our Nginx PHP-FPM web mode container: 57 | 58 | | Service | Description | Port/Socket | 59 | | ------------- | ------------- | ------------- | 60 | | [Nginx](https://www.nginx.com/) | Web server | 0.0.0.0:80 | 61 | | [PHP-FPM](https://php-fpm.org/) | PHP running as a pool of workers | /run/php.sock | 62 | 63 | ## Example Container 64 | 65 | There is an example container in [examples/hello-world](examples/hello-world). To run it: 66 | 67 | ```bash 68 | cd examples/hello-world 69 | docker build -t example . 70 | docker run -p 8080:80 example 71 | ``` 72 | 73 | You should be able to visit the container on http://127.0.0.1:8080/ and see the contents of index.php from /examples/hello-world/src. 74 | 75 | # Custom Startup Scripts 76 | 77 | You can add behaviour to the built-in startup scripts for web, worker or both modes by adding a file to: 78 | 79 | | File Path | Runs on | 80 | | --- | --- | 81 | | /startup-all.sh | All | 82 | | /startup-web.sh | Web | 83 | | /startup-worker.sh | Worker | 84 | 85 | # The worker mode/command 86 | 87 | The worker mode is used when you want to run a worker-type task in this container. Usually this means something like php artisan queue:work. 88 | 89 | To run in this mode, change the Docker CMD to be /start-worker.sh instead of the default /start-web.sh. 90 | 91 | You will need to ship your own worker supervisord jobs by adding these to /etc/supervisord-worker/ in your Dockerfile for your worker. Any .conf files in that directory will be picked up by supervisord to run when in worker mode. 92 | 93 | An example of one of these files is provided below - feel free to amend as appropriate: 94 | 95 | ``` 96 | [program:laravel-queue] 97 | command=/usr/bin/php artisan queue:listen 98 | directory=/src 99 | autostart=true 100 | autorestart=true 101 | priority=15 102 | stdout_events_enabled=true 103 | stderr_events_enabled=true 104 | stdout_logfile=/dev/stdout 105 | stdout_logfile_maxbytes=0 106 | stderr_logfile=/dev/stderr 107 | stderr_logfile_maxbytes=0 108 | ``` 109 | 110 | ## Cron Jobs on Worker 111 | 112 | The worker has support for cron (can be disabled using DISABLE_CRON). To add a crontab, call it the name of the user you want it to run as (probably 'nobody') and ADD it to /etc/cron.d. 113 | 114 | Example: 115 | 116 | ``` 117 | * * * * * date 118 | ``` 119 | 120 | # PHP Modules 121 | | Module | 5.6 | 7.1 | 7.2 | 7.3 |Notes | 122 | | --- | --- | --- | --- | --- |--- | 123 | | apc | ✓ | ✖ | ✖ | ✖ | Deprecated in PHP 7 and up | 124 | | apcu | ✓ | ✓ | ✓ | ✓ | | 125 | | bcmath | ✓ | ✓ | ✓ | ✓ | | 126 | | calendar | ✓ | ✓ | ✓ | ✓ | | 127 | | Core | ✓ | ✓ | ✓ | ✓ | | 128 | | ctype | ✓ | ✓ | ✓ | ✓ | | 129 | | curl | ✓ | ✓ | ✓ | ✓ | | 130 | | date | ✓ | ✓ | ✓ | ✓ | | 131 | | dom | ✓ | ✓ | ✓ | ✓ | | 132 | | ereg | ✓ | ✖ | ✖ | ✖ | Deprecated in PHP 7 and up | 133 | | exif | ✓ | ✓ | ✓ | ✓ | | 134 | | fileinfo | ✓ | ✓ | ✓ | ✓ | | 135 | | filter | ✓ | ✓ | ✓ | ✓ | | 136 | | ftp | ✓ | ✓ | ✓ | ✓ | | 137 | | gd | ✓ | ✓ | ✓ | ✓ | | 138 | | gettext | ✓ | ✓ | ✓ | ✓ | | 139 | | hash | ✓ | ✓ | ✓ | ✓ | | 140 | | iconv | ✓ | ✓ | ✓ | ✓ | | 141 | | imagick | ✓ | ✓ | ✓ | ✓ | | 142 | | intl | ✓ | ✓ | ✓ | ✓ | | 143 | | json | ✓ | ✓ | ✓ | ✓ | | 144 | | ldap | ✓ | ✓ | ✓ | ✓ | | 145 | | libxml | ✓ | ✓ | ✓ | ✓ | | 146 | | mbstring | ✓ | ✓ | ✓ | ✓ | | 147 | | mcrypt | ✓ | ✓ | ✖ | ✖ | Deprecated in PHP 7.2 and up | 148 | | memcached | ✓ | ✓ | ✓ | ✓ | | 149 | | mysqli | ✓ | ✓ | ✓ | ✓ | | 150 | | mysql | ✓ | ✖ | ✖ | ✖ | Deprecated in PHP 7 and up | 151 | | mysqlnd | ✓ | ✓ | ✓ | ✓ | | 152 | | openssl | ✓ | ✓ | ✓ | ✓ | | 153 | | pcntl | ✓ | ✓ | ✓ | ✓ | | 154 | | pcre | ✓ | ✓ | ✓ | ✓ | | 155 | | PDO | ✓ | ✓ | ✓ | ✓ | | 156 | | pdo_mysql | ✓ | ✓ | ✓ | ✓ | | 157 | | pdo_sqlite | ✓ | ✓ | ✓ | ✓ | | 158 | | Phar | ✓ | ✓ | ✓ | ✓ | | 159 | | posix | ✓ | ✓ | ✓ | ✓ | | 160 | | readline | ✓ | ✓ | ✓ | ✓ | | 161 | | redis | ✓ | ✓ | ✓ | ✓ | | 162 | | Reflection | ✓ | ✓ | ✓ | ✓ | | 163 | | session | ✓ | ✓ | ✓ | ✓ | | 164 | | SimpleXML | ✓ | ✓ | ✓ | ✓ | | 165 | | soap | ✓ | ✓ | ✓ | ✓ | | 166 | | sockets | ✓ | ✓ | ✓ | ✓ | | 167 | | SPL | ✓ | ✓ | ✓ | ✓ | | 168 | | sqlite3 | ✓ | ✓ | ✓ | ✓ | | 169 | | standard | ✓ | ✓ | ✓ | ✓ | | 170 | | tidy | ✖ | ✓ | ✓ | ✓ |Weirdly missing from upstream Alpine Linux repository | 171 | | tokenizer | ✓ | ✓ | ✓ | ✓ | | 172 | | wddx | ✓ | ✓ | ✓ | ✓ | | 173 | | xml | ✓ | ✓ | ✓ | ✓ | | 174 | | xmlreader | ✓ | ✓ | ✓ | ✓ | | 175 | | xmlrpc | ✓ | ✓ | ✖ | ✖ |[Missing from upstream PHP 7.2](https://github.com/codecasts/php-alpine/issues/23) | 176 | | xmlwriter | ✓ | ✓ | ✓ | ✓ | | 177 | | xsl | ✓ | ✓ | ✓ | ✓ | | 178 | | Zend OPcache | ✓ | ✓ | ✓ | ✓ | | 179 | | zip | ✓ | ✓ | ✓ | ✓ | | 180 | | zlib | ✓ | ✓ | ✓ | ✓ | | -------------------------------------------------------------------------------- /conf/nginx-site.conf: -------------------------------------------------------------------------------- 1 | ## 2 | # You should look at the following URL's in order to grasp a solid understanding 3 | # of Nginx configuration files in order to fully unleash the power of Nginx. 4 | # http://wiki.nginx.org/Pitfalls 5 | # http://wiki.nginx.org/QuickStart 6 | # http://wiki.nginx.org/Configuration 7 | # 8 | # Generally, you will want to move this file somewhere, and start with a clean 9 | # file but keep this around for reference. Or just disable in sites-enabled. 10 | # 11 | # Please see /usr/share/doc/nginx-doc/examples/ for more detailed examples. 12 | ## 13 | 14 | # Default server configuration 15 | # 16 | 17 | server { 18 | listen 80 default_server; 19 | 20 | root /src/public; 21 | 22 | add_header Pod $hostname; 23 | 24 | # Add index.php to the list if you are using PHP 25 | index index.php index.html index.htm; 26 | 27 | server_name _; 28 | 29 | location / { 30 | try_files $uri $uri/ /index.php?$query_string; 31 | } 32 | 33 | location ~ \.php$ { 34 | try_files $uri =404; 35 | include fastcgi_params; 36 | fastcgi_split_path_info ^(.+\.php)(/.+)$; 37 | fastcgi_pass unix:/run/php.sock; 38 | fastcgi_param SERVER_NAME $http_host; 39 | fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; 40 | fastcgi_param SCRIPT_NAME $fastcgi_script_name; 41 | fastcgi_index index.php; 42 | fastcgi_read_timeout 600s; 43 | fastcgi_request_buffering off; 44 | fastcgi_param PHP_VALUE "atatus.enabled=on;"; 45 | } 46 | 47 | # Healthz endpoint, courtesy of PHP-FPM ping pong 48 | location ~ ^/(healthz)$ { 49 | include fastcgi_params; 50 | fastcgi_index index.php; 51 | fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; 52 | fastcgi_pass unix:/run/php.sock; 53 | access_log off; 54 | fastcgi_param PHP_VALUE "atatus.enabled=off;"; 55 | } 56 | 57 | ### Custom snippets go below if defined ### 58 | ####CUSTOM#### 59 | } -------------------------------------------------------------------------------- /conf/nginx.conf: -------------------------------------------------------------------------------- 1 | user nobody nobody; 2 | pid /run/nginx.pid; 3 | daemon off; 4 | 5 | worker_rlimit_nofile 4096; 6 | 7 | error_log /dev/stderr info; 8 | 9 | # Set number of worker processes automatically based on number of CPU cores. 10 | worker_processes auto; 11 | 12 | # Enables the use of JIT for regular expressions to speed-up their processing. 13 | pcre_jit on; 14 | 15 | # Includes files with directives to load dynamic modules. 16 | include /etc/nginx/modules/*.conf; 17 | 18 | 19 | events { 20 | worker_connections 4096; 21 | multi_accept off; 22 | accept_mutex off; 23 | } 24 | 25 | http { 26 | 27 | aio threads; 28 | 29 | # Fix broken uploads 30 | client_body_temp_path /var/nginx-uploads 1; 31 | client_body_buffer_size 16k; 32 | client_body_in_file_only off; 33 | client_body_in_single_buffer off; 34 | 35 | # Includes mapping of file name extensions to MIME types of responses 36 | # and defines the default type. 37 | include /etc/nginx/mime.types; 38 | default_type application/octet-stream; 39 | 40 | # Don't tell nginx version to clients. 41 | server_tokens off; 42 | 43 | # Specifies the maximum accepted body size of a client request, as 44 | # indicated by the request header Content-Length. If the stated content 45 | # length is greater than this size, then the client receives the HTTP 46 | # error code 413. Set to 0 to disable. 47 | client_max_body_size 1024m; 48 | 49 | # Timeout for keep-alive connections. Server will close connections after 50 | # this time. 51 | keepalive_timeout 120; 52 | keepalive_requests 20000; 53 | 54 | 55 | # Large cookies/header 56 | client_header_buffer_size 8k; 57 | large_client_header_buffers 8 128k; 58 | 59 | # Sendfile copies data between one FD and other from within the kernel, 60 | # which is more efficient than read() + write(). 61 | sendfile off; 62 | 63 | # Don't buffer data-sends (disable Nagle algorithm). 64 | # Good for sending frequent small bursts of data in real time. 65 | tcp_nodelay on; 66 | 67 | # Causes nginx to attempt to send its HTTP response head in one packet, 68 | # instead of using partial frames. 69 | tcp_nopush on; 70 | 71 | gzip on; 72 | gzip_vary on; 73 | gzip_proxied any; 74 | gzip_comp_level 6; 75 | gzip_types text/plain text/css text/xml application/json application/javascript application/xml+rss application/atom+xml image/svg+xml; 76 | 77 | # Enable checking the existence of precompressed files. 78 | gzip_static off; 79 | 80 | log_format kubernetes $time_local ' Nginx: From: ' $http_x_forwarded_for ' Request: ' $request_method ' ' $http_x_forwarded_proto '://' $host $request_uri ' Response: HTTP Code: ' $status ' Bytes Sent: ' $bytes_sent ' Time: ' $request_time; 81 | 82 | # Sets the path, format, and configuration for a buffered log write. 83 | access_log /dev/stdout kubernetes; 84 | 85 | # Includes virtual hosts configs. 86 | include /etc/nginx/sites-enabled/*; 87 | 88 | } -------------------------------------------------------------------------------- /conf/php-fpm.conf: -------------------------------------------------------------------------------- 1 | ;;;;;;;;;;;;;;;;;;;;; 2 | ; FPM Configuration ; 3 | ;;;;;;;;;;;;;;;;;;;;; 4 | 5 | ; All relative paths in this configuration file are relative to PHP's install 6 | ; prefix (/usr). This prefix can be dynamically changed by using the 7 | ; '-p' argument from the command line. 8 | 9 | ;;;;;;;;;;;;;;;;;; 10 | ; Global Options ; 11 | ;;;;;;;;;;;;;;;;;; 12 | 13 | [global] 14 | ; Pid file 15 | ; Note: the default prefix is /var 16 | ; Default Value: none 17 | pid = run/php-fpm.pid 18 | 19 | ; Error log file 20 | ; If it's set to "syslog", log is sent to syslogd instead of being written 21 | ; into a local file. 22 | ; Note: the default prefix is /var 23 | ; Default Value: log/php-fpm.log 24 | error_log = /proc/self/fd/2 25 | 26 | ; syslog_facility is used to specify what type of program is logging the 27 | ; message. This lets syslogd specify that messages from different facilities 28 | ; will be handled differently. 29 | ; See syslog(3) for possible values (ex daemon equiv LOG_DAEMON) 30 | ; Default Value: daemon 31 | ;syslog.facility = daemon 32 | 33 | ; syslog_ident is prepended to every message. If you have multiple FPM 34 | ; instances running on the same server, you can change the default value 35 | ; which must suit common needs. 36 | ; Default Value: php-fpm 37 | ;syslog.ident = php-fpm 38 | 39 | ; Log level 40 | ; Possible Values: alert, error, warning, notice, debug 41 | ; Default Value: notice 42 | log_level = notice 43 | 44 | ; If this number of child processes exit with SIGSEGV or SIGBUS within the time 45 | ; interval set by emergency_restart_interval then FPM will restart. A value 46 | ; of '0' means 'Off'. 47 | ; Default Value: 0 48 | ;emergency_restart_threshold = 0 49 | 50 | ; Interval of time used by emergency_restart_interval to determine when 51 | ; a graceful restart will be initiated. This can be useful to work around 52 | ; accidental corruptions in an accelerator's shared memory. 53 | ; Available Units: s(econds), m(inutes), h(ours), or d(ays) 54 | ; Default Unit: seconds 55 | ; Default Value: 0 56 | ;emergency_restart_interval = 0 57 | 58 | ; Time limit for child processes to wait for a reaction on signals from master. 59 | ; Available units: s(econds), m(inutes), h(ours), or d(ays) 60 | ; Default Unit: seconds 61 | ; Default Value: 0 62 | ;process_control_timeout = 0 63 | 64 | ; The maximum number of processes FPM will fork. This has been designed to control 65 | ; the global number of processes when using dynamic PM within a lot of pools. 66 | ; Use it with caution. 67 | ; Note: A value of 0 indicates no limit 68 | ; Default Value: 0 69 | ; process.max = 128 70 | 71 | ; Specify the nice(2) priority to apply to the master process (only if set) 72 | ; The value can vary from -19 (highest priority) to 20 (lowest priority) 73 | ; Note: - It will only work if the FPM master process is launched as root 74 | ; - The pool process will inherit the master process priority 75 | ; unless specified otherwise 76 | ; Default Value: no set 77 | ; process.priority = -19 78 | 79 | ; Send FPM to background. Set to 'no' to keep FPM in foreground for debugging. 80 | ; Default Value: yes 81 | daemonize = no 82 | 83 | ; Set open file descriptor rlimit for the master process. 84 | ; Default Value: system defined value 85 | ;rlimit_files = 99999 86 | 87 | ; Set max core size rlimit for the master process. 88 | ; Possible Values: 'unlimited' or an integer greater or equal to 0 89 | ; Default Value: system defined value 90 | ;rlimit_core = 0 91 | 92 | ; Specify the event mechanism FPM will use. The following is available: 93 | ; - select (any POSIX os) 94 | ; - poll (any POSIX os) 95 | ; - epoll (linux >= 2.5.44) 96 | ; - kqueue (FreeBSD >= 4.1, OpenBSD >= 2.9, NetBSD >= 2.0) 97 | ; - /dev/poll (Solaris >= 7) 98 | ; - port (Solaris >= 10) 99 | ; Default Value: not set (auto detection) 100 | events.mechanism = epoll 101 | 102 | ; When FPM is built with systemd integration, specify the interval, 103 | ; in seconds, between health report notification to systemd. 104 | ; Set to 0 to disable. 105 | ; Available Units: s(econds), m(inutes), h(ours) 106 | ; Default Unit: seconds 107 | ; Default value: 10 108 | ;systemd_interval = 10 109 | 110 | ;;;;;;;;;;;;;;;;;;;; 111 | ; Pool Definitions ; 112 | ;;;;;;;;;;;;;;;;;;;; 113 | 114 | ; Multiple pools of child processes may be started with different listening 115 | ; ports and different management options. The name of the pool will be 116 | ; used in logs and stats. There is no limitation on the number of pools which 117 | ; FPM can handle. Your system will tell you anyway :) 118 | 119 | ; Include one or more files. If glob(3) exists, it is used to include a bunch of 120 | ; files from a glob(3) pattern. This directive can be used everywhere in the 121 | ; file. 122 | ; Relative path can also be used. They will be prefixed by: 123 | ; - the global prefix if it's been set (-p argument) 124 | ; - /usr otherwise 125 | include=/etc/php/php-fpm.d/*.conf -------------------------------------------------------------------------------- /conf/php-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 /usr) 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 = nobody 24 | group = nobody 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 = /run/php.sock 37 | 38 | ; Set listen(2) backlog. 39 | ; Default Value: 511 (-1 on FreeBSD and OpenBSD) 40 | listen.backlog = 65535 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 = nobody 48 | listen.group = nobody 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 = -2 71 | 72 | ; Choose how the process manager will control the number of child processes. 73 | ; Possible Values: 74 | ; static - a fixed number (pm.max_children) of child processes; 75 | ; dynamic - the number of child processes are set dynamically based on the 76 | ; following directives. With this process management, there will be 77 | ; always at least 1 children. 78 | ; pm.max_children - the maximum number of children that can 79 | ; be alive at the same time. 80 | ; pm.start_servers - the number of children created on startup. 81 | ; pm.min_spare_servers - the minimum number of children in 'idle' 82 | ; state (waiting to process). If the number 83 | ; of 'idle' processes is less than this 84 | ; number then some children will be created. 85 | ; pm.max_spare_servers - the maximum number of children in 'idle' 86 | ; state (waiting to process). If the number 87 | ; of 'idle' processes is greater than this 88 | ; number then some children will be killed. 89 | ; ondemand - no children are created at startup. Children will be forked when 90 | ; new requests will connect. The following parameter are used: 91 | ; pm.max_children - the maximum number of children that 92 | ; can be alive at the same time. 93 | ; pm.process_idle_timeout - The number of seconds after which 94 | ; an idle process will be killed. 95 | ; Note: This value is mandatory. 96 | pm = ondemand 97 | 98 | ; The number of child processes to be created when pm is set to 'static' and the 99 | ; maximum number of child processes when pm is set to 'dynamic' or 'ondemand'. 100 | ; This value sets the limit on the number of simultaneous requests that will be 101 | ; served. Equivalent to the ApacheMaxClients directive with mpm_prefork. 102 | ; Equivalent to the PHP_FCGI_CHILDREN environment variable in the original PHP 103 | ; CGI. The below defaults are based on a server without much resources. Don't 104 | ; forget to tweak pm.* to fit your needs. 105 | ; Note: Used when pm is set to 'static', 'dynamic' or 'ondemand' 106 | ; Note: This value is mandatory. 107 | pm.max_children = 4 108 | 109 | ; The number of child processes created on startup. 110 | ; Note: Used only when pm is set to 'dynamic' 111 | ; Default Value: min_spare_servers + (max_spare_servers - min_spare_servers) / 2 112 | pm.start_servers = 2 113 | 114 | ; The desired minimum number of idle server processes. 115 | ; Note: Used only when pm is set to 'dynamic' 116 | ; Note: Mandatory when pm is set to 'dynamic' 117 | pm.min_spare_servers = 1 118 | 119 | ; The desired maximum number of idle server processes. 120 | ; Note: Used only when pm is set to 'dynamic' 121 | ; Note: Mandatory when pm is set to 'dynamic' 122 | pm.max_spare_servers = 3 123 | 124 | ; The number of seconds after which an idle process will be killed. 125 | ; Note: Used only when pm is set to 'ondemand' 126 | ; Default Value: 10s 127 | pm.process_idle_timeout = 15s; 128 | 129 | ; The number of requests each child process should execute before respawning. 130 | ; This can be useful to work around memory leaks in 3rd party libraries. For 131 | ; endless request processing specify '0'. Equivalent to PHP_FCGI_MAX_REQUESTS. 132 | ; Default Value: 0 133 | pm.max_requests = 20000 134 | 135 | ; The URI to view the FPM status page. If this value is not set, no URI will be 136 | ; recognized as a status page. It shows the following informations: 137 | ; pool - the name of the pool; 138 | ; process manager - static, dynamic or ondemand; 139 | ; start time - the date and time FPM has started; 140 | ; start since - number of seconds since FPM has started; 141 | ; accepted conn - the number of request accepted by the pool; 142 | ; listen queue - the number of request in the queue of pending 143 | ; connections (see backlog in listen(2)); 144 | ; max listen queue - the maximum number of requests in the queue 145 | ; of pending connections since FPM has started; 146 | ; listen queue len - the size of the socket queue of pending connections; 147 | ; idle processes - the number of idle processes; 148 | ; active processes - the number of active processes; 149 | ; total processes - the number of idle + active processes; 150 | ; max active processes - the maximum number of active processes since FPM 151 | ; has started; 152 | ; max children reached - number of times, the process limit has been reached, 153 | ; when pm tries to start more children (works only for 154 | ; pm 'dynamic' and 'ondemand'); 155 | ; Value are updated in real time. 156 | ; Example output: 157 | ; pool: www 158 | ; process manager: static 159 | ; start time: 01/Jul/2011:17:53:49 +0200 160 | ; start since: 62636 161 | ; accepted conn: 190460 162 | ; listen queue: 0 163 | ; max listen queue: 1 164 | ; listen queue len: 42 165 | ; idle processes: 4 166 | ; active processes: 11 167 | ; total processes: 15 168 | ; max active processes: 12 169 | ; max children reached: 0 170 | ; 171 | ; By default the status page output is formatted as text/plain. Passing either 172 | ; 'html', 'xml' or 'json' in the query string will return the corresponding 173 | ; output syntax. Example: 174 | ; http://www.foo.bar/status 175 | ; http://www.foo.bar/status?json 176 | ; http://www.foo.bar/status?html 177 | ; http://www.foo.bar/status?xml 178 | ; 179 | ; By default the status page only outputs short status. Passing 'full' in the 180 | ; query string will also return status for each pool process. 181 | ; Example: 182 | ; http://www.foo.bar/status?full 183 | ; http://www.foo.bar/status?json&full 184 | ; http://www.foo.bar/status?html&full 185 | ; http://www.foo.bar/status?xml&full 186 | ; The Full status returns for each process: 187 | ; pid - the PID of the process; 188 | ; state - the state of the process (Idle, Running, ...); 189 | ; start time - the date and time the process has started; 190 | ; start since - the number of seconds since the process has started; 191 | ; requests - the number of requests the process has served; 192 | ; request duration - the duration in µs of the requests; 193 | ; request method - the request method (GET, POST, ...); 194 | ; request URI - the request URI with the query string; 195 | ; content length - the content length of the request (only with POST); 196 | ; user - the user (PHP_AUTH_USER) (or '-' if not set); 197 | ; script - the main script called (or '-' if not set); 198 | ; last request cpu - the %cpu the last request consumed 199 | ; it's always 0 if the process is not in Idle state 200 | ; because CPU calculation is done when the request 201 | ; processing has terminated; 202 | ; last request memory - the max amount of memory the last request consumed 203 | ; it's always 0 if the process is not in Idle state 204 | ; because memory calculation is done when the request 205 | ; processing has terminated; 206 | ; If the process is in Idle state, then informations are related to the 207 | ; last request the process has served. Otherwise informations are related to 208 | ; the current request being served. 209 | ; Example output: 210 | ; ************************ 211 | ; pid: 31330 212 | ; state: Running 213 | ; start time: 01/Jul/2011:17:53:49 +0200 214 | ; start since: 63087 215 | ; requests: 12808 216 | ; request duration: 1250261 217 | ; request method: GET 218 | ; request URI: /test_mem.php?N=10000 219 | ; content length: 0 220 | ; user: - 221 | ; script: /home/fat/web/docs/php/test_mem.php 222 | ; last request cpu: 0.00 223 | ; last request memory: 0 224 | ; 225 | ; Note: There is a real-time FPM status monitoring sample web page available 226 | ; It's available in: /usr/share/php7/fpm/status.html 227 | ; 228 | ; Note: The value must start with a leading slash (/). The value can be 229 | ; anything, but it may not be a good idea to use the .php extension or it 230 | ; may conflict with a real PHP file. 231 | ; Default Value: not set 232 | ;pm.status_path = /status1 233 | 234 | ; The ping URI to call the monitoring page of FPM. If this value is not set, no 235 | ; URI will be recognized as a ping page. This could be used to test from outside 236 | ; that FPM is alive and responding, or to 237 | ; - create a graph of FPM availability (rrd or such); 238 | ; - remove a server from a group if it is not responding (load balancing); 239 | ; - trigger alerts for the operating team (24/7). 240 | ; Note: The value must start with a leading slash (/). The value can be 241 | ; anything, but it may not be a good idea to use the .php extension or it 242 | ; may conflict with a real PHP file. 243 | ; Default Value: not set 244 | ping.path = /healthz 245 | 246 | ; This directive may be used to customize the response of a ping request. The 247 | ; response is formatted as text/plain with a 200 response code. 248 | ; Default Value: pong 249 | ping.response = OK 250 | 251 | ; The access log file 252 | ; Default: not set 253 | ;access.log = /proc/self/fd/2 254 | 255 | ; The access log format. 256 | ; The following syntax is allowed 257 | ; %%: the '%' character 258 | ; %C: %CPU used by the request 259 | ; it can accept the following format: 260 | ; - %{user}C for user CPU only 261 | ; - %{system}C for system CPU only 262 | ; - %{total}C for user + system CPU (default) 263 | ; %d: time taken to serve the request 264 | ; it can accept the following format: 265 | ; - %{seconds}d (default) 266 | ; - %{miliseconds}d 267 | ; - %{mili}d 268 | ; - %{microseconds}d 269 | ; - %{micro}d 270 | ; %e: an environment variable (same as $_ENV or $_SERVER) 271 | ; it must be associated with embraces to specify the name of the env 272 | ; variable. Some exemples: 273 | ; - server specifics like: %{REQUEST_METHOD}e or %{SERVER_PROTOCOL}e 274 | ; - HTTP headers like: %{HTTP_HOST}e or %{HTTP_USER_AGENT}e 275 | ; %f: script filename 276 | ; %l: content-length of the request (for POST request only) 277 | ; %m: request method 278 | ; %M: peak of memory allocated by PHP 279 | ; it can accept the following format: 280 | ; - %{bytes}M (default) 281 | ; - %{kilobytes}M 282 | ; - %{kilo}M 283 | ; - %{megabytes}M 284 | ; - %{mega}M 285 | ; %n: pool name 286 | ; %o: output header 287 | ; it must be associated with embraces to specify the name of the header: 288 | ; - %{Content-Type}o 289 | ; - %{X-Powered-By}o 290 | ; - %{Transfert-Encoding}o 291 | ; - .... 292 | ; %p: PID of the child that serviced the request 293 | ; %P: PID of the parent of the child that serviced the request 294 | ; %q: the query string 295 | ; %Q: the '?' character if query string exists 296 | ; %r: the request URI (without the query string, see %q and %Q) 297 | ; %R: remote IP address 298 | ; %s: status (response code) 299 | ; %t: server time the request was received 300 | ; it can accept a strftime(3) format: 301 | ; %d/%b/%Y:%H:%M:%S %z (default) 302 | ; The strftime(3) format must be encapsuled in a %{}t tag 303 | ; e.g. for a ISO8601 formatted timestring, use: %{%Y-%m-%dT%H:%M:%S%z}t 304 | ; %T: time the log has been written (the request has finished) 305 | ; it can accept a strftime(3) format: 306 | ; %d/%b/%Y:%H:%M:%S %z (default) 307 | ; The strftime(3) format must be encapsuled in a %{}t tag 308 | ; e.g. for a ISO8601 formatted timestring, use: %{%Y-%m-%dT%H:%M:%S%z}t 309 | ; %u: remote user 310 | ; 311 | ; Default: "%R - %u %t \"%m %r\" %s" 312 | ;access.format = "%t PHP: Request: %m %r%Q%q PHP Code: %s Filename: %f Memory: %{megabytes}MMB CPU: %C%% Time: %{seconds}d" 313 | 314 | ; The log file for slow requests 315 | ; Default Value: not set 316 | ; Note: slowlog is mandatory if request_slowlog_timeout is set 317 | ;slowlog = /proc/self/fd/2 318 | 319 | ; The timeout for serving a single request after which a PHP backtrace will be 320 | ; dumped to the 'slowlog' file. A value of '0s' means 'off'. 321 | ; Available units: s(econds)(default), m(inutes), h(ours), or d(ays) 322 | ; Default Value: 0 323 | ;request_slowlog_timeout = 1 324 | 325 | ; Depth of slow log stack trace. 326 | ; Default Value: 20 327 | ;request_slowlog_trace_depth = 20 328 | 329 | ; The timeout for serving a single request after which the worker process will 330 | ; be killed. This option should be used when the 'max_execution_time' ini option 331 | ; does not stop script execution for some reason. A value of '0' means 'off'. 332 | ; Available units: s(econds)(default), m(inutes), h(ours), or d(ays) 333 | ; Default Value: 0 334 | ;request_terminate_timeout = 0 335 | 336 | ; Set open file descriptor rlimit. 337 | ; Default Value: system defined value 338 | ;rlimit_files = 1024 339 | 340 | ; Set max core size rlimit. 341 | ; Possible Values: 'unlimited' or an integer greater or equal to 0 342 | ; Default Value: system defined value 343 | ;rlimit_core = 0 344 | 345 | ; Chroot to this directory at the start. This value must be defined as an 346 | ; absolute path. When this value is not set, chroot is not used. 347 | ; Note: you can prefix with '$prefix' to chroot to the pool prefix or one 348 | ; of its subdirectories. If the pool prefix is not set, the global prefix 349 | ; will be used instead. 350 | ; Note: chrooting is a great security feature and should be used whenever 351 | ; possible. However, all PHP paths will be relative to the chroot 352 | ; (error_log, sessions.save_path, ...). 353 | ; Default Value: not set 354 | ;chroot = 355 | 356 | ; Chdir to this directory at the start. 357 | ; Note: relative path can be used. 358 | ; Default Value: current directory or / when chroot 359 | ;chdir = /var/www 360 | 361 | ; Redirect worker stdout and stderr into main error log. If not set, stdout and 362 | ; stderr will be redirected to /dev/null according to FastCGI specs. 363 | ; Note: on highloaded environement, this can cause some delay in the page 364 | ; process time (several ms). 365 | ; Default Value: no 366 | catch_workers_output = yes 367 | 368 | ; Clear environment in FPM workers 369 | ; Prevents arbitrary environment variables from reaching FPM worker processes 370 | ; by clearing the environment in workers before env vars specified in this 371 | ; pool configuration are added. 372 | ; Setting to "no" will make all environment variables available to PHP code 373 | ; via getenv(), $_ENV and $_SERVER. 374 | ; Default Value: yes 375 | clear_env = no 376 | 377 | ; Limits the extensions of the main script FPM will allow to parse. This can 378 | ; prevent configuration mistakes on the web server side. You should only limit 379 | ; FPM to .php extensions to prevent malicious users to use other extensions to 380 | ; execute php code. 381 | ; Note: set an empty value to allow all extensions. 382 | ; Default Value: .php 383 | ;security.limit_extensions = .php .php3 .php4 .php5 .php7 384 | 385 | ; Pass environment variables like LD_LIBRARY_PATH. All $VARIABLEs are taken from 386 | ; the current environment. 387 | ; Default Value: clean env 388 | ;env[HOSTNAME] = $HOSTNAME 389 | ;env[PATH] = /usr/local/bin:/usr/bin:/bin 390 | ;env[TMP] = /tmp 391 | ;env[TMPDIR] = /tmp 392 | ;env[TEMP] = /tmp 393 | 394 | ; Additional php.ini defines, specific to this pool of workers. These settings 395 | ; overwrite the values previously defined in the php.ini. The directives are the 396 | ; same as the PHP SAPI: 397 | ; php_value/php_flag - you can set classic ini defines which can 398 | ; be overwritten from PHP call 'ini_set'. 399 | ; php_admin_value/php_admin_flag - these directives won't be overwritten by 400 | ; PHP call 'ini_set' 401 | ; For php_*flag, valid values are on, off, 1, 0, true, false, yes or no. 402 | 403 | ; Defining 'extension' will load the corresponding shared extension from 404 | ; extension_dir. Defining 'disable_functions' or 'disable_classes' will not 405 | ; overwrite previously defined php.ini values, but will append the new value 406 | ; instead. 407 | 408 | ; Note: path INI options can be relative and will be expanded with the prefix 409 | ; (pool, global or /usr) 410 | 411 | ; Default Value: nothing is defined by default except the values in php.ini and 412 | ; specified at startup with the -d argument 413 | ;php_admin_value[sendmail_path] = /usr/sbin/sendmail -t -i -f www@my.domain.com 414 | ;php_flag[display_errors] = off 415 | ;php_admin_value[error_log] = /var/log/php7/www.error.log 416 | ;php_admin_flag[log_errors] = on 417 | ;php_admin_value[memory_limit] = 32M -------------------------------------------------------------------------------- /conf/php.ini: -------------------------------------------------------------------------------- 1 | [PHP] 2 | 3 | ;;;;;;;;;;;;;;;;;;; 4 | ; About php.ini ; 5 | ;;;;;;;;;;;;;;;;;;; 6 | ; PHP's initialization file, generally called php.ini, is responsible for 7 | ; configuring many of the aspects of PHP's behavior. 8 | 9 | ; PHP attempts to find and load this configuration from a number of locations. 10 | ; The following is a summary of its search order: 11 | ; 1. SAPI module specific location. 12 | ; 2. The PHPRC environment variable. (As of PHP 5.2.0) 13 | ; 3. A number of predefined registry keys on Windows (As of PHP 5.2.0) 14 | ; 4. Current working directory (except CLI) 15 | ; 5. The web server's directory (for SAPI modules), or directory of PHP 16 | ; (otherwise in Windows) 17 | ; 6. The directory from the --with-config-file-path compile time option, or the 18 | ; Windows directory (C:\windows or C:\winnt) 19 | ; See the PHP docs for more specific information. 20 | ; http://php.net/configuration.file 21 | 22 | ; The syntax of the file is extremely simple. Whitespace and lines 23 | ; beginning with a semicolon are silently ignored (as you probably guessed). 24 | ; Section headers (e.g. [Foo]) are also silently ignored, even though 25 | ; they might mean something in the future. 26 | 27 | ; Directives following the section heading [PATH=/www/mysite] only 28 | ; apply to PHP files in the /www/mysite directory. Directives 29 | ; following the section heading [HOST=www.example.com] only apply to 30 | ; PHP files served from www.example.com. Directives set in these 31 | ; special sections cannot be overridden by user-defined INI files or 32 | ; at runtime. Currently, [PATH=] and [HOST=] sections only work under 33 | ; CGI/FastCGI. 34 | ; http://php.net/ini.sections 35 | 36 | ; Directives are specified using the following syntax: 37 | ; directive = value 38 | ; Directive names are *case sensitive* - foo=bar is different from FOO=bar. 39 | ; Directives are variables used to configure PHP or PHP extensions. 40 | ; There is no name validation. If PHP can't find an expected 41 | ; directive because it is not set or is mistyped, a default value will be used. 42 | 43 | ; The value can be a string, a number, a PHP constant (e.g. E_ALL or M_PI), one 44 | ; of the INI constants (On, Off, True, False, Yes, No and None) or an expression 45 | ; (e.g. E_ALL & ~E_NOTICE), a quoted string ("bar"), or a reference to a 46 | ; previously set variable or directive (e.g. ${foo}) 47 | 48 | ; Expressions in the INI file are limited to bitwise operators and parentheses: 49 | ; | bitwise OR 50 | ; ^ bitwise XOR 51 | ; & bitwise AND 52 | ; ~ bitwise NOT 53 | ; ! boolean NOT 54 | 55 | ; Boolean flags can be turned on using the values 1, On, True or Yes. 56 | ; They can be turned off using the values 0, Off, False or No. 57 | 58 | ; An empty string can be denoted by simply not writing anything after the equal 59 | ; sign, or by using the None keyword: 60 | 61 | ; foo = ; sets foo to an empty string 62 | ; foo = None ; sets foo to an empty string 63 | ; foo = "None" ; sets foo to the string 'None' 64 | 65 | ; If you use constants in your value, and these constants belong to a 66 | ; dynamically loaded extension (either a PHP extension or a Zend extension), 67 | ; you may only use these constants *after* the line that loads the extension. 68 | 69 | ;;;;;;;;;;;;;;;;;;; 70 | ; About this file ; 71 | ;;;;;;;;;;;;;;;;;;; 72 | ; PHP comes packaged with two INI files. One that is recommended to be used 73 | ; in production environments and one that is recommended to be used in 74 | ; development environments. 75 | 76 | ; php.ini-production contains settings which hold security, performance and 77 | ; best practices at its core. But please be aware, these settings may break 78 | ; compatibility with older or less security conscience applications. We 79 | ; recommending using the production ini in production and testing environments. 80 | 81 | ; php.ini-development is very similar to its production variant, except it is 82 | ; much more verbose when it comes to errors. We recommend using the 83 | ; development version only in development environments, as errors shown to 84 | ; application users can inadvertently leak otherwise secure information. 85 | 86 | ; This is php.ini-production INI file. 87 | 88 | ;;;;;;;;;;;;;;;;;;; 89 | ; Quick Reference ; 90 | ;;;;;;;;;;;;;;;;;;; 91 | ; The following are all the settings which are different in either the production 92 | ; or development versions of the INIs with respect to PHP's default behavior. 93 | ; Please see the actual settings later in the document for more details as to why 94 | ; we recommend these changes in PHP's behavior. 95 | 96 | ; display_errors 97 | ; Default Value: On 98 | ; Development Value: On 99 | ; Production Value: Off 100 | 101 | ; display_startup_errors 102 | ; Default Value: Off 103 | ; Development Value: On 104 | ; Production Value: Off 105 | 106 | ; error_reporting 107 | ; Default Value: E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED 108 | ; Development Value: E_ALL 109 | ; Production Value: E_ALL & ~E_DEPRECATED & ~E_STRICT 110 | 111 | ; html_errors 112 | ; Default Value: On 113 | ; Development Value: On 114 | ; Production value: On 115 | 116 | ; log_errors 117 | ; Default Value: Off 118 | ; Development Value: On 119 | ; Production Value: On 120 | 121 | ; max_input_time 122 | ; Default Value: -1 (Unlimited) 123 | ; Development Value: 60 (60 seconds) 124 | ; Production Value: 60 (60 seconds) 125 | 126 | ; output_buffering 127 | ; Default Value: Off 128 | ; Development Value: 4096 129 | ; Production Value: 4096 130 | 131 | ; register_argc_argv 132 | ; Default Value: On 133 | ; Development Value: Off 134 | ; Production Value: Off 135 | 136 | ; request_order 137 | ; Default Value: None 138 | ; Development Value: "GP" 139 | ; Production Value: "GP" 140 | 141 | ; session.gc_divisor 142 | ; Default Value: 100 143 | ; Development Value: 1000 144 | ; Production Value: 1000 145 | 146 | ; session.sid_bits_per_character 147 | ; Default Value: 4 148 | ; Development Value: 5 149 | ; Production Value: 5 150 | 151 | ; short_open_tag 152 | ; Default Value: On 153 | ; Development Value: Off 154 | ; Production Value: Off 155 | 156 | ; track_errors 157 | ; Default Value: Off 158 | ; Development Value: On 159 | ; Production Value: Off 160 | 161 | ; variables_order 162 | ; Default Value: "EGPCS" 163 | ; Development Value: "GPCS" 164 | ; Production Value: "GPCS" 165 | 166 | ;;;;;;;;;;;;;;;;;;;; 167 | ; php.ini Options ; 168 | ;;;;;;;;;;;;;;;;;;;; 169 | ; Name for user-defined php.ini (.htaccess) files. Default is ".user.ini" 170 | ;user_ini.filename = ".user.ini" 171 | 172 | ; To disable this feature set this option to empty value 173 | ;user_ini.filename = 174 | 175 | ; TTL for user-defined php.ini files (time-to-live) in seconds. Default is 300 seconds (5 minutes) 176 | ;user_ini.cache_ttl = 300 177 | 178 | ;;;;;;;;;;;;;;;;;;;; 179 | ; Language Options ; 180 | ;;;;;;;;;;;;;;;;;;;; 181 | 182 | ; Enable the PHP scripting language engine under Apache. 183 | ; http://php.net/engine 184 | engine = On 185 | 186 | ; This directive determines whether or not PHP will recognize code between 187 | ; tags as PHP source which should be processed as such. It is 188 | ; generally recommended that should be used and that this feature 189 | ; should be disabled, as enabling it may result in issues when generating XML 190 | ; documents, however this remains supported for backward compatibility reasons. 191 | ; Note that this directive does not control the would work. 323 | ; http://php.net/syntax-highlighting 324 | ;highlight.string = #DD0000 325 | ;highlight.comment = #FF9900 326 | ;highlight.keyword = #007700 327 | ;highlight.default = #0000BB 328 | ;highlight.html = #000000 329 | 330 | ; If enabled, the request will be allowed to complete even if the user aborts 331 | ; the request. Consider enabling it if executing long requests, which may end up 332 | ; being interrupted by the user or a browser timing out. PHP's default behavior 333 | ; is to disable this feature. 334 | ; http://php.net/ignore-user-abort 335 | ;ignore_user_abort = On 336 | 337 | ; Determines the size of the realpath cache to be used by PHP. This value should 338 | ; be increased on systems where PHP opens many files to reflect the quantity of 339 | ; the file operations performed. 340 | ; http://php.net/realpath-cache-size 341 | realpath_cache_size = 8000k 342 | 343 | ; Duration of time, in seconds for which to cache realpath information for a given 344 | ; file or directory. For systems with rarely changing files, consider increasing this 345 | ; value. 346 | ; http://php.net/realpath-cache-ttl 347 | realpath_cache_ttl = 120 348 | 349 | ; Enables or disables the circular reference collector. 350 | ; http://php.net/zend.enable-gc 351 | zend.enable_gc = On 352 | 353 | ; If enabled, scripts may be written in encodings that are incompatible with 354 | ; the scanner. CP936, Big5, CP949 and Shift_JIS are the examples of such 355 | ; encodings. To use this feature, mbstring extension must be enabled. 356 | ; Default: Off 357 | ;zend.multibyte = Off 358 | 359 | ; Allows to set the default encoding for the scripts. This value will be used 360 | ; unless "declare(encoding=...)" directive appears at the top of the script. 361 | ; Only affects if zend.multibyte is set. 362 | ; Default: "" 363 | ;zend.script_encoding = 364 | 365 | ;;;;;;;;;;;;;;;;; 366 | ; Miscellaneous ; 367 | ;;;;;;;;;;;;;;;;; 368 | 369 | ; Decides whether PHP may expose the fact that it is installed on the server 370 | ; (e.g. by adding its signature to the Web server header). It is no security 371 | ; threat in any way, but it makes it possible to determine whether you use PHP 372 | ; on your server or not. 373 | ; http://php.net/expose-php 374 | expose_php = Off 375 | 376 | ;;;;;;;;;;;;;;;;;;; 377 | ; Resource Limits ; 378 | ;;;;;;;;;;;;;;;;;;; 379 | 380 | ; Maximum execution time of each script, in seconds 381 | ; http://php.net/max-execution-time 382 | ; Note: This directive is hardcoded to 0 for the CLI SAPI 383 | max_execution_time = 600 384 | 385 | ; Maximum amount of time each script may spend parsing request data. It's a good 386 | ; idea to limit this time on productions servers in order to eliminate unexpectedly 387 | ; long running scripts. 388 | ; Note: This directive is hardcoded to -1 for the CLI SAPI 389 | ; Default Value: -1 (Unlimited) 390 | ; Development Value: 60 (60 seconds) 391 | ; Production Value: 60 (60 seconds) 392 | ; http://php.net/max-input-time 393 | max_input_time = 60 394 | 395 | ; Maximum input variable nesting level 396 | ; http://php.net/max-input-nesting-level 397 | ;max_input_nesting_level = 64 398 | 399 | ; How many GET/POST/COOKIE input variables may be accepted 400 | ; max_input_vars = 1000 401 | 402 | ; Maximum amount of memory a script may consume (128MB) 403 | ; http://php.net/memory-limit 404 | memory_limit = 128M 405 | 406 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 407 | ; Error handling and logging ; 408 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 409 | 410 | ; This directive informs PHP of which errors, warnings and notices you would like 411 | ; it to take action for. The recommended way of setting values for this 412 | ; directive is through the use of the error level constants and bitwise 413 | ; operators. The error level constants are below here for convenience as well as 414 | ; some common settings and their meanings. 415 | ; By default, PHP is set to take action on all errors, notices and warnings EXCEPT 416 | ; those related to E_NOTICE and E_STRICT, which together cover best practices and 417 | ; recommended coding standards in PHP. For performance reasons, this is the 418 | ; recommend error reporting setting. Your production server shouldn't be wasting 419 | ; resources complaining about best practices and coding standards. That's what 420 | ; development servers and development settings are for. 421 | ; Note: The php.ini-development file has this setting as E_ALL. This 422 | ; means it pretty much reports everything which is exactly what you want during 423 | ; development and early testing. 424 | ; 425 | ; Error Level Constants: 426 | ; E_ALL - All errors and warnings (includes E_STRICT as of PHP 5.4.0) 427 | ; E_ERROR - fatal run-time errors 428 | ; E_RECOVERABLE_ERROR - almost fatal run-time errors 429 | ; E_WARNING - run-time warnings (non-fatal errors) 430 | ; E_PARSE - compile-time parse errors 431 | ; E_NOTICE - run-time notices (these are warnings which often result 432 | ; from a bug in your code, but it's possible that it was 433 | ; intentional (e.g., using an uninitialized variable and 434 | ; relying on the fact it is automatically initialized to an 435 | ; empty string) 436 | ; E_STRICT - run-time notices, enable to have PHP suggest changes 437 | ; to your code which will ensure the best interoperability 438 | ; and forward compatibility of your code 439 | ; E_CORE_ERROR - fatal errors that occur during PHP's initial startup 440 | ; E_CORE_WARNING - warnings (non-fatal errors) that occur during PHP's 441 | ; initial startup 442 | ; E_COMPILE_ERROR - fatal compile-time errors 443 | ; E_COMPILE_WARNING - compile-time warnings (non-fatal errors) 444 | ; E_USER_ERROR - user-generated error message 445 | ; E_USER_WARNING - user-generated warning message 446 | ; E_USER_NOTICE - user-generated notice message 447 | ; E_DEPRECATED - warn about code that will not work in future versions 448 | ; of PHP 449 | ; E_USER_DEPRECATED - user-generated deprecation warnings 450 | ; 451 | ; Common Values: 452 | ; E_ALL (Show all errors, warnings and notices including coding standards.) 453 | ; E_ALL & ~E_NOTICE (Show all errors, except for notices) 454 | ; E_ALL & ~E_NOTICE & ~E_STRICT (Show all errors, except for notices and coding standards warnings.) 455 | ; E_COMPILE_ERROR|E_RECOVERABLE_ERROR|E_ERROR|E_CORE_ERROR (Show only errors) 456 | ; Default Value: E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED 457 | ; Development Value: E_ALL 458 | ; Production Value: E_ALL & ~E_DEPRECATED & ~E_STRICT 459 | ; http://php.net/error-reporting 460 | error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT 461 | 462 | ; This directive controls whether or not and where PHP will output errors, 463 | ; notices and warnings too. Error output is very useful during development, but 464 | ; it could be very dangerous in production environments. Depending on the code 465 | ; which is triggering the error, sensitive information could potentially leak 466 | ; out of your application such as database usernames and passwords or worse. 467 | ; For production environments, we recommend logging errors rather than 468 | ; sending them to STDOUT. 469 | ; Possible Values: 470 | ; Off = Do not display any errors 471 | ; stderr = Display errors to STDERR (affects only CGI/CLI binaries!) 472 | ; On or stdout = Display errors to STDOUT 473 | ; Default Value: On 474 | ; Development Value: On 475 | ; Production Value: Off 476 | ; http://php.net/display-errors 477 | display_errors = Off 478 | 479 | ; The display of errors which occur during PHP's startup sequence are handled 480 | ; separately from display_errors. PHP's default behavior is to suppress those 481 | ; errors from clients. Turning the display of startup errors on can be useful in 482 | ; debugging configuration problems. We strongly recommend you 483 | ; set this to 'off' for production servers. 484 | ; Default Value: Off 485 | ; Development Value: On 486 | ; Production Value: Off 487 | ; http://php.net/display-startup-errors 488 | display_startup_errors = Off 489 | 490 | ; Besides displaying errors, PHP can also log errors to locations such as a 491 | ; server-specific log, STDERR, or a location specified by the error_log 492 | ; directive found below. While errors should not be displayed on productions 493 | ; servers they should still be monitored and logging is a great way to do that. 494 | ; Default Value: Off 495 | ; Development Value: On 496 | ; Production Value: On 497 | ; http://php.net/log-errors 498 | log_errors = On 499 | 500 | ; Set maximum length of log_errors. In error_log information about the source is 501 | ; added. The default is 1024 and 0 allows to not apply any maximum length at all. 502 | ; http://php.net/log-errors-max-len 503 | log_errors_max_len = 1024 504 | 505 | ; Do not log repeated messages. Repeated errors must occur in same file on same 506 | ; line unless ignore_repeated_source is set true. 507 | ; http://php.net/ignore-repeated-errors 508 | ignore_repeated_errors = Off 509 | 510 | ; Ignore source of message when ignoring repeated messages. When this setting 511 | ; is On you will not log errors with repeated messages from different files or 512 | ; source lines. 513 | ; http://php.net/ignore-repeated-source 514 | ignore_repeated_source = Off 515 | 516 | ; If this parameter is set to Off, then memory leaks will not be shown (on 517 | ; stdout or in the log). This has only effect in a debug compile, and if 518 | ; error reporting includes E_WARNING in the allowed list 519 | ; http://php.net/report-memleaks 520 | report_memleaks = On 521 | 522 | ; This setting is on by default. 523 | ;report_zend_debug = 0 524 | 525 | ; Store the last error/warning message in $php_errormsg (boolean). Setting this value 526 | ; to On can assist in debugging and is appropriate for development servers. It should 527 | ; however be disabled on production servers. 528 | ; This directive is DEPRECATED. 529 | ; Default Value: Off 530 | ; Development Value: Off 531 | ; Production Value: Off 532 | ; http://php.net/track-errors 533 | ;track_errors = Off 534 | 535 | ; Turn off normal error reporting and emit XML-RPC error XML 536 | ; http://php.net/xmlrpc-errors 537 | ;xmlrpc_errors = 0 538 | 539 | ; An XML-RPC faultCode 540 | ;xmlrpc_error_number = 0 541 | 542 | ; When PHP displays or logs an error, it has the capability of formatting the 543 | ; error message as HTML for easier reading. This directive controls whether 544 | ; the error message is formatted as HTML or not. 545 | ; Note: This directive is hardcoded to Off for the CLI SAPI 546 | ; Default Value: On 547 | ; Development Value: On 548 | ; Production value: On 549 | ; http://php.net/html-errors 550 | html_errors = On 551 | 552 | ; If html_errors is set to On *and* docref_root is not empty, then PHP 553 | ; produces clickable error messages that direct to a page describing the error 554 | ; or function causing the error in detail. 555 | ; You can download a copy of the PHP manual from http://php.net/docs 556 | ; and change docref_root to the base URL of your local copy including the 557 | ; leading '/'. You must also specify the file extension being used including 558 | ; the dot. PHP's default behavior is to leave these settings empty, in which 559 | ; case no links to documentation are generated. 560 | ; Note: Never use this feature for production boxes. 561 | ; http://php.net/docref-root 562 | ; Examples 563 | ;docref_root = "/phpmanual/" 564 | 565 | ; http://php.net/docref-ext 566 | ;docref_ext = .html 567 | 568 | ; String to output before an error message. PHP's default behavior is to leave 569 | ; this setting blank. 570 | ; http://php.net/error-prepend-string 571 | ; Example: 572 | ;error_prepend_string = "" 573 | 574 | ; String to output after an error message. PHP's default behavior is to leave 575 | ; this setting blank. 576 | ; http://php.net/error-append-string 577 | ; Example: 578 | ;error_append_string = "" 579 | 580 | ; Log errors to specified file. PHP's default behavior is to leave this value 581 | ; empty. 582 | ; http://php.net/error-log 583 | ; Example: 584 | ;error_log = php_errors.log 585 | ; Log errors to syslog (Event Log on Windows). 586 | ;error_log = syslog 587 | 588 | ;windows.show_crt_warning 589 | ; Default value: 0 590 | ; Development value: 0 591 | ; Production value: 0 592 | 593 | ;;;;;;;;;;;;;;;;; 594 | ; Data Handling ; 595 | ;;;;;;;;;;;;;;;;; 596 | 597 | ; The separator used in PHP generated URLs to separate arguments. 598 | ; PHP's default setting is "&". 599 | ; http://php.net/arg-separator.output 600 | ; Example: 601 | ;arg_separator.output = "&" 602 | 603 | ; List of separator(s) used by PHP to parse input URLs into variables. 604 | ; PHP's default setting is "&". 605 | ; NOTE: Every character in this directive is considered as separator! 606 | ; http://php.net/arg-separator.input 607 | ; Example: 608 | ;arg_separator.input = ";&" 609 | 610 | ; This directive determines which super global arrays are registered when PHP 611 | ; starts up. G,P,C,E & S are abbreviations for the following respective super 612 | ; globals: GET, POST, COOKIE, ENV and SERVER. There is a performance penalty 613 | ; paid for the registration of these arrays and because ENV is not as commonly 614 | ; used as the others, ENV is not recommended on productions servers. You 615 | ; can still get access to the environment variables through getenv() should you 616 | ; need to. 617 | ; Default Value: "EGPCS" 618 | ; Development Value: "GPCS" 619 | ; Production Value: "GPCS"; 620 | ; http://php.net/variables-order 621 | variables_order = "EGPCS" 622 | 623 | ; This directive determines which super global data (G,P & C) should be 624 | ; registered into the super global array REQUEST. If so, it also determines 625 | ; the order in which that data is registered. The values for this directive 626 | ; are specified in the same manner as the variables_order directive, 627 | ; EXCEPT one. Leaving this value empty will cause PHP to use the value set 628 | ; in the variables_order directive. It does not mean it will leave the super 629 | ; globals array REQUEST empty. 630 | ; Default Value: None 631 | ; Development Value: "GP" 632 | ; Production Value: "GP" 633 | ; http://php.net/request-order 634 | request_order = "GP" 635 | 636 | ; This directive determines whether PHP registers $argv & $argc each time it 637 | ; runs. $argv contains an array of all the arguments passed to PHP when a script 638 | ; is invoked. $argc contains an integer representing the number of arguments 639 | ; that were passed when the script was invoked. These arrays are extremely 640 | ; useful when running scripts from the command line. When this directive is 641 | ; enabled, registering these variables consumes CPU cycles and memory each time 642 | ; a script is executed. For performance reasons, this feature should be disabled 643 | ; on production servers. 644 | ; Note: This directive is hardcoded to On for the CLI SAPI 645 | ; Default Value: On 646 | ; Development Value: Off 647 | ; Production Value: Off 648 | ; http://php.net/register-argc-argv 649 | register_argc_argv = Off 650 | 651 | ; When enabled, the ENV, REQUEST and SERVER variables are created when they're 652 | ; first used (Just In Time) instead of when the script starts. If these 653 | ; variables are not used within a script, having this directive on will result 654 | ; in a performance gain. The PHP directive register_argc_argv must be disabled 655 | ; for this directive to have any affect. 656 | ; http://php.net/auto-globals-jit 657 | auto_globals_jit = On 658 | 659 | ; Whether PHP will read the POST data. 660 | ; This option is enabled by default. 661 | ; Most likely, you won't want to disable this option globally. It causes $_POST 662 | ; and $_FILES to always be empty; the only way you will be able to read the 663 | ; POST data will be through the php://input stream wrapper. This can be useful 664 | ; to proxy requests or to process the POST data in a memory efficient fashion. 665 | ; http://php.net/enable-post-data-reading 666 | ;enable_post_data_reading = Off 667 | 668 | ; Maximum size of POST data that PHP will accept. 669 | ; Its value may be 0 to disable the limit. It is ignored if POST data reading 670 | ; is disabled through enable_post_data_reading. 671 | ; http://php.net/post-max-size 672 | post_max_size = 1024M 673 | 674 | ; Automatically add files before PHP document. 675 | ; http://php.net/auto-prepend-file 676 | auto_prepend_file = 677 | 678 | ; Automatically add files after PHP document. 679 | ; http://php.net/auto-append-file 680 | auto_append_file = 681 | 682 | ; By default, PHP will output a media type using the Content-Type header. To 683 | ; disable this, simply set it to be empty. 684 | ; 685 | ; PHP's built-in default media type is set to text/html. 686 | ; http://php.net/default-mimetype 687 | default_mimetype = "text/html" 688 | 689 | ; PHP's default character set is set to UTF-8. 690 | ; http://php.net/default-charset 691 | default_charset = "UTF-8" 692 | 693 | ; PHP internal character encoding is set to empty. 694 | ; If empty, default_charset is used. 695 | ; http://php.net/internal-encoding 696 | ;internal_encoding = 697 | 698 | ; PHP input character encoding is set to empty. 699 | ; If empty, default_charset is used. 700 | ; http://php.net/input-encoding 701 | ;input_encoding = 702 | 703 | ; PHP output character encoding is set to empty. 704 | ; If empty, default_charset is used. 705 | ; See also output_buffer. 706 | ; http://php.net/output-encoding 707 | ;output_encoding = 708 | 709 | ;;;;;;;;;;;;;;;;;;;;;;;;; 710 | ; Paths and Directories ; 711 | ;;;;;;;;;;;;;;;;;;;;;;;;; 712 | 713 | ; UNIX: "/path1:/path2" 714 | ;include_path = ".:/php/includes" 715 | ; 716 | ; Windows: "\path1;\path2" 717 | ;include_path = ".;c:\php\includes" 718 | ; 719 | ; PHP's default setting for include_path is ".;/path/to/php/pear" 720 | ; http://php.net/include-path 721 | 722 | ; The root of the PHP pages, used only if nonempty. 723 | ; if PHP was not compiled with FORCE_REDIRECT, you SHOULD set doc_root 724 | ; if you are running php as a CGI under any web server (other than IIS) 725 | ; see documentation for security issues. The alternate is to use the 726 | ; cgi.force_redirect configuration below 727 | ; http://php.net/doc-root 728 | doc_root = 729 | 730 | ; The directory under which PHP opens the script using /~username used only 731 | ; if nonempty. 732 | ; http://php.net/user-dir 733 | user_dir = 734 | 735 | ; Directory in which the loadable extensions (modules) reside. 736 | ; http://php.net/extension-dir 737 | ; extension_dir = "./" 738 | ; On windows: 739 | ; extension_dir = "ext" 740 | 741 | ; Directory where the temporary files should be placed. 742 | ; Defaults to the system default (see sys_get_temp_dir) 743 | ; sys_temp_dir = "/tmp" 744 | 745 | ; Whether or not to enable the dl() function. The dl() function does NOT work 746 | ; properly in multithreaded servers, such as IIS or Zeus, and is automatically 747 | ; disabled on them. 748 | ; http://php.net/enable-dl 749 | enable_dl = Off 750 | 751 | ; cgi.force_redirect is necessary to provide security running PHP as a CGI under 752 | ; most web servers. Left undefined, PHP turns this on by default. You can 753 | ; turn it off here AT YOUR OWN RISK 754 | ; **You CAN safely turn this off for IIS, in fact, you MUST.** 755 | ; http://php.net/cgi.force-redirect 756 | ;cgi.force_redirect = 1 757 | 758 | ; if cgi.nph is enabled it will force cgi to always sent Status: 200 with 759 | ; every request. PHP's default behavior is to disable this feature. 760 | ;cgi.nph = 1 761 | 762 | ; if cgi.force_redirect is turned on, and you are not running under Apache or Netscape 763 | ; (iPlanet) web servers, you MAY need to set an environment variable name that PHP 764 | ; will look for to know it is OK to continue execution. Setting this variable MAY 765 | ; cause security issues, KNOW WHAT YOU ARE DOING FIRST. 766 | ; http://php.net/cgi.redirect-status-env 767 | ;cgi.redirect_status_env = 768 | 769 | ; cgi.fix_pathinfo provides *real* PATH_INFO/PATH_TRANSLATED support for CGI. PHP's 770 | ; previous behaviour was to set PATH_TRANSLATED to SCRIPT_FILENAME, and to not grok 771 | ; what PATH_INFO is. For more information on PATH_INFO, see the cgi specs. Setting 772 | ; this to 1 will cause PHP CGI to fix its paths to conform to the spec. A setting 773 | ; of zero causes PHP to behave as before. Default is 1. You should fix your scripts 774 | ; to use SCRIPT_FILENAME rather than PATH_TRANSLATED. 775 | ; http://php.net/cgi.fix-pathinfo 776 | ;cgi.fix_pathinfo=1 777 | 778 | ; if cgi.discard_path is enabled, the PHP CGI binary can safely be placed outside 779 | ; of the web tree and people will not be able to circumvent .htaccess security. 780 | ; http://php.net/cgi.dicard-path 781 | ;cgi.discard_path=1 782 | 783 | ; FastCGI under IIS (on WINNT based OS) supports the ability to impersonate 784 | ; security tokens of the calling client. This allows IIS to define the 785 | ; security context that the request runs under. mod_fastcgi under Apache 786 | ; does not currently support this feature (03/17/2002) 787 | ; Set to 1 if running under IIS. Default is zero. 788 | ; http://php.net/fastcgi.impersonate 789 | ;fastcgi.impersonate = 1 790 | 791 | ; Disable logging through FastCGI connection. PHP's default behavior is to enable 792 | ; this feature. 793 | ;fastcgi.logging = 0 794 | 795 | ; cgi.rfc2616_headers configuration option tells PHP what type of headers to 796 | ; use when sending HTTP response code. If set to 0, PHP sends Status: header that 797 | ; is supported by Apache. When this option is set to 1, PHP will send 798 | ; RFC2616 compliant header. 799 | ; Default is zero. 800 | ; http://php.net/cgi.rfc2616-headers 801 | ;cgi.rfc2616_headers = 0 802 | 803 | ; cgi.check_shebang_line controls whether CGI PHP checks for line starting with #! 804 | ; (shebang) at the top of the running script. This line might be needed if the 805 | ; script support running both as stand-alone script and via PHP CGI<. PHP in CGI 806 | ; mode skips this line and ignores its content if this directive is turned on. 807 | ; http://php.net/cgi.check-shebang-line 808 | ;cgi.check_shebang_line=1 809 | 810 | ;;;;;;;;;;;;;;;; 811 | ; File Uploads ; 812 | ;;;;;;;;;;;;;;;; 813 | 814 | ; Whether to allow HTTP file uploads. 815 | ; http://php.net/file-uploads 816 | file_uploads = On 817 | 818 | ; Temporary directory for HTTP uploaded files (will use system default if not 819 | ; specified). 820 | ; http://php.net/upload-tmp-dir 821 | ;upload_tmp_dir = 822 | 823 | ; Maximum allowed size for uploaded files. 824 | ; http://php.net/upload-max-filesize 825 | upload_max_filesize = 1024M 826 | 827 | ; Maximum number of files that can be uploaded via a single request 828 | max_file_uploads = 50 829 | 830 | ;;;;;;;;;;;;;;;;;; 831 | ; Fopen wrappers ; 832 | ;;;;;;;;;;;;;;;;;; 833 | 834 | ; Whether to allow the treatment of URLs (like http:// or ftp://) as files. 835 | ; http://php.net/allow-url-fopen 836 | allow_url_fopen = On 837 | 838 | ; Whether to allow include/require to open URLs (like http:// or ftp://) as files. 839 | ; http://php.net/allow-url-include 840 | allow_url_include = Off 841 | 842 | ; Define the anonymous ftp password (your email address). PHP's default setting 843 | ; for this is empty. 844 | ; http://php.net/from 845 | ;from="john@doe.com" 846 | 847 | ; Define the User-Agent string. PHP's default setting for this is empty. 848 | ; http://php.net/user-agent 849 | ;user_agent="PHP" 850 | 851 | ; Default timeout for socket based streams (seconds) 852 | ; http://php.net/default-socket-timeout 853 | default_socket_timeout = 120 854 | 855 | ; If your scripts have to deal with files from Macintosh systems, 856 | ; or you are running on a Mac and need to deal with files from 857 | ; unix or win32 systems, setting this flag will cause PHP to 858 | ; automatically detect the EOL character in those files so that 859 | ; fgets() and file() will work regardless of the source of the file. 860 | ; http://php.net/auto-detect-line-endings 861 | ;auto_detect_line_endings = Off 862 | 863 | ;;;;;;;;;;;;;;;;;;;;;; 864 | ; Dynamic Extensions ; 865 | ;;;;;;;;;;;;;;;;;;;;;; 866 | 867 | ; If you wish to have an extension loaded automatically, use the following 868 | ; syntax: 869 | ; 870 | ; extension=modulename 871 | ; 872 | ; For example: 873 | ; 874 | ; extension=mysqli 875 | ; 876 | ; When the extension library to load is not located in the default extension 877 | ; directory, You may specify an absolute path to the library file: 878 | ; 879 | ; extension=/path/to/extension/mysqli.so 880 | ; 881 | ; Note : The syntax used in previous PHP versions ('extension=.so' and 882 | ; 'extension='php_.dll') is supported for legacy reasons and may be 883 | ; deprecated in a future PHP major version. So, when it is possible, please 884 | ; move to the new ('extension=) syntax. 885 | ; 886 | ; Notes for Windows environments : 887 | ; 888 | ; - ODBC support is built in, so no dll is needed for it. 889 | ; - Many DLL files are located in the extensions/ (PHP 4) or ext/ (PHP 5+) 890 | ; extension folders as well as the separate PECL DLL download (PHP 5+). 891 | ; Be sure to appropriately set the extension_dir directive. 892 | ; 893 | ;extension=bz2 894 | ;extension=curl 895 | ;extension=fileinfo 896 | ;extension=gd2 897 | ;extension=gettext 898 | ;extension=gmp 899 | ;extension=intl 900 | ;extension=imap 901 | ;extension=interbase 902 | ;extension=ldap 903 | ;extension=mbstring 904 | ;extension=exif ; Must be after mbstring as it depends on it 905 | ;extension=mysqli 906 | ;extension=oci8_12c ; Use with Oracle Database 12c Instant Client 907 | ;extension=openssl 908 | ;extension=pdo_firebird 909 | ;extension=pdo_mysql 910 | ;extension=pdo_oci 911 | ;extension=pdo_odbc 912 | ;extension=pdo_pgsql 913 | ;extension=pdo_sqlite 914 | ;extension=pgsql 915 | ;extension=shmop 916 | 917 | ; The MIBS data available in the PHP distribution must be installed. 918 | ; See http://www.php.net/manual/en/snmp.installation.php 919 | ;extension=snmp 920 | 921 | ;extension=soap 922 | ;extension=sockets 923 | ;extension=sqlite3 924 | ;extension=tidy 925 | ;extension=xmlrpc 926 | ;extension=xsl 927 | 928 | ;;;;;;;;;;;;;;;;;;; 929 | ; Module Settings ; 930 | ;;;;;;;;;;;;;;;;;;; 931 | 932 | [CLI Server] 933 | ; Whether the CLI web server uses ANSI color coding in its terminal output. 934 | cli_server.color = On 935 | 936 | [Date] 937 | ; Defines the default timezone used by the date functions 938 | ; http://php.net/date.timezone 939 | ;date.timezone = 940 | 941 | ; http://php.net/date.default-latitude 942 | ;date.default_latitude = 31.7667 943 | 944 | ; http://php.net/date.default-longitude 945 | ;date.default_longitude = 35.2333 946 | 947 | ; http://php.net/date.sunrise-zenith 948 | ;date.sunrise_zenith = 90.583333 949 | 950 | ; http://php.net/date.sunset-zenith 951 | ;date.sunset_zenith = 90.583333 952 | 953 | [filter] 954 | ; http://php.net/filter.default 955 | ;filter.default = unsafe_raw 956 | 957 | ; http://php.net/filter.default-flags 958 | ;filter.default_flags = 959 | 960 | [iconv] 961 | ; Use of this INI entry is deprecated, use global input_encoding instead. 962 | ; If empty, default_charset or input_encoding or iconv.input_encoding is used. 963 | ; The precedence is: default_charset < intput_encoding < iconv.input_encoding 964 | ;iconv.input_encoding = 965 | 966 | ; Use of this INI entry is deprecated, use global internal_encoding instead. 967 | ; If empty, default_charset or internal_encoding or iconv.internal_encoding is used. 968 | ; The precedence is: default_charset < internal_encoding < iconv.internal_encoding 969 | ;iconv.internal_encoding = 970 | 971 | ; Use of this INI entry is deprecated, use global output_encoding instead. 972 | ; If empty, default_charset or output_encoding or iconv.output_encoding is used. 973 | ; The precedence is: default_charset < output_encoding < iconv.output_encoding 974 | ; To use an output encoding conversion, iconv's output handler must be set 975 | ; otherwise output encoding conversion cannot be performed. 976 | ;iconv.output_encoding = 977 | 978 | [intl] 979 | ;intl.default_locale = 980 | ; This directive allows you to produce PHP errors when some error 981 | ; happens within intl functions. The value is the level of the error produced. 982 | ; Default is 0, which does not produce any errors. 983 | ;intl.error_level = E_WARNING 984 | ;intl.use_exceptions = 0 985 | 986 | [sqlite3] 987 | ;sqlite3.extension_dir = 988 | 989 | [Pcre] 990 | ;PCRE library backtracking limit. 991 | ; http://php.net/pcre.backtrack-limit 992 | ;pcre.backtrack_limit=100000 993 | 994 | ;PCRE library recursion limit. 995 | ;Please note that if you set this value to a high number you may consume all 996 | ;the available process stack and eventually crash PHP (due to reaching the 997 | ;stack size limit imposed by the Operating System). 998 | ; http://php.net/pcre.recursion-limit 999 | ;pcre.recursion_limit=100000 1000 | 1001 | ;Enables or disables JIT compilation of patterns. This requires the PCRE 1002 | ;library to be compiled with JIT support. 1003 | ;pcre.jit=1 1004 | 1005 | [Pdo] 1006 | ; Whether to pool ODBC connections. Can be one of "strict", "relaxed" or "off" 1007 | ; http://php.net/pdo-odbc.connection-pooling 1008 | ;pdo_odbc.connection_pooling=strict 1009 | 1010 | ;pdo_odbc.db2_instance_name 1011 | 1012 | [Pdo_mysql] 1013 | ; If mysqlnd is used: Number of cache slots for the internal result set cache 1014 | ; http://php.net/pdo_mysql.cache_size 1015 | pdo_mysql.cache_size = 2000 1016 | 1017 | ; Default socket name for local MySQL connects. If empty, uses the built-in 1018 | ; MySQL defaults. 1019 | ; http://php.net/pdo_mysql.default-socket 1020 | pdo_mysql.default_socket= 1021 | 1022 | [Phar] 1023 | ; http://php.net/phar.readonly 1024 | ;phar.readonly = On 1025 | 1026 | ; http://php.net/phar.require-hash 1027 | ;phar.require_hash = On 1028 | 1029 | ;phar.cache_list = 1030 | 1031 | [mail function] 1032 | ; For Win32 only. 1033 | ; http://php.net/smtp 1034 | SMTP = localhost 1035 | ; http://php.net/smtp-port 1036 | smtp_port = 25 1037 | 1038 | ; For Win32 only. 1039 | ; http://php.net/sendmail-from 1040 | ;sendmail_from = me@example.com 1041 | 1042 | ; For Unix only. You may supply arguments as well (default: "sendmail -t -i"). 1043 | ; http://php.net/sendmail-path 1044 | sendmail_path = /usr/sbin/sendmail -t -i 1045 | 1046 | ; Force the addition of the specified parameters to be passed as extra parameters 1047 | ; to the sendmail binary. These parameters will always replace the value of 1048 | ; the 5th parameter to mail(). 1049 | ;mail.force_extra_parameters = 1050 | 1051 | ; Add X-PHP-Originating-Script: that will include uid of the script followed by the filename 1052 | mail.add_x_header = On 1053 | 1054 | ; The path to a log file that will log all mail() calls. Log entries include 1055 | ; the full path of the script, line number, To address and headers. 1056 | ;mail.log = 1057 | ; Log mail to syslog (Event Log on Windows). 1058 | ;mail.log = syslog 1059 | 1060 | [ODBC] 1061 | ; http://php.net/odbc.default-db 1062 | ;odbc.default_db = Not yet implemented 1063 | 1064 | ; http://php.net/odbc.default-user 1065 | ;odbc.default_user = Not yet implemented 1066 | 1067 | ; http://php.net/odbc.default-pw 1068 | ;odbc.default_pw = Not yet implemented 1069 | 1070 | ; Controls the ODBC cursor model. 1071 | ; Default: SQL_CURSOR_STATIC (default). 1072 | ;odbc.default_cursortype 1073 | 1074 | ; Allow or prevent persistent links. 1075 | ; http://php.net/odbc.allow-persistent 1076 | odbc.allow_persistent = On 1077 | 1078 | ; Check that a connection is still valid before reuse. 1079 | ; http://php.net/odbc.check-persistent 1080 | odbc.check_persistent = On 1081 | 1082 | ; Maximum number of persistent links. -1 means no limit. 1083 | ; http://php.net/odbc.max-persistent 1084 | odbc.max_persistent = -1 1085 | 1086 | ; Maximum number of links (persistent + non-persistent). -1 means no limit. 1087 | ; http://php.net/odbc.max-links 1088 | odbc.max_links = -1 1089 | 1090 | ; Handling of LONG fields. Returns number of bytes to variables. 0 means 1091 | ; passthru. 1092 | ; http://php.net/odbc.defaultlrl 1093 | odbc.defaultlrl = 4096 1094 | 1095 | ; Handling of binary data. 0 means passthru, 1 return as is, 2 convert to char. 1096 | ; See the documentation on odbc_binmode and odbc_longreadlen for an explanation 1097 | ; of odbc.defaultlrl and odbc.defaultbinmode 1098 | ; http://php.net/odbc.defaultbinmode 1099 | odbc.defaultbinmode = 1 1100 | 1101 | ;birdstep.max_links = -1 1102 | 1103 | [Interbase] 1104 | ; Allow or prevent persistent links. 1105 | ibase.allow_persistent = 1 1106 | 1107 | ; Maximum number of persistent links. -1 means no limit. 1108 | ibase.max_persistent = -1 1109 | 1110 | ; Maximum number of links (persistent + non-persistent). -1 means no limit. 1111 | ibase.max_links = -1 1112 | 1113 | ; Default database name for ibase_connect(). 1114 | ;ibase.default_db = 1115 | 1116 | ; Default username for ibase_connect(). 1117 | ;ibase.default_user = 1118 | 1119 | ; Default password for ibase_connect(). 1120 | ;ibase.default_password = 1121 | 1122 | ; Default charset for ibase_connect(). 1123 | ;ibase.default_charset = 1124 | 1125 | ; Default timestamp format. 1126 | ibase.timestampformat = "%Y-%m-%d %H:%M:%S" 1127 | 1128 | ; Default date format. 1129 | ibase.dateformat = "%Y-%m-%d" 1130 | 1131 | ; Default time format. 1132 | ibase.timeformat = "%H:%M:%S" 1133 | 1134 | [MySQLi] 1135 | 1136 | ; Maximum number of persistent links. -1 means no limit. 1137 | ; http://php.net/mysqli.max-persistent 1138 | mysqli.max_persistent = -1 1139 | 1140 | ; Allow accessing, from PHP's perspective, local files with LOAD DATA statements 1141 | ; http://php.net/mysqli.allow_local_infile 1142 | ;mysqli.allow_local_infile = On 1143 | 1144 | ; Allow or prevent persistent links. 1145 | ; http://php.net/mysqli.allow-persistent 1146 | mysqli.allow_persistent = On 1147 | 1148 | ; Maximum number of links. -1 means no limit. 1149 | ; http://php.net/mysqli.max-links 1150 | mysqli.max_links = -1 1151 | 1152 | ; If mysqlnd is used: Number of cache slots for the internal result set cache 1153 | ; http://php.net/mysqli.cache_size 1154 | mysqli.cache_size = 2000 1155 | 1156 | ; Default port number for mysqli_connect(). If unset, mysqli_connect() will use 1157 | ; the $MYSQL_TCP_PORT or the mysql-tcp entry in /etc/services or the 1158 | ; compile-time value defined MYSQL_PORT (in that order). Win32 will only look 1159 | ; at MYSQL_PORT. 1160 | ; http://php.net/mysqli.default-port 1161 | mysqli.default_port = 3306 1162 | 1163 | ; Default socket name for local MySQL connects. If empty, uses the built-in 1164 | ; MySQL defaults. 1165 | ; http://php.net/mysqli.default-socket 1166 | mysqli.default_socket = 1167 | 1168 | ; Default host for mysql_connect() (doesn't apply in safe mode). 1169 | ; http://php.net/mysqli.default-host 1170 | mysqli.default_host = 1171 | 1172 | ; Default user for mysql_connect() (doesn't apply in safe mode). 1173 | ; http://php.net/mysqli.default-user 1174 | mysqli.default_user = 1175 | 1176 | ; Default password for mysqli_connect() (doesn't apply in safe mode). 1177 | ; Note that this is generally a *bad* idea to store passwords in this file. 1178 | ; *Any* user with PHP access can run 'echo get_cfg_var("mysqli.default_pw") 1179 | ; and reveal this password! And of course, any users with read access to this 1180 | ; file will be able to reveal the password as well. 1181 | ; http://php.net/mysqli.default-pw 1182 | mysqli.default_pw = 1183 | 1184 | ; Allow or prevent reconnect 1185 | mysqli.reconnect = Off 1186 | 1187 | [mysqlnd] 1188 | ; Enable / Disable collection of general statistics by mysqlnd which can be 1189 | ; used to tune and monitor MySQL operations. 1190 | ; http://php.net/mysqlnd.collect_statistics 1191 | mysqlnd.collect_statistics = On 1192 | 1193 | ; Enable / Disable collection of memory usage statistics by mysqlnd which can be 1194 | ; used to tune and monitor MySQL operations. 1195 | ; http://php.net/mysqlnd.collect_memory_statistics 1196 | mysqlnd.collect_memory_statistics = Off 1197 | 1198 | ; Records communication from all extensions using mysqlnd to the specified log 1199 | ; file. 1200 | ; http://php.net/mysqlnd.debug 1201 | ;mysqlnd.debug = 1202 | 1203 | ; Defines which queries will be logged. 1204 | ; http://php.net/mysqlnd.log_mask 1205 | ;mysqlnd.log_mask = 0 1206 | 1207 | ; Default size of the mysqlnd memory pool, which is used by result sets. 1208 | ; http://php.net/mysqlnd.mempool_default_size 1209 | ;mysqlnd.mempool_default_size = 16000 1210 | 1211 | ; Size of a pre-allocated buffer used when sending commands to MySQL in bytes. 1212 | ; http://php.net/mysqlnd.net_cmd_buffer_size 1213 | ;mysqlnd.net_cmd_buffer_size = 2048 1214 | 1215 | ; Size of a pre-allocated buffer used for reading data sent by the server in 1216 | ; bytes. 1217 | ; http://php.net/mysqlnd.net_read_buffer_size 1218 | ;mysqlnd.net_read_buffer_size = 32768 1219 | 1220 | ; Timeout for network requests in seconds. 1221 | ; http://php.net/mysqlnd.net_read_timeout 1222 | ;mysqlnd.net_read_timeout = 31536000 1223 | 1224 | ; SHA-256 Authentication Plugin related. File with the MySQL server public RSA 1225 | ; key. 1226 | ; http://php.net/mysqlnd.sha256_server_public_key 1227 | ;mysqlnd.sha256_server_public_key = 1228 | 1229 | [OCI8] 1230 | 1231 | ; Connection: Enables privileged connections using external 1232 | ; credentials (OCI_SYSOPER, OCI_SYSDBA) 1233 | ; http://php.net/oci8.privileged-connect 1234 | ;oci8.privileged_connect = Off 1235 | 1236 | ; Connection: The maximum number of persistent OCI8 connections per 1237 | ; process. Using -1 means no limit. 1238 | ; http://php.net/oci8.max-persistent 1239 | ;oci8.max_persistent = -1 1240 | 1241 | ; Connection: The maximum number of seconds a process is allowed to 1242 | ; maintain an idle persistent connection. Using -1 means idle 1243 | ; persistent connections will be maintained forever. 1244 | ; http://php.net/oci8.persistent-timeout 1245 | ;oci8.persistent_timeout = -1 1246 | 1247 | ; Connection: The number of seconds that must pass before issuing a 1248 | ; ping during oci_pconnect() to check the connection validity. When 1249 | ; set to 0, each oci_pconnect() will cause a ping. Using -1 disables 1250 | ; pings completely. 1251 | ; http://php.net/oci8.ping-interval 1252 | ;oci8.ping_interval = 60 1253 | 1254 | ; Connection: Set this to a user chosen connection class to be used 1255 | ; for all pooled server requests with Oracle 11g Database Resident 1256 | ; Connection Pooling (DRCP). To use DRCP, this value should be set to 1257 | ; the same string for all web servers running the same application, 1258 | ; the database pool must be configured, and the connection string must 1259 | ; specify to use a pooled server. 1260 | ;oci8.connection_class = 1261 | 1262 | ; High Availability: Using On lets PHP receive Fast Application 1263 | ; Notification (FAN) events generated when a database node fails. The 1264 | ; database must also be configured to post FAN events. 1265 | ;oci8.events = Off 1266 | 1267 | ; Tuning: This option enables statement caching, and specifies how 1268 | ; many statements to cache. Using 0 disables statement caching. 1269 | ; http://php.net/oci8.statement-cache-size 1270 | ;oci8.statement_cache_size = 20 1271 | 1272 | ; Tuning: Enables statement prefetching and sets the default number of 1273 | ; rows that will be fetched automatically after statement execution. 1274 | ; http://php.net/oci8.default-prefetch 1275 | ;oci8.default_prefetch = 100 1276 | 1277 | ; Compatibility. Using On means oci_close() will not close 1278 | ; oci_connect() and oci_new_connect() connections. 1279 | ; http://php.net/oci8.old-oci-close-semantics 1280 | ;oci8.old_oci_close_semantics = Off 1281 | 1282 | [PostgreSQL] 1283 | ; Allow or prevent persistent links. 1284 | ; http://php.net/pgsql.allow-persistent 1285 | pgsql.allow_persistent = On 1286 | 1287 | ; Detect broken persistent links always with pg_pconnect(). 1288 | ; Auto reset feature requires a little overheads. 1289 | ; http://php.net/pgsql.auto-reset-persistent 1290 | pgsql.auto_reset_persistent = Off 1291 | 1292 | ; Maximum number of persistent links. -1 means no limit. 1293 | ; http://php.net/pgsql.max-persistent 1294 | pgsql.max_persistent = -1 1295 | 1296 | ; Maximum number of links (persistent+non persistent). -1 means no limit. 1297 | ; http://php.net/pgsql.max-links 1298 | pgsql.max_links = -1 1299 | 1300 | ; Ignore PostgreSQL backends Notice message or not. 1301 | ; Notice message logging require a little overheads. 1302 | ; http://php.net/pgsql.ignore-notice 1303 | pgsql.ignore_notice = 0 1304 | 1305 | ; Log PostgreSQL backends Notice message or not. 1306 | ; Unless pgsql.ignore_notice=0, module cannot log notice message. 1307 | ; http://php.net/pgsql.log-notice 1308 | pgsql.log_notice = 0 1309 | 1310 | [bcmath] 1311 | ; Number of decimal digits for all bcmath functions. 1312 | ; http://php.net/bcmath.scale 1313 | bcmath.scale = 0 1314 | 1315 | [browscap] 1316 | ; http://php.net/browscap 1317 | ;browscap = extra/browscap.ini 1318 | 1319 | [Session] 1320 | ; Handler used to store/retrieve data. 1321 | ; http://php.net/session.save-handler 1322 | session.save_handler = files 1323 | 1324 | ; Argument passed to save_handler. In the case of files, this is the path 1325 | ; where data files are stored. Note: Windows users have to change this 1326 | ; variable in order to use PHP's session functions. 1327 | ; 1328 | ; The path can be defined as: 1329 | ; 1330 | ; session.save_path = "N;/path" 1331 | ; 1332 | ; where N is an integer. Instead of storing all the session files in 1333 | ; /path, what this will do is use subdirectories N-levels deep, and 1334 | ; store the session data in those directories. This is useful if 1335 | ; your OS has problems with many files in one directory, and is 1336 | ; a more efficient layout for servers that handle many sessions. 1337 | ; 1338 | ; NOTE 1: PHP will not create this directory structure automatically. 1339 | ; You can use the script in the ext/session dir for that purpose. 1340 | ; NOTE 2: See the section on garbage collection below if you choose to 1341 | ; use subdirectories for session storage 1342 | ; 1343 | ; The file storage module creates files using mode 600 by default. 1344 | ; You can change that by using 1345 | ; 1346 | ; session.save_path = "N;MODE;/path" 1347 | ; 1348 | ; where MODE is the octal representation of the mode. Note that this 1349 | ; does not overwrite the process's umask. 1350 | ; http://php.net/session.save-path 1351 | ;session.save_path = "/tmp" 1352 | 1353 | ; Whether to use strict session mode. 1354 | ; Strict session mode does not accept uninitialized session ID and regenerate 1355 | ; session ID if browser sends uninitialized session ID. Strict mode protects 1356 | ; applications from session fixation via session adoption vulnerability. It is 1357 | ; disabled by default for maximum compatibility, but enabling it is encouraged. 1358 | ; https://wiki.php.net/rfc/strict_sessions 1359 | session.use_strict_mode = 0 1360 | 1361 | ; Whether to use cookies. 1362 | ; http://php.net/session.use-cookies 1363 | session.use_cookies = 1 1364 | 1365 | ; http://php.net/session.cookie-secure 1366 | ;session.cookie_secure = 1367 | 1368 | ; This option forces PHP to fetch and use a cookie for storing and maintaining 1369 | ; the session id. We encourage this operation as it's very helpful in combating 1370 | ; session hijacking when not specifying and managing your own session id. It is 1371 | ; not the be-all and end-all of session hijacking defense, but it's a good start. 1372 | ; http://php.net/session.use-only-cookies 1373 | session.use_only_cookies = 1 1374 | 1375 | ; Name of the session (used as cookie name). 1376 | ; http://php.net/session.name 1377 | session.name = PHPSESSID 1378 | 1379 | ; Initialize session on request startup. 1380 | ; http://php.net/session.auto-start 1381 | session.auto_start = 0 1382 | 1383 | ; Lifetime in seconds of cookie or, if 0, until browser is restarted. 1384 | ; http://php.net/session.cookie-lifetime 1385 | session.cookie_lifetime = 0 1386 | 1387 | ; The path for which the cookie is valid. 1388 | ; http://php.net/session.cookie-path 1389 | session.cookie_path = / 1390 | 1391 | ; The domain for which the cookie is valid. 1392 | ; http://php.net/session.cookie-domain 1393 | session.cookie_domain = 1394 | 1395 | ; Whether or not to add the httpOnly flag to the cookie, which makes it inaccessible to browser scripting languages such as JavaScript. 1396 | ; http://php.net/session.cookie-httponly 1397 | session.cookie_httponly = 1398 | 1399 | ; Handler used to serialize data. php is the standard serializer of PHP. 1400 | ; http://php.net/session.serialize-handler 1401 | session.serialize_handler = php 1402 | 1403 | ; Defines the probability that the 'garbage collection' process is started 1404 | ; on every session initialization. The probability is calculated by using 1405 | ; gc_probability/gc_divisor. Where session.gc_probability is the numerator 1406 | ; and gc_divisor is the denominator in the equation. Setting this value to 1 1407 | ; when the session.gc_divisor value is 100 will give you approximately a 1% chance 1408 | ; the gc will run on any give request. 1409 | ; Default Value: 1 1410 | ; Development Value: 1 1411 | ; Production Value: 1 1412 | ; http://php.net/session.gc-probability 1413 | session.gc_probability = 1 1414 | 1415 | ; Defines the probability that the 'garbage collection' process is started on every 1416 | ; session initialization. The probability is calculated by using the following equation: 1417 | ; gc_probability/gc_divisor. Where session.gc_probability is the numerator and 1418 | ; session.gc_divisor is the denominator in the equation. Setting this value to 1 1419 | ; when the session.gc_divisor value is 100 will give you approximately a 1% chance 1420 | ; the gc will run on any give request. Increasing this value to 1000 will give you 1421 | ; a 0.1% chance the gc will run on any give request. For high volume production servers, 1422 | ; this is a more efficient approach. 1423 | ; Default Value: 100 1424 | ; Development Value: 1000 1425 | ; Production Value: 1000 1426 | ; http://php.net/session.gc-divisor 1427 | session.gc_divisor = 1000 1428 | 1429 | ; After this number of seconds, stored data will be seen as 'garbage' and 1430 | ; cleaned up by the garbage collection process. 1431 | ; http://php.net/session.gc-maxlifetime 1432 | session.gc_maxlifetime = 1440 1433 | 1434 | ; NOTE: If you are using the subdirectory option for storing session files 1435 | ; (see session.save_path above), then garbage collection does *not* 1436 | ; happen automatically. You will need to do your own garbage 1437 | ; collection through a shell script, cron entry, or some other method. 1438 | ; For example, the following script would is the equivalent of 1439 | ; setting session.gc_maxlifetime to 1440 (1440 seconds = 24 minutes): 1440 | ; find /path/to/sessions -cmin +24 -type f | xargs rm 1441 | 1442 | ; Check HTTP Referer to invalidate externally stored URLs containing ids. 1443 | ; HTTP_REFERER has to contain this substring for the session to be 1444 | ; considered as valid. 1445 | ; http://php.net/session.referer-check 1446 | session.referer_check = 1447 | 1448 | ; Set to {nocache,private,public,} to determine HTTP caching aspects 1449 | ; or leave this empty to avoid sending anti-caching headers. 1450 | ; http://php.net/session.cache-limiter 1451 | session.cache_limiter = nocache 1452 | 1453 | ; Document expires after n minutes. 1454 | ; http://php.net/session.cache-expire 1455 | session.cache_expire = 180 1456 | 1457 | ; trans sid support is disabled by default. 1458 | ; Use of trans sid may risk your users' security. 1459 | ; Use this option with caution. 1460 | ; - User may send URL contains active session ID 1461 | ; to other person via. email/irc/etc. 1462 | ; - URL that contains active session ID may be stored 1463 | ; in publicly accessible computer. 1464 | ; - User may access your site with the same session ID 1465 | ; always using URL stored in browser's history or bookmarks. 1466 | ; http://php.net/session.use-trans-sid 1467 | session.use_trans_sid = 0 1468 | 1469 | ; Set session ID character length. This value could be between 22 to 256. 1470 | ; Shorter length than default is supported only for compatibility reason. 1471 | ; Users should use 32 or more chars. 1472 | ; http://php.net/session.sid-length 1473 | ; Default Value: 32 1474 | ; Development Value: 26 1475 | ; Production Value: 26 1476 | session.sid_length = 26 1477 | 1478 | ; The URL rewriter will look for URLs in a defined set of HTML tags. 1479 | ;
is special; if you include them here, the rewriter will 1480 | ; add a hidden field with the info which is otherwise appended 1481 | ; to URLs. tag's action attribute URL will not be modified 1482 | ; unless it is specified. 1483 | ; Note that all valid entries require a "=", even if no value follows. 1484 | ; Default Value: "a=href,area=href,frame=src,form=" 1485 | ; Development Value: "a=href,area=href,frame=src,form=" 1486 | ; Production Value: "a=href,area=href,frame=src,form=" 1487 | ; http://php.net/url-rewriter.tags 1488 | session.trans_sid_tags = "a=href,area=href,frame=src,form=" 1489 | 1490 | ; URL rewriter does not rewrite absolute URLs by default. 1491 | ; To enable rewrites for absolute pathes, target hosts must be specified 1492 | ; at RUNTIME. i.e. use ini_set() 1493 | ; tags is special. PHP will check action attribute's URL regardless 1494 | ; of session.trans_sid_tags setting. 1495 | ; If no host is defined, HTTP_HOST will be used for allowed host. 1496 | ; Example value: php.net,www.php.net,wiki.php.net 1497 | ; Use "," for multiple hosts. No spaces are allowed. 1498 | ; Default Value: "" 1499 | ; Development Value: "" 1500 | ; Production Value: "" 1501 | ;session.trans_sid_hosts="" 1502 | 1503 | ; Define how many bits are stored in each character when converting 1504 | ; the binary hash data to something readable. 1505 | ; Possible values: 1506 | ; 4 (4 bits: 0-9, a-f) 1507 | ; 5 (5 bits: 0-9, a-v) 1508 | ; 6 (6 bits: 0-9, a-z, A-Z, "-", ",") 1509 | ; Default Value: 4 1510 | ; Development Value: 5 1511 | ; Production Value: 5 1512 | ; http://php.net/session.hash-bits-per-character 1513 | session.sid_bits_per_character = 5 1514 | 1515 | ; Enable upload progress tracking in $_SESSION 1516 | ; Default Value: On 1517 | ; Development Value: On 1518 | ; Production Value: On 1519 | ; http://php.net/session.upload-progress.enabled 1520 | ;session.upload_progress.enabled = On 1521 | 1522 | ; Cleanup the progress information as soon as all POST data has been read 1523 | ; (i.e. upload completed). 1524 | ; Default Value: On 1525 | ; Development Value: On 1526 | ; Production Value: On 1527 | ; http://php.net/session.upload-progress.cleanup 1528 | ;session.upload_progress.cleanup = On 1529 | 1530 | ; A prefix used for the upload progress key in $_SESSION 1531 | ; Default Value: "upload_progress_" 1532 | ; Development Value: "upload_progress_" 1533 | ; Production Value: "upload_progress_" 1534 | ; http://php.net/session.upload-progress.prefix 1535 | ;session.upload_progress.prefix = "upload_progress_" 1536 | 1537 | ; The index name (concatenated with the prefix) in $_SESSION 1538 | ; containing the upload progress information 1539 | ; Default Value: "PHP_SESSION_UPLOAD_PROGRESS" 1540 | ; Development Value: "PHP_SESSION_UPLOAD_PROGRESS" 1541 | ; Production Value: "PHP_SESSION_UPLOAD_PROGRESS" 1542 | ; http://php.net/session.upload-progress.name 1543 | ;session.upload_progress.name = "PHP_SESSION_UPLOAD_PROGRESS" 1544 | 1545 | ; How frequently the upload progress should be updated. 1546 | ; Given either in percentages (per-file), or in bytes 1547 | ; Default Value: "1%" 1548 | ; Development Value: "1%" 1549 | ; Production Value: "1%" 1550 | ; http://php.net/session.upload-progress.freq 1551 | ;session.upload_progress.freq = "1%" 1552 | 1553 | ; The minimum delay between updates, in seconds 1554 | ; Default Value: 1 1555 | ; Development Value: 1 1556 | ; Production Value: 1 1557 | ; http://php.net/session.upload-progress.min-freq 1558 | ;session.upload_progress.min_freq = "1" 1559 | 1560 | ; Only write session data when session data is changed. Enabled by default. 1561 | ; http://php.net/session.lazy-write 1562 | ;session.lazy_write = On 1563 | 1564 | [Assertion] 1565 | ; Switch whether to compile assertions at all (to have no overhead at run-time) 1566 | ; -1: Do not compile at all 1567 | ; 0: Jump over assertion at run-time 1568 | ; 1: Execute assertions 1569 | ; Changing from or to a negative value is only possible in php.ini! (For turning assertions on and off at run-time, see assert.active, when zend.assertions = 1) 1570 | ; Default Value: 1 1571 | ; Development Value: 1 1572 | ; Production Value: -1 1573 | ; http://php.net/zend.assertions 1574 | zend.assertions = -1 1575 | 1576 | ; Assert(expr); active by default. 1577 | ; http://php.net/assert.active 1578 | ;assert.active = On 1579 | 1580 | ; Throw an AssertationException on failed assertions 1581 | ; http://php.net/assert.exception 1582 | ;assert.exception = On 1583 | 1584 | ; Issue a PHP warning for each failed assertion. (Overridden by assert.exception if active) 1585 | ; http://php.net/assert.warning 1586 | ;assert.warning = On 1587 | 1588 | ; Don't bail out by default. 1589 | ; http://php.net/assert.bail 1590 | ;assert.bail = Off 1591 | 1592 | ; User-function to be called if an assertion fails. 1593 | ; http://php.net/assert.callback 1594 | ;assert.callback = 0 1595 | 1596 | ; Eval the expression with current error_reporting(). Set to true if you want 1597 | ; error_reporting(0) around the eval(). 1598 | ; http://php.net/assert.quiet-eval 1599 | ;assert.quiet_eval = 0 1600 | 1601 | [COM] 1602 | ; path to a file containing GUIDs, IIDs or filenames of files with TypeLibs 1603 | ; http://php.net/com.typelib-file 1604 | ;com.typelib_file = 1605 | 1606 | ; allow Distributed-COM calls 1607 | ; http://php.net/com.allow-dcom 1608 | ;com.allow_dcom = true 1609 | 1610 | ; autoregister constants of a components typlib on com_load() 1611 | ; http://php.net/com.autoregister-typelib 1612 | ;com.autoregister_typelib = true 1613 | 1614 | ; register constants casesensitive 1615 | ; http://php.net/com.autoregister-casesensitive 1616 | ;com.autoregister_casesensitive = false 1617 | 1618 | ; show warnings on duplicate constant registrations 1619 | ; http://php.net/com.autoregister-verbose 1620 | ;com.autoregister_verbose = true 1621 | 1622 | ; The default character set code-page to use when passing strings to and from COM objects. 1623 | ; Default: system ANSI code page 1624 | ;com.code_page= 1625 | 1626 | [mbstring] 1627 | ; language for internal character representation. 1628 | ; This affects mb_send_mail() and mbstring.detect_order. 1629 | ; http://php.net/mbstring.language 1630 | ;mbstring.language = Japanese 1631 | 1632 | ; Use of this INI entry is deprecated, use global internal_encoding instead. 1633 | ; internal/script encoding. 1634 | ; Some encoding cannot work as internal encoding. (e.g. SJIS, BIG5, ISO-2022-*) 1635 | ; If empty, default_charset or internal_encoding or iconv.internal_encoding is used. 1636 | ; The precedence is: default_charset < internal_encoding < iconv.internal_encoding 1637 | ;mbstring.internal_encoding = 1638 | 1639 | ; Use of this INI entry is deprecated, use global input_encoding instead. 1640 | ; http input encoding. 1641 | ; mbstring.encoding_traslation = On is needed to use this setting. 1642 | ; If empty, default_charset or input_encoding or mbstring.input is used. 1643 | ; The precedence is: default_charset < intput_encoding < mbsting.http_input 1644 | ; http://php.net/mbstring.http-input 1645 | ;mbstring.http_input = 1646 | 1647 | ; Use of this INI entry is deprecated, use global output_encoding instead. 1648 | ; http output encoding. 1649 | ; mb_output_handler must be registered as output buffer to function. 1650 | ; If empty, default_charset or output_encoding or mbstring.http_output is used. 1651 | ; The precedence is: default_charset < output_encoding < mbstring.http_output 1652 | ; To use an output encoding conversion, mbstring's output handler must be set 1653 | ; otherwise output encoding conversion cannot be performed. 1654 | ; http://php.net/mbstring.http-output 1655 | ;mbstring.http_output = 1656 | 1657 | ; enable automatic encoding translation according to 1658 | ; mbstring.internal_encoding setting. Input chars are 1659 | ; converted to internal encoding by setting this to On. 1660 | ; Note: Do _not_ use automatic encoding translation for 1661 | ; portable libs/applications. 1662 | ; http://php.net/mbstring.encoding-translation 1663 | ;mbstring.encoding_translation = Off 1664 | 1665 | ; automatic encoding detection order. 1666 | ; "auto" detect order is changed according to mbstring.language 1667 | ; http://php.net/mbstring.detect-order 1668 | ;mbstring.detect_order = auto 1669 | 1670 | ; substitute_character used when character cannot be converted 1671 | ; one from another 1672 | ; http://php.net/mbstring.substitute-character 1673 | ;mbstring.substitute_character = none 1674 | 1675 | ; overload(replace) single byte functions by mbstring functions. 1676 | ; mail(), ereg(), etc are overloaded by mb_send_mail(), mb_ereg(), 1677 | ; etc. Possible values are 0,1,2,4 or combination of them. 1678 | ; For example, 7 for overload everything. 1679 | ; 0: No overload 1680 | ; 1: Overload mail() function 1681 | ; 2: Overload str*() functions 1682 | ; 4: Overload ereg*() functions 1683 | ; http://php.net/mbstring.func-overload 1684 | ;mbstring.func_overload = 0 1685 | 1686 | ; enable strict encoding detection. 1687 | ; Default: Off 1688 | ;mbstring.strict_detection = On 1689 | 1690 | ; This directive specifies the regex pattern of content types for which mb_output_handler() 1691 | ; is activated. 1692 | ; Default: mbstring.http_output_conv_mimetype=^(text/|application/xhtml\+xml) 1693 | ;mbstring.http_output_conv_mimetype= 1694 | 1695 | [gd] 1696 | ; Tell the jpeg decode to ignore warnings and try to create 1697 | ; a gd image. The warning will then be displayed as notices 1698 | ; disabled by default 1699 | ; http://php.net/gd.jpeg-ignore-warning 1700 | ;gd.jpeg_ignore_warning = 1 1701 | 1702 | [exif] 1703 | ; Exif UNICODE user comments are handled as UCS-2BE/UCS-2LE and JIS as JIS. 1704 | ; With mbstring support this will automatically be converted into the encoding 1705 | ; given by corresponding encode setting. When empty mbstring.internal_encoding 1706 | ; is used. For the decode settings you can distinguish between motorola and 1707 | ; intel byte order. A decode setting cannot be empty. 1708 | ; http://php.net/exif.encode-unicode 1709 | ;exif.encode_unicode = ISO-8859-15 1710 | 1711 | ; http://php.net/exif.decode-unicode-motorola 1712 | ;exif.decode_unicode_motorola = UCS-2BE 1713 | 1714 | ; http://php.net/exif.decode-unicode-intel 1715 | ;exif.decode_unicode_intel = UCS-2LE 1716 | 1717 | ; http://php.net/exif.encode-jis 1718 | ;exif.encode_jis = 1719 | 1720 | ; http://php.net/exif.decode-jis-motorola 1721 | ;exif.decode_jis_motorola = JIS 1722 | 1723 | ; http://php.net/exif.decode-jis-intel 1724 | ;exif.decode_jis_intel = JIS 1725 | 1726 | [Tidy] 1727 | ; The path to a default tidy configuration file to use when using tidy 1728 | ; http://php.net/tidy.default-config 1729 | ;tidy.default_config = /usr/local/lib/php/default.tcfg 1730 | 1731 | ; Should tidy clean and repair output automatically? 1732 | ; WARNING: Do not use this option if you are generating non-html content 1733 | ; such as dynamic images 1734 | ; http://php.net/tidy.clean-output 1735 | tidy.clean_output = Off 1736 | 1737 | [soap] 1738 | ; Enables or disables WSDL caching feature. 1739 | ; http://php.net/soap.wsdl-cache-enabled 1740 | soap.wsdl_cache_enabled=1 1741 | 1742 | ; Sets the directory name where SOAP extension will put cache files. 1743 | ; http://php.net/soap.wsdl-cache-dir 1744 | soap.wsdl_cache_dir="/tmp" 1745 | 1746 | ; (time to live) Sets the number of second while cached file will be used 1747 | ; instead of original one. 1748 | ; http://php.net/soap.wsdl-cache-ttl 1749 | soap.wsdl_cache_ttl=86400 1750 | 1751 | ; Sets the size of the cache limit. (Max. number of WSDL files to cache) 1752 | soap.wsdl_cache_limit = 5 1753 | 1754 | [sysvshm] 1755 | ; A default size of the shared memory segment 1756 | ;sysvshm.init_mem = 10000 1757 | 1758 | [ldap] 1759 | ; Sets the maximum number of open links or -1 for unlimited. 1760 | ldap.max_links = -1 1761 | 1762 | [dba] 1763 | ;dba.default_handler= 1764 | 1765 | [opcache] 1766 | ; Determines if Zend OPCache is enabled 1767 | opcache.enable=1 1768 | 1769 | ; Determines if Zend OPCache is enabled for the CLI version of PHP 1770 | opcache.enable_cli=1 1771 | 1772 | ; The OPcache shared memory storage size. 1773 | opcache.memory_consumption=16 1774 | 1775 | ; The amount of memory for interned strings in Mbytes. 1776 | opcache.interned_strings_buffer=2 1777 | 1778 | ; The maximum number of keys (scripts) in the OPcache hash table. 1779 | ; Only numbers between 200 and 1000000 are allowed. 1780 | opcache.max_accelerated_files=100000 1781 | 1782 | ; The maximum percentage of "wasted" memory until a restart is scheduled. 1783 | opcache.max_wasted_percentage=10 1784 | 1785 | ; When this directive is enabled, the OPcache appends the current working 1786 | ; directory to the script key, thus eliminating possible collisions between 1787 | ; files with the same name (basename). Disabling the directive improves 1788 | ; performance, but may break existing applications. 1789 | opcache.use_cwd=1 1790 | 1791 | ; When disabled, you must reset the OPcache manually or restart the 1792 | ; webserver for changes to the filesystem to take effect. 1793 | opcache.validate_timestamps=0 1794 | 1795 | ; How often (in seconds) to check file timestamps for changes to the shared 1796 | ; memory storage allocation. ("1" means validate once per second, but only 1797 | ; once per request. "0" means always validate) 1798 | ;opcache.revalidate_freq=2 1799 | 1800 | ; Enables or disables file search in include_path optimization 1801 | ;opcache.revalidate_path=0 1802 | 1803 | ; If disabled, all PHPDoc comments are dropped from the code to reduce the 1804 | ; size of the optimized code. 1805 | opcache.save_comments=1 1806 | 1807 | ; If enabled, a fast shutdown sequence is used for the accelerated code 1808 | ; Depending on the used Memory Manager this may cause some incompatibilities. 1809 | ;opcache.fast_shutdown=0 1810 | 1811 | ; Allow file existence override (file_exists, etc.) performance feature. 1812 | opcache.enable_file_override=1 1813 | 1814 | ; A bitmask, where each bit enables or disables the appropriate OPcache 1815 | ; passes 1816 | ;opcache.optimization_level=0xffffffff 1817 | 1818 | ;opcache.inherited_hack=1 1819 | ;opcache.dups_fix=0 1820 | 1821 | ; The location of the OPcache blacklist file (wildcards allowed). 1822 | ; Each OPcache blacklist file is a text file that holds the names of files 1823 | ; that should not be accelerated. The file format is to add each filename 1824 | ; to a new line. The filename may be a full path or just a file prefix 1825 | ; (i.e., /var/www/x blacklists all the files and directories in /var/www 1826 | ; that start with 'x'). Line starting with a ; are ignored (comments). 1827 | ;opcache.blacklist_filename= 1828 | 1829 | ; Allows exclusion of large files from being cached. By default all files 1830 | ; are cached. 1831 | ;opcache.max_file_size=0 1832 | 1833 | ; Check the cache checksum each N requests. 1834 | ; The default value of "0" means that the checks are disabled. 1835 | ;opcache.consistency_checks=0 1836 | 1837 | ; How long to wait (in seconds) for a scheduled restart to begin if the cache 1838 | ; is not being accessed. 1839 | ;opcache.force_restart_timeout=180 1840 | 1841 | ; OPcache error_log file name. Empty string assumes "stderr". 1842 | ;opcache.error_log= 1843 | 1844 | ; All OPcache errors go to the Web server log. 1845 | ; By default, only fatal errors (level 0) or errors (level 1) are logged. 1846 | ; You can also enable warnings (level 2), info messages (level 3) or 1847 | ; debug messages (level 4). 1848 | ;opcache.log_verbosity_level=1 1849 | 1850 | ; Preferred Shared Memory back-end. Leave empty and let the system decide. 1851 | ;opcache.preferred_memory_model= 1852 | 1853 | ; Protect the shared memory from unexpected writing during script execution. 1854 | ; Useful for internal debugging only. 1855 | ;opcache.protect_memory=0 1856 | 1857 | ; Allows calling OPcache API functions only from PHP scripts which path is 1858 | ; started from specified string. The default "" means no restriction 1859 | ;opcache.restrict_api= 1860 | 1861 | ; Mapping base of shared memory segments (for Windows only). All the PHP 1862 | ; processes have to map shared memory into the same address space. This 1863 | ; directive allows to manually fix the "Unable to reattach to base address" 1864 | ; errors. 1865 | ;opcache.mmap_base= 1866 | 1867 | ; Enables and sets the second level cache directory. 1868 | ; It should improve performance when SHM memory is full, at server restart or 1869 | ; SHM reset. The default "" disables file based caching. 1870 | ;opcache.file_cache= 1871 | 1872 | ; Enables or disables opcode caching in shared memory. 1873 | ;opcache.file_cache_only=0 1874 | 1875 | ; Enables or disables checksum validation when script loaded from file cache. 1876 | ;opcache.file_cache_consistency_checks=1 1877 | 1878 | ; Implies opcache.file_cache_only=1 for a certain process that failed to 1879 | ; reattach to the shared memory (for Windows only). Explicitly enabled file 1880 | ; cache is required. 1881 | ;opcache.file_cache_fallback=1 1882 | 1883 | ; Enables or disables copying of PHP code (text segment) into HUGE PAGES. 1884 | ; This should improve performance, but requires appropriate OS configuration. 1885 | ;opcache.huge_code_pages=1 1886 | 1887 | ; Validate cached file permissions. 1888 | ;opcache.validate_permission=0 1889 | 1890 | ; Prevent name collisions in chroot'ed environment. 1891 | ;opcache.validate_root=0 1892 | 1893 | [curl] 1894 | ; A default value for the CURLOPT_CAINFO option. This is required to be an 1895 | ; absolute path. 1896 | ;curl.cainfo = 1897 | 1898 | [openssl] 1899 | ; The location of a Certificate Authority (CA) file on the local filesystem 1900 | ; to use when verifying the identity of SSL/TLS peers. Most users should 1901 | ; not specify a value for this directive as PHP will attempt to use the 1902 | ; OS-managed cert stores in its absence. If specified, this value may still 1903 | ; be overridden on a per-stream basis via the "cafile" SSL stream context 1904 | ; option. 1905 | ;openssl.cafile= 1906 | 1907 | ; If openssl.cafile is not specified or if the CA file is not found, the 1908 | ; directory pointed to by openssl.capath is searched for a suitable 1909 | ; certificate. This value must be a correctly hashed certificate directory. 1910 | ; Most users should not specify a value for this directive as PHP will 1911 | ; attempt to use the OS-managed cert stores in its absence. If specified, 1912 | ; this value may still be overridden on a per-stream basis via the "capath" 1913 | ; SSL stream context option. 1914 | ;openssl.capath= 1915 | 1916 | ; Local Variables: 1917 | ; tab-width: 4 1918 | ; End: 1919 | -------------------------------------------------------------------------------- /conf/supervisor.d/cron.conf: -------------------------------------------------------------------------------- 1 | [program:cron] 2 | command=/usr/sbin/crond -f -c /etc/cron.d 3 | autostart=true 4 | autorestart=true 5 | priority=15 6 | stdout_events_enabled=true 7 | stderr_events_enabled=true 8 | stdout_logfile=/dev/stdout 9 | stdout_logfile_maxbytes=0 10 | stderr_logfile=/dev/stderr 11 | stderr_logfile_maxbytes=0 -------------------------------------------------------------------------------- /conf/supervisor.d/nginx.conf: -------------------------------------------------------------------------------- 1 | [program:nginx] 2 | command=/usr/sbin/nginx 3 | autostart=true 4 | autorestart=true 5 | priority=10 6 | stdout_events_enabled=true 7 | stderr_events_enabled=true 8 | stdout_logfile=/dev/stdout 9 | stdout_logfile_maxbytes=0 10 | stderr_logfile=/dev/stderr 11 | stderr_logfile_maxbytes=0 -------------------------------------------------------------------------------- /conf/supervisor.d/php-fpm.conf: -------------------------------------------------------------------------------- 1 | [program:php-fpm] 2 | command = /usr/bin/php-fpm --nodaemonize --fpm-config /etc/php/php-fpm.conf 3 | autostart=true 4 | autorestart=true 5 | priority=5 6 | stdout_logfile=/dev/stdout 7 | stdout_logfile_maxbytes=0 8 | stderr_logfile=/dev/stderr 9 | stderr_logfile_maxbytes=0 -------------------------------------------------------------------------------- /conf/supervisord.conf: -------------------------------------------------------------------------------- 1 | [supervisord] 2 | logfile=/tmp/supervisord.log ; (main log file;default $CWD/supervisord.log) 3 | logfile_maxbytes=50MB ; (max main logfile bytes b4 rotation;default 50MB) 4 | logfile_backups=10 ; (num of main logfile rotation backups;default 10) 5 | loglevel=info ; (log level;default info; others: debug,warn,trace) 6 | pidfile=/run/supervisord.pid ; (supervisord pidfile;default supervisord.pid) 7 | nodaemon=true ; (start in foreground if true;default false) 8 | minfds=1024 ; (min. avail startup file descriptors;default 1024) 9 | minprocs=200 ; (min. avail process descriptors;default 200) 10 | user=root ; 11 | 12 | [include] 13 | files = /etc/supervisord-enabled/*.conf 14 | 15 | [inet_http_server] 16 | port = 9001 17 | 18 | [supervisorctl] 19 | serverurl = http://127.0.0.1:9001 20 | 21 | [rpcinterface:supervisor] 22 | supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface 23 | 24 | -------------------------------------------------------------------------------- /dependencies/nginx-custom.php: -------------------------------------------------------------------------------- 1 | #!/usr/bin/php 2 | 3 | -------------------------------------------------------------------------------- /dependencies/nginx-vts-exporter: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/parallax/prlx-nginx-php-fpm/73b1e4460b28c4aa1da1dd744a6b9348a48a401f/dependencies/nginx-vts-exporter -------------------------------------------------------------------------------- /dependencies/php-fpm-exporter.linux.amd64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/parallax/prlx-nginx-php-fpm/73b1e4460b28c4aa1da1dd744a6b9348a48a401f/dependencies/php-fpm-exporter.linux.amd64 -------------------------------------------------------------------------------- /examples/hello-world/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM prlx/prlx-nginx-php-fpm:7.1 2 | 3 | ADD /src /src/public 4 | -------------------------------------------------------------------------------- /examples/hello-world/src/index.php: -------------------------------------------------------------------------------- 1 | It works! Running PHP -------------------------------------------------------------------------------- /healthz.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /scripts/healthcheck.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | import xmlrpclib 4 | server = xmlrpclib.Server('http://localhost:9001/RPC2') 5 | 6 | print(server.supervisor.getAllProcessInfo()) -------------------------------------------------------------------------------- /scripts/start-web.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | printf "\033[1;1m ____ __ ____ __ __ __ __ _ _ 4 | ( _ \ /__\ ( _ \ /__\ ( ) ( ) /__\ ( \/ ) 5 | )___//(__)\ ) / /(__)\ )(__ )(__ /(__)\ ) ( 6 | (__) (__)(__)(_)\_)(__)(__)(____)(____)(__)(__)(_/\_)\033[0m\n" 7 | 8 | printf "\n\033[1;1mRunning Nginx PHP-FPM web mode\033[0m\n\n" 9 | 10 | # printf "%-30s %-30s\n" "Key" "Value" 11 | 12 | # Container info: 13 | printf "%-30s %-30s\n" "Site:" "$SITE_NAME" 14 | printf "%-30s %-30s\n" "Branch:" "$SITE_BRANCH" 15 | printf "%-30s %-30s\n" "Environment:" "$ENVIRONMENT" 16 | 17 | # Enable Nginx 18 | cp /etc/supervisor.d/nginx.conf /etc/supervisord-enabled/ 19 | 20 | # Enable PHP-FPM 21 | cp /etc/supervisor.d/php-fpm.conf /etc/supervisord-enabled/ 22 | 23 | # Atatus - if api key is set then configure and enable 24 | if [ ! -z "$ATATUS_APM_LICENSE_KEY" ]; then 25 | 26 | # Enabled 27 | printf "%-30s %-30s\n" "Atatus:" "Enabled" 28 | 29 | # Set the atatus api key 30 | sed -i -e "s/atatus.license_key = \"\"/atatus.license_key = \"$ATATUS_APM_LICENSE_KEY\"/g" /etc/php/conf.d/atatus.ini 31 | 32 | # Set the release stage to be the environment 33 | sed -i -e "s/atatus.release_stage = \"production\"/atatus.release_stage = \"$ENVIRONMENT\"/g" /etc/php/conf.d/atatus.ini 34 | 35 | # Set the app name to be site_name environment 36 | sed -i -e "s/atatus.app_name = \"PHP App\"/atatus.app_name = \"$SITE_NAME\"/g" /etc/php/conf.d/atatus.ini 37 | 38 | # Set the app version to be the branch build 39 | sed -i -e "s/atatus.app_version = \"\"/atatus.app_version = \"$SITE_BRANCH-$BUILD\"/g" /etc/php/conf.d/atatus.ini 40 | 41 | # Set the tags to contain useful data 42 | sed -i -e "s/atatus.tags = \"\"/atatus.tags = \"$SITE_BRANCH-$BUILD, $SITE_BRANCH\"/g" /etc/php/conf.d/atatus.ini 43 | 44 | fi 45 | 46 | # Atatus - if api key is not set then disable 47 | if [ -z "$ATATUS_APM_LICENSE_KEY" ]; then 48 | 49 | # Disabled 50 | printf "%-30s %-30s\n" "Atatus:" "Disabled" 51 | rm -f /etc/php/conf.d/atatus.ini 52 | 53 | fi 54 | 55 | # Atatus - configure raw sql logs if desirable 56 | if [ ! -z "$ATATUS_APM_RAW_SQL" ]; then 57 | 58 | # Enabled 59 | printf "%-30s %-30s\n" "Atatus SQL:" "Raw" 60 | 61 | # Set the atatus api key 62 | sed -i -e "s/atatus.sql.capture = \"normalized\"/atatus.sql.capture = \"raw\"/g" /etc/php/conf.d/atatus.ini 63 | 64 | fi 65 | 66 | # Atatus - configure laravel queues if desirable 67 | if [ ! -z "$ATATUS_APM_LARAVEL_QUEUES" ]; then 68 | 69 | # Enabled 70 | printf "%-30s %-30s\n" "Atatus Laravel Queues:" "Yes" 71 | 72 | # Set the atatus api key 73 | sed -i -e "s/atatus.laravel.enable_queues = false/atatus.laravel.enable_queues = true/g" /etc/php/conf.d/atatus.ini 74 | 75 | fi 76 | 77 | # Whether to send cache headers automatically for PHP scripts 78 | if [ ! -z "$PHP_DISABLE_CACHE_HEADERS" ]; then 79 | sed -i -e "s#session.cache_limiter = nocache#session.cache_limiter = ''#g" /etc/php/php.ini 80 | fi 81 | 82 | # Version numbers: 83 | printf "%-30s %-30s\n" "PHP Version:" "`php -r 'echo phpversion();'`" 84 | printf "%-30s %-30s\n" "Nginx Version:" "`/usr/sbin/nginx -v 2>&1 | sed -e 's/nginx version: nginx\///g'`" 85 | 86 | if [ ! -z "$NGINX_PORT" ]; then 87 | printf "%-30s %-30s\n" "Nginx Port:" "$PORT" 88 | sed -i -e "s#listen 80#listen $PORT#g" /etc/nginx/sites-enabled/site.conf 89 | fi 90 | 91 | if [ -z "$NGINX_PORT" ]; then 92 | printf "%-30s %-30s\n" "Nginx Port:" "80" 93 | fi 94 | 95 | if [ ! -z "$NGINX_WEB_ROOT" ]; then 96 | 97 | # Replace web root 98 | sed -i -e "s#root /src/public#root $NGINX_WEB_ROOT#g" /etc/nginx/sites-enabled/site.conf 99 | 100 | printf "%-30s %-30s\n" "Nginx Web Root:" "$NGINX_WEB_ROOT" 101 | 102 | fi 103 | 104 | if [ -z "$NGINX_WEB_ROOT" ]; then 105 | 106 | printf "%-30s %-30s\n" "Nginx Web Root:" "/src/public" 107 | 108 | fi 109 | 110 | # PHP Max Memory 111 | # If set 112 | if [ ! -z "$PHP_MEMORY_MAX" ]; then 113 | 114 | # Set PHP.ini accordingly 115 | sed -i -e "s#memory_limit = 128M#memory_limit = ${PHP_MEMORY_MAX}M#g" /etc/php/php.ini 116 | 117 | fi 118 | 119 | # Print the real value 120 | printf "%-30s %-30s\n" "PHP Memory Max:" "`php -r 'echo ini_get("memory_limit");'`" 121 | 122 | # PHP Opcache 123 | # If not set 124 | if [ -z "$DISABLE_OPCACHE" ]; then 125 | 126 | printf "%-30s %-30s\n" "PHP Opcache:" "Enabled" 127 | 128 | fi 129 | # If set 130 | if [ ! -z "$DISABLE_OPCACHE" ]; then 131 | 132 | printf "%-30s %-30s\n" "PHP Opcache:" "Disabled" 133 | 134 | # Set PHP.ini accordingly 135 | sed -i -e "s#opcache.enable=1#opcache.enable=0#g" /etc/php/php.ini 136 | sed -i -e "s#opcache.enable_cli=1#opcache.enable_cli=0#g" /etc/php/php.ini 137 | 138 | fi 139 | 140 | # PHP Opcache Memory 141 | # If set 142 | if [ ! -z "$PHP_OPCACHE_MEMORY" ]; then 143 | 144 | # Set PHP.ini accordingly 145 | sed -i -e "s#opcache.memory_consumption=16#opcache.memory_consumption=${PHP_OPCACHE_MEMORY}#g" /etc/php/php.ini 146 | 147 | fi 148 | 149 | # Print the real value 150 | printf "%-30s %-30s\n" "Opcache Memory Max:" "`php -r 'echo ini_get("opcache.memory_consumption");'`M" 151 | 152 | # PHP Session Config 153 | # If set 154 | if [ ! -z "$PHP_SESSION_STORE" ]; then 155 | 156 | # Figure out which session save handler is in use, currently only supports redis 157 | if [ $PHP_SESSION_STORE == 'redis' ] || [ $PHP_SESSION_STORE == 'REDIS' ]; then 158 | if [ -z $PHP_SESSION_STORE_REDIS_HOST ]; then 159 | PHP_SESSION_STORE_REDIS_HOST='redis' 160 | fi 161 | if [ -z $PHP_SESSION_STORE_REDIS_PORT ]; then 162 | PHP_SESSION_STORE_REDIS_PORT='6379' 163 | fi 164 | printf "%-30s %-30s\n" "PHP Sessions:" "Redis" 165 | printf "%-30s %-30s\n" "PHP Redis Host:" "$PHP_SESSION_STORE_REDIS_HOST" 166 | printf "%-30s %-30s\n" "PHP Redis Port:" "$PHP_SESSION_STORE_REDIS_PORT" 167 | sed -i -e "s#session.save_handler = files#session.save_handler = redis\nsession.save_path = \"tcp://$PHP_SESSION_STORE_REDIS_HOST:$PHP_SESSION_STORE_REDIS_PORT\"#g" /etc/php/php.ini 168 | fi 169 | 170 | fi 171 | 172 | # Max Execution Time 173 | # If set 174 | if [ ! -z "$MAX_EXECUTION_TIME" ]; then 175 | 176 | # Set PHP.ini accordingly 177 | sed -i -e "s#max_execution_time = 600#max_execution_time = ${MAX_EXECUTION_TIME}#g" /etc/php/php.ini 178 | 179 | # Modify the nginx read timeout 180 | sed -i -e "s#fastcgi_read_timeout 600s;#fastcgi_read_timeout ${MAX_EXECUTION_TIME}s;#g" /etc/nginx/sites-enabled/site.conf 181 | fi 182 | 183 | # Print the value 184 | printf "%-30s %-30s\n" "Nginx Max Read:" "`cat /etc/nginx/sites-enabled/site.conf | grep 'fastcgi_read_timeout' | sed -e 's/fastcgi_read_timeout//g'`" 185 | 186 | # Print the value 187 | printf "%-30s %-30s\n" "PHP Max Execution Time:" "`cat /etc/php/php.ini | grep 'max_execution_time = ' | sed -e 's/max_execution_time = //g'`" 188 | 189 | # PHP-FPM Max Workers 190 | # If set 191 | if [ ! -z "$PHP_FPM_WORKERS" ]; then 192 | 193 | # Set PHP.ini accordingly 194 | sed -i -e "s#pm.max_children = 4#pm.max_children = $PHP_FPM_WORKERS#g" /etc/php/php-fpm.d/www.conf 195 | 196 | fi 197 | 198 | # Enable short tags for older sites 199 | if [ ! -z "$PHP_ENABLE_SHORT_TAGS" ]; then 200 | sed -i -e 's/short_open_tag = Off/short_open_tag = On/g' /etc/php/php.ini 201 | fi 202 | 203 | # Nginx custom snippets 204 | if [ -f /etc/nginx/custom.conf ]; then 205 | printf "%-30s %-30s\n" "Custom Nginx Snippet:" "Enabled" 206 | /usr/bin/php /usr/local/bin/nginx-custom 207 | fi 208 | 209 | if [ ! -f /etc/nginx/custom.conf ]; then 210 | printf "%-30s %-30s\n" "Custom Nginx Snippet:" "Not Found" 211 | fi 212 | 213 | # Set SMTP settings 214 | if [ $ENVIRONMENT == 'production' ]; then 215 | 216 | if [ -z "$MAIL_HOST" ]; then 217 | export MAIL_HOST=master-smtp.smtp-production 218 | fi 219 | 220 | if [ -z "$MAIL_PORT" ]; then 221 | export MAIL_PORT=25 222 | fi 223 | 224 | fi 225 | 226 | if [ $ENVIRONMENT == 'qa' ]; then 227 | 228 | if [ -z "$MAIL_HOST" ]; then 229 | export MAIL_HOST=master-smtp.mailhog-production 230 | fi 231 | fi 232 | 233 | if [ -z "$MAIL_DRIVER" ]; then 234 | export MAIL_DRIVER=mail 235 | fi 236 | 237 | if [ -z "$MAIL_PORT" ]; then 238 | export MAIL_PORT=25 239 | fi 240 | 241 | printf "%-30s %-30s\n" "SMTP:" "$MAIL_HOST:$MAIL_PORT" 242 | sed -i -e "s#sendmail_path = /usr/sbin/sendmail -t -i#sendmail_path = /usr/sbin/sendmail -t -i -S $MAIL_HOST:$MAIL_PORT#g" /etc/php/php.ini 243 | 244 | 245 | # Startup scripts 246 | if [ -f /startup-all.sh ]; then 247 | printf "%-30s %-30s\n" "Startup Script:" "Running" 248 | chmod +x /startup-all.sh && ./startup-all.sh 249 | fi 250 | 251 | if [ -f /startup-web.sh ]; then 252 | printf "%-30s %-30s\n" "Web Startup Script:" "Running" 253 | chmod +x /startup-web.sh && ./startup-web.sh 254 | fi 255 | 256 | # Print the value 257 | printf "%-30s %-30s\n" "PHP-FPM Max Workers:" "`cat /etc/php/php-fpm.d/www.conf | grep 'pm.max_children = ' | sed -e 's/pm.max_children = //g'`" 258 | # End PHP-FPM 259 | 260 | printf "\n\033[1;1mStarting supervisord\033[0m\n\n" 261 | 262 | # Start supervisord and services 263 | exec /usr/bin/supervisord -n -c /etc/supervisord.conf 264 | -------------------------------------------------------------------------------- /scripts/start-worker.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | printf "\033[1;1m ____ __ ____ __ __ __ __ _ _ 4 | ( _ \ /__\ ( _ \ /__\ ( ) ( ) /__\ ( \/ ) 5 | )___//(__)\ ) / /(__)\ )(__ )(__ /(__)\ ) ( 6 | (__) (__)(__)(_)\_)(__)(__)(____)(____)(__)(__)(_/\_)\033[0m\n" 7 | 8 | printf "\n\033[1;1mRunning Nginx PHP-FPM worker mode\033[0m\n\n" 9 | 10 | # printf "%-30s %-30s\n" "Key" "Value" 11 | 12 | # Container info: 13 | printf "%-30s %-30s\n" "Site:" "$SITE_NAME" 14 | printf "%-30s %-30s\n" "Branch:" "$SITE_BRANCH" 15 | printf "%-30s %-30s\n" "Environment:" "$ENVIRONMENT" 16 | 17 | # Atatus - if api key is set then configure and enable 18 | if [ ! -z "$ATATUS_APM_LICENSE_KEY" ]; then 19 | 20 | # Enabled 21 | printf "%-30s %-30s\n" "Atatus:" "Enabled" 22 | 23 | # Set the atatus api key 24 | sed -i -e "s/atatus.license_key = \"\"/atatus.license_key = \"$ATATUS_APM_LICENSE_KEY\"/g" /etc/php/conf.d/atatus.ini 25 | 26 | # Set the release stage to be the environment 27 | sed -i -e "s/atatus.release_stage = \"production\"/atatus.release_stage = \"$ENVIRONMENT\"/g" /etc/php/conf.d/atatus.ini 28 | 29 | # Set the app name to be site_name environment 30 | sed -i -e "s/atatus.app_name = \"PHP App\"/atatus.app_name = \"$SITE_NAME\"/g" /etc/php/conf.d/atatus.ini 31 | 32 | # Set the app version to be the branch build 33 | sed -i -e "s/atatus.app_version = \"\"/atatus.app_version = \"$SITE_BRANCH-$BUILD\"/g" /etc/php/conf.d/atatus.ini 34 | 35 | # Set the tags to contain useful data 36 | sed -i -e "s/atatus.tags = \"\"/atatus.tags = \"$SITE_BRANCH-$BUILD, $SITE_BRANCH\"/g" /etc/php/conf.d/atatus.ini 37 | 38 | fi 39 | 40 | # Atatus - if api key is not set then disable 41 | if [ -z "$ATATUS_APM_LICENSE_KEY" ]; then 42 | 43 | # Disabled 44 | printf "%-30s %-30s\n" "Atatus:" "Disabled" 45 | rm -f /etc/php/conf.d/atatus.ini 46 | 47 | fi 48 | 49 | # Atatus - configure raw sql logs if desirable 50 | if [ ! -z "$ATATUS_APM_RAW_SQL" ]; then 51 | 52 | # Enabled 53 | printf "%-30s %-30s\n" "Atatus SQL:" "Raw" 54 | 55 | # Set the atatus api key 56 | sed -i -e "s/atatus.sql.capture = \"normalized\"/atatus.sql.capture = \"raw\"/g" /etc/php/conf.d/atatus.ini 57 | 58 | fi 59 | 60 | # Atatus - configure laravel queues if desirable 61 | if [ ! -z "$ATATUS_APM_LARAVEL_QUEUES" ]; then 62 | 63 | # Enabled 64 | printf "%-30s %-30s\n" "Atatus Laravel Queues:" "Yes" 65 | 66 | # Set the atatus api key 67 | sed -i -e "s/atatus.laravel.enable_queues = false/atatus.laravel.enable_queues = true/g" /etc/php/conf.d/atatus.ini 68 | 69 | fi 70 | 71 | # Version numbers: 72 | printf "%-30s %-30s\n" "PHP Version:" "`php -r 'echo phpversion();'`" 73 | printf "%-30s %-30s\n" "Nginx Version:" "`/usr/sbin/nginx -v 2>&1 | sed -e 's/nginx version: nginx\///g'`" 74 | 75 | # PHP Max Memory 76 | # If set 77 | if [ ! -z "$PHP_MEMORY_MAX" ]; then 78 | 79 | # Set PHP.ini accordingly 80 | sed -i -e "s#memory_limit = 128M#memory_limit = ${PHP_MEMORY_MAX}M#g" /etc/php/php.ini 81 | 82 | fi 83 | 84 | # Print the real value 85 | printf "%-30s %-30s\n" "PHP Memory Max:" "`php -r 'echo ini_get("memory_limit");'`" 86 | 87 | # PHP Opcache 88 | # If not set 89 | if [ -z "$DISABLE_OPCACHE" ]; then 90 | 91 | printf "%-30s %-30s\n" "PHP Opcache:" "Enabled" 92 | 93 | fi 94 | # If set 95 | if [ ! -z "$DISABLE_OPCACHE" ]; then 96 | 97 | printf "%-30s %-30s\n" "PHP Opcache:" "Disabled" 98 | 99 | # Set PHP.ini accordingly 100 | sed -i -e "s#opcache.enable=1#opcache.enable=0#g" /etc/php/php.ini 101 | sed -i -e "s#opcache.enable_cli=1#opcache.enable_cli=0#g" /etc/php/php.ini 102 | 103 | fi 104 | 105 | # PHP Opcache Memory 106 | # If set 107 | if [ ! -z "$PHP_OPCACHE_MEMORY" ]; then 108 | 109 | # Set PHP.ini accordingly 110 | sed -i -e "s#opcache.memory_consumption=16#opcache.memory_consumption=${PHP_OPCACHE_MEMORY}#g" /etc/php/php.ini 111 | 112 | fi 113 | 114 | # Print the real value 115 | printf "%-30s %-30s\n" "Opcache Memory Max:" "`php -r 'echo ini_get("opcache.memory_consumption");'`M" 116 | 117 | # PHP Session Config 118 | # If set 119 | if [ ! -z "$PHP_SESSION_STORE" ]; then 120 | 121 | # Figure out which session save handler is in use, currently only supports redis 122 | if [ $PHP_SESSION_STORE == 'redis' ] || [ $PHP_SESSION_STORE == 'REDIS' ]; then 123 | if [ -z $PHP_SESSION_STORE_REDIS_HOST ]; then 124 | PHP_SESSION_STORE_REDIS_HOST='redis' 125 | fi 126 | if [ -z $PHP_SESSION_STORE_REDIS_PORT ]; then 127 | PHP_SESSION_STORE_REDIS_PORT='6379' 128 | fi 129 | printf "%-30s %-30s\n" "PHP Sessions:" "Redis" 130 | printf "%-30s %-30s\n" "PHP Redis Host:" "$PHP_SESSION_STORE_REDIS_HOST" 131 | printf "%-30s %-30s\n" "PHP Redis Port:" "$PHP_SESSION_STORE_REDIS_PORT" 132 | sed -i -e "s#session.save_handler = files#session.save_handler = redis\nsession.save_path = \"tcp://$PHP_SESSION_STORE_REDIS_HOST:$PHP_SESSION_STORE_REDIS_PORT\"#g" /etc/php/php.ini 133 | fi 134 | 135 | fi 136 | 137 | # Enable short tags for older sites 138 | if [ ! -z "$PHP_ENABLE_SHORT_TAGS" ]; then 139 | sed -i -e 's/short_open_tag = Off/short_open_tag = On/g' /etc/php/php.ini 140 | fi 141 | 142 | # Cron 143 | # If DISABLE_CRON is set: 144 | if [ ! -z "$DISABLE_CRON" ]; then 145 | 146 | # Disabled 147 | printf "%-30s %-30s\n" "Cron:" "Disabled" 148 | 149 | fi 150 | 151 | # If not set, enable monitoring: 152 | if [ -z "$DISABLE_CRON" ]; then 153 | 154 | # Enabled 155 | printf "%-30s %-30s\n" "Cron:" "Enabled" 156 | 157 | cp /etc/supervisor.d/cron.conf /etc/supervisord-enabled/ 158 | 159 | fi 160 | 161 | # Set SMTP settings 162 | if [ $ENVIRONMENT == 'production' ]; then 163 | 164 | if [ -z "$MAIL_HOST" ]; then 165 | export MAIL_HOST=master-smtp.smtp-production 166 | fi 167 | 168 | if [ -z "$MAIL_PORT" ]; then 169 | export MAIL_PORT=25 170 | fi 171 | 172 | fi 173 | 174 | if [ $ENVIRONMENT == 'qa' ]; then 175 | 176 | if [ -z "$MAIL_HOST" ]; then 177 | export MAIL_HOST=master-smtp.mailhog-production 178 | fi 179 | fi 180 | 181 | if [ -z "$MAIL_DRIVER" ]; then 182 | export MAIL_DRIVER=mail 183 | fi 184 | 185 | if [ -z "$MAIL_PORT" ]; then 186 | export MAIL_PORT=25 187 | fi 188 | 189 | printf "%-30s %-30s\n" "SMTP:" "$MAIL_HOST:$MAIL_PORT" 190 | sed -i -e "s#sendmail_path = /usr/sbin/sendmail -t -i#sendmail_path = /usr/sbin/sendmail -t -i -S $MAIL_HOST:$MAIL_PORT#g" /etc/php/php.ini 191 | 192 | # Startup scripts 193 | if [ -f /startup-all.sh ]; then 194 | printf "%-30s %-30s\n" "Startup Script:" "Running" 195 | chmod +x /startup-all.sh && ./startup-all.sh 196 | fi 197 | 198 | if [ -f /startup-worker.sh ]; then 199 | printf "%-30s %-30s\n" "Worker Startup Script:" "Running" 200 | chmod +x /startup-worker.sh && ./startup-worker.sh 201 | fi 202 | 203 | # Enable the worker-specific supervisor files 204 | cp /etc/supervisord-worker/* /etc/supervisord-enabled/ 205 | 206 | printf "\n\033[1;1mStarting supervisord\033[0m\n\n" 207 | 208 | # Start supervisord and services 209 | exec /usr/bin/supervisord -n -c /etc/supervisord.conf 210 | -------------------------------------------------------------------------------- /scripts/supervisor-healthcheck.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | python /healthcheck.py | grep -qv "'statename': 'FATAL'" 4 | -------------------------------------------------------------------------------- /test/php/slow.php: -------------------------------------------------------------------------------- 1 | --------------------------------------------------------------------------------