apiVersion: v1
kind: ConfigMap
metadata:
  namespace: svc
  name: php-config
  labels:
    app: php
    tier: backend
data:
  php-fpm.conf: |-
    [global]
    daemonize = no
    pid = run/php-fpm.pid

    ; https://github.com/docker-library/php/pull/725#issuecomment-443540114
    log_limit = 8192
    error_log = /proc/self/fd/2

    include=etc/php-fpm.d/*.conf
  www.conf: |-
    [www]
    user = www-data
    group = www-data

    listen = 9000

    access.log = /proc/self/fd/2

    clear_env = yes
    security.limit_extensions = .php

    rlimit_files = 131072
    rlimit_core = unlimited

    catch_workers_output = yes
    decorate_workers_output = no

    pm = static
    pm.max_children = 10
    pm.max_requests = 500

    ;env[HOSTNAME] = $HOSTNAME
    ;env[PATH] = /usr/local/bin:/usr/bin:/bin
    ;env[TMP] = /tmp
    ;env[TMPDIR] = /tmp
    ;env[TEMP] = /tmp

    php_flag[display_errors] = off
    ;php_admin_value[error_log] = /var/log/fpm-php.www.log
    ;php_admin_flag[log_errors] = on
    ;php_admin_value[memory_limit] = 32M
immutable: false
