343cbc
; Start a new pool named 'www'.
343cbc
; the variable $pool can be used in any directive and will be replaced by the
343cbc
; pool name ('www' here)
343cbc
[www]
343cbc
343cbc
; Per pool prefix
343cbc
; It only applies on the following directives:
343cbc
; - 'access.log'
343cbc
; - 'slowlog'
343cbc
; - 'listen' (unixsocket)
343cbc
; - 'chroot'
343cbc
; - 'chdir'
343cbc
; - 'php_values'
343cbc
; - 'php_admin_values'
343cbc
; When not set, the global prefix (or @php_fpm_prefix@) applies instead.
343cbc
; Note: This directive can also be relative to the global prefix.
343cbc
; Default Value: none
343cbc
;prefix = /path/to/pools/$pool
343cbc
343cbc
; Unix user/group of processes
343cbc
; Note: The user is mandatory. If the group is not set, the default user's group
343cbc
;       will be used.
343cbc
; RPM: apache user chosen to provide access to the same directories as httpd
343cbc
user = apache
343cbc
; RPM: Keep a group allowed to write in log dir.
343cbc
group = apache
343cbc
343cbc
; The address on which to accept FastCGI requests.
343cbc
; Valid syntaxes are:
343cbc
;   'ip.add.re.ss:port'    - to listen on a TCP socket to a specific IPv4 address on
343cbc
;                            a specific port;
343cbc
;   '[ip:6:addr:ess]:port' - to listen on a TCP socket to a specific IPv6 address on
343cbc
;                            a specific port;
343cbc
;   'port'                 - to listen on a TCP socket to all addresses
343cbc
;                            (IPv6 and IPv4-mapped) on a specific port;
343cbc
;   '/path/to/unix/socket' - to listen on a unix socket.
343cbc
; Note: This value is mandatory.
343cbc
listen = /run/php-fpm/www.sock
343cbc
343cbc
; Set listen(2) backlog.
343cbc
; Default Value: 511
343cbc
;listen.backlog = 511
343cbc
343cbc
; Set permissions for unix socket, if one is used. In Linux, read/write
343cbc
; permissions must be set in order to allow connections from a web server.
343cbc
; Default Values: user and group are set as the running user
343cbc
;                 mode is set to 0660
343cbc
;listen.owner = nobody
343cbc
;listen.group = nobody
343cbc
;listen.mode = 0660
343cbc
343cbc
; When POSIX Access Control Lists are supported you can set them using
343cbc
; these options, value is a comma separated list of user/group names.
343cbc
; When set, listen.owner and listen.group are ignored
343cbc
listen.acl_users = apache,nginx
343cbc
;listen.acl_groups =
343cbc
343cbc
; List of addresses (IPv4/IPv6) of FastCGI clients which are allowed to connect.
343cbc
; Equivalent to the FCGI_WEB_SERVER_ADDRS environment variable in the original
343cbc
; PHP FCGI (5.2.2+). Makes sense only with a tcp listening socket. Each address
343cbc
; must be separated by a comma. If this value is left blank, connections will be
343cbc
; accepted from any ip address.
343cbc
; Default Value: any
343cbc
listen.allowed_clients = 127.0.0.1
343cbc
343cbc
; Specify the nice(2) priority to apply to the pool processes (only if set)
343cbc
; The value can vary from -19 (highest priority) to 20 (lower priority)
343cbc
; Note: - It will only work if the FPM master process is launched as root
343cbc
;       - The pool processes will inherit the master process priority
343cbc
;         unless it specified otherwise
343cbc
; Default Value: no set
343cbc
; process.priority = -19
343cbc
343cbc
; Set the process dumpable flag (PR_SET_DUMPABLE prctl) even if the process user
343cbc
; or group is differrent than the master process user. It allows to create process
343cbc
; core dump and ptrace the process for the pool user.
343cbc
; Default Value: no
343cbc
; process.dumpable = yes
343cbc
343cbc
; Choose how the process manager will control the number of child processes.
343cbc
; Possible Values:
343cbc
;   static  - a fixed number (pm.max_children) of child processes;
343cbc
;   dynamic - the number of child processes are set dynamically based on the
343cbc
;             following directives. With this process management, there will be
343cbc
;             always at least 1 children.
343cbc
;             pm.max_children      - the maximum number of children that can
343cbc
;                                    be alive at the same time.
343cbc
;             pm.start_servers     - the number of children created on startup.
343cbc
;             pm.min_spare_servers - the minimum number of children in 'idle'
343cbc
;                                    state (waiting to process). If the number
343cbc
;                                    of 'idle' processes is less than this
343cbc
;                                    number then some children will be created.
343cbc
;             pm.max_spare_servers - the maximum number of children in 'idle'
343cbc
;                                    state (waiting to process). If the number
343cbc
;                                    of 'idle' processes is greater than this
343cbc
;                                    number then some children will be killed.
343cbc
;  ondemand - no children are created at startup. Children will be forked when
343cbc
;             new requests will connect. The following parameter are used:
343cbc
;             pm.max_children           - the maximum number of children that
343cbc
;                                         can be alive at the same time.
343cbc
;             pm.process_idle_timeout   - The number of seconds after which
343cbc
;                                         an idle process will be killed.
343cbc
; Note: This value is mandatory.
343cbc
pm = dynamic
343cbc
343cbc
; The number of child processes to be created when pm is set to 'static' and the
343cbc
; maximum number of child processes when pm is set to 'dynamic' or 'ondemand'.
343cbc
; This value sets the limit on the number of simultaneous requests that will be
343cbc
; served. Equivalent to the ApacheMaxClients directive with mpm_prefork.
343cbc
; Equivalent to the PHP_FCGI_CHILDREN environment variable in the original PHP
343cbc
; CGI. The below defaults are based on a server without much resources. Don't
343cbc
; forget to tweak pm.* to fit your needs.
343cbc
; Note: Used when pm is set to 'static', 'dynamic' or 'ondemand'
343cbc
; Note: This value is mandatory.
343cbc
pm.max_children = 50
343cbc
343cbc
; The number of child processes created on startup.
343cbc
; Note: Used only when pm is set to 'dynamic'
343cbc
; Default Value: min_spare_servers + (max_spare_servers - min_spare_servers) / 2
343cbc
pm.start_servers = 5
343cbc
343cbc
; The desired minimum number of idle server processes.
343cbc
; Note: Used only when pm is set to 'dynamic'
343cbc
; Note: Mandatory when pm is set to 'dynamic'
343cbc
pm.min_spare_servers = 5
343cbc
343cbc
; The desired maximum number of idle server processes.
343cbc
; Note: Used only when pm is set to 'dynamic'
343cbc
; Note: Mandatory when pm is set to 'dynamic'
343cbc
pm.max_spare_servers = 35
343cbc
343cbc
; The number of seconds after which an idle process will be killed.
343cbc
; Note: Used only when pm is set to 'ondemand'
343cbc
; Default Value: 10s
343cbc
;pm.process_idle_timeout = 10s;
343cbc
343cbc
; The number of requests each child process should execute before respawning.
343cbc
; This can be useful to work around memory leaks in 3rd party libraries. For
343cbc
; endless request processing specify '0'. Equivalent to PHP_FCGI_MAX_REQUESTS.
343cbc
; Default Value: 0
343cbc
;pm.max_requests = 500
343cbc
343cbc
; The URI to view the FPM status page. If this value is not set, no URI will be
343cbc
; recognized as a status page. It shows the following informations:
343cbc
;   pool                 - the name of the pool;
343cbc
;   process manager      - static, dynamic or ondemand;
343cbc
;   start time           - the date and time FPM has started;
343cbc
;   start since          - number of seconds since FPM has started;
343cbc
;   accepted conn        - the number of request accepted by the pool;
343cbc
;   listen queue         - the number of request in the queue of pending
343cbc
;                          connections (see backlog in listen(2));
343cbc
;   max listen queue     - the maximum number of requests in the queue
343cbc
;                          of pending connections since FPM has started;
343cbc
;   listen queue len     - the size of the socket queue of pending connections;
343cbc
;   idle processes       - the number of idle processes;
343cbc
;   active processes     - the number of active processes;
343cbc
;   total processes      - the number of idle + active processes;
343cbc
;   max active processes - the maximum number of active processes since FPM
343cbc
;                          has started;
343cbc
;   max children reached - number of times, the process limit has been reached,
343cbc
;                          when pm tries to start more children (works only for
343cbc
;                          pm 'dynamic' and 'ondemand');
343cbc
; Value are updated in real time.
343cbc
; Example output:
343cbc
;   pool:                 www
343cbc
;   process manager:      static
343cbc
;   start time:           01/Jul/2011:17:53:49 +0200
343cbc
;   start since:          62636
343cbc
;   accepted conn:        190460
343cbc
;   listen queue:         0
343cbc
;   max listen queue:     1
343cbc
;   listen queue len:     42
343cbc
;   idle processes:       4
343cbc
;   active processes:     11
343cbc
;   total processes:      15
343cbc
;   max active processes: 12
343cbc
;   max children reached: 0
343cbc
;
343cbc
; By default the status page output is formatted as text/plain. Passing either
343cbc
; 'html', 'xml' or 'json' in the query string will return the corresponding
343cbc
; output syntax. Example:
343cbc
;   http://www.foo.bar/status
343cbc
;   http://www.foo.bar/status?json
343cbc
;   http://www.foo.bar/status?html
343cbc
;   http://www.foo.bar/status?xml
343cbc
;
343cbc
; By default the status page only outputs short status. Passing 'full' in the
343cbc
; query string will also return status for each pool process.
343cbc
; Example:
343cbc
;   http://www.foo.bar/status?full
343cbc
;   http://www.foo.bar/status?json&full
343cbc
;   http://www.foo.bar/status?html&full
343cbc
;   http://www.foo.bar/status?xml&full
343cbc
; The Full status returns for each process:
343cbc
;   pid                  - the PID of the process;
343cbc
;   state                - the state of the process (Idle, Running, ...);
343cbc
;   start time           - the date and time the process has started;
343cbc
;   start since          - the number of seconds since the process has started;
343cbc
;   requests             - the number of requests the process has served;
343cbc
;   request duration     - the duration in ┬Ás of the requests;
343cbc
;   request method       - the request method (GET, POST, ...);
343cbc
;   request URI          - the request URI with the query string;
343cbc
;   content length       - the content length of the request (only with POST);
343cbc
;   user                 - the user (PHP_AUTH_USER) (or '-' if not set);
343cbc
;   script               - the main script called (or '-' if not set);
343cbc
;   last request cpu     - the %cpu the last request consumed
343cbc
;                          it's always 0 if the process is not in Idle state
343cbc
;                          because CPU calculation is done when the request
343cbc
;                          processing has terminated;
343cbc
;   last request memory  - the max amount of memory the last request consumed
343cbc
;                          it's always 0 if the process is not in Idle state
343cbc
;                          because memory calculation is done when the request
343cbc
;                          processing has terminated;
343cbc
; If the process is in Idle state, then informations are related to the
343cbc
; last request the process has served. Otherwise informations are related to
343cbc
; the current request being served.
343cbc
; Example output:
343cbc
;   ************************
343cbc
;   pid:                  31330
343cbc
;   state:                Running
343cbc
;   start time:           01/Jul/2011:17:53:49 +0200
343cbc
;   start since:          63087
343cbc
;   requests:             12808
343cbc
;   request duration:     1250261
343cbc
;   request method:       GET
343cbc
;   request URI:          /test_mem.php?N=10000
343cbc
;   content length:       0
343cbc
;   user:                 -
343cbc
;   script:               /home/fat/web/docs/php/test_mem.php
343cbc
;   last request cpu:     0.00
343cbc
;   last request memory:  0
343cbc
;
343cbc
; Note: There is a real-time FPM status monitoring sample web page available
343cbc
;       It's available in: @EXPANDED_DATADIR@/fpm/status.html
343cbc
;
343cbc
; Note: The value must start with a leading slash (/). The value can be
343cbc
;       anything, but it may not be a good idea to use the .php extension or it
343cbc
;       may conflict with a real PHP file.
343cbc
; Default Value: not set
343cbc
;pm.status_path = /status
343cbc
343cbc
; The ping URI to call the monitoring page of FPM. If this value is not set, no
343cbc
; URI will be recognized as a ping page. This could be used to test from outside
343cbc
; that FPM is alive and responding, or to
343cbc
; - create a graph of FPM availability (rrd or such);
343cbc
; - remove a server from a group if it is not responding (load balancing);
343cbc
; - trigger alerts for the operating team (24/7).
343cbc
; Note: The value must start with a leading slash (/). The value can be
343cbc
;       anything, but it may not be a good idea to use the .php extension or it
343cbc
;       may conflict with a real PHP file.
343cbc
; Default Value: not set
343cbc
;ping.path = /ping
343cbc
343cbc
; This directive may be used to customize the response of a ping request. The
343cbc
; response is formatted as text/plain with a 200 response code.
343cbc
; Default Value: pong
343cbc
;ping.response = pong
343cbc
343cbc
; The access log file
343cbc
; Default: not set
343cbc
;access.log = log/$pool.access.log
343cbc
343cbc
; The access log format.
343cbc
; The following syntax is allowed
343cbc
;  %%: the '%' character
343cbc
;  %C: %CPU used by the request
343cbc
;      it can accept the following format:
343cbc
;      - %{user}C for user CPU only
343cbc
;      - %{system}C for system CPU only
343cbc
;      - %{total}C  for user + system CPU (default)
343cbc
;  %d: time taken to serve the request
343cbc
;      it can accept the following format:
343cbc
;      - %{seconds}d (default)
343cbc
;      - %{miliseconds}d
343cbc
;      - %{mili}d
343cbc
;      - %{microseconds}d
343cbc
;      - %{micro}d
343cbc
;  %e: an environment variable (same as $_ENV or $_SERVER)
343cbc
;      it must be associated with embraces to specify the name of the env
343cbc
;      variable. Some exemples:
343cbc
;      - server specifics like: %{REQUEST_METHOD}e or %{SERVER_PROTOCOL}e
343cbc
;      - HTTP headers like: %{HTTP_HOST}e or %{HTTP_USER_AGENT}e
343cbc
;  %f: script filename
343cbc
;  %l: content-length of the request (for POST request only)
343cbc
;  %m: request method
343cbc
;  %M: peak of memory allocated by PHP
343cbc
;      it can accept the following format:
343cbc
;      - %{bytes}M (default)
343cbc
;      - %{kilobytes}M
343cbc
;      - %{kilo}M
343cbc
;      - %{megabytes}M
343cbc
;      - %{mega}M
343cbc
;  %n: pool name
343cbc
;  %o: output header
343cbc
;      it must be associated with embraces to specify the name of the header:
343cbc
;      - %{Content-Type}o
343cbc
;      - %{X-Powered-By}o
343cbc
;      - %{Transfert-Encoding}o
343cbc
;      - ....
343cbc
;  %p: PID of the child that serviced the request
343cbc
;  %P: PID of the parent of the child that serviced the request
343cbc
;  %q: the query string
343cbc
;  %Q: the '?' character if query string exists
343cbc
;  %r: the request URI (without the query string, see %q and %Q)
343cbc
;  %R: remote IP address
343cbc
;  %s: status (response code)
343cbc
;  %t: server time the request was received
343cbc
;      it can accept a strftime(3) format:
343cbc
;      %d/%b/%Y:%H:%M:%S %z (default)
343cbc
;      The strftime(3) format must be encapsuled in a %{<strftime_format>}t tag
343cbc
;      e.g. for a ISO8601 formatted timestring, use: %{%Y-%m-%dT%H:%M:%S%z}t
343cbc
;  %T: time the log has been written (the request has finished)
343cbc
;      it can accept a strftime(3) format:
343cbc
;      %d/%b/%Y:%H:%M:%S %z (default)
343cbc
;      The strftime(3) format must be encapsuled in a %{<strftime_format>}t tag
343cbc
;      e.g. for a ISO8601 formatted timestring, use: %{%Y-%m-%dT%H:%M:%S%z}t
343cbc
;  %u: remote user
343cbc
;
343cbc
; Default: "%R - %u %t \"%m %r\" %s"
343cbc
;access.format = "%R - %u %t \"%m %r%Q%q\" %s %f %{mili}d %{kilo}M %C%%"
343cbc
343cbc
; The log file for slow requests
343cbc
; Default Value: not set
343cbc
; Note: slowlog is mandatory if request_slowlog_timeout is set
343cbc
slowlog = /var/log/php-fpm/www-slow.log
343cbc
343cbc
; The timeout for serving a single request after which a PHP backtrace will be
343cbc
; dumped to the 'slowlog' file. A value of '0s' means 'off'.
343cbc
; Available units: s(econds)(default), m(inutes), h(ours), or d(ays)
343cbc
; Default Value: 0
343cbc
;request_slowlog_timeout = 0
343cbc
343cbc
; Depth of slow log stack trace.
343cbc
; Default Value: 20
343cbc
;request_slowlog_trace_depth = 20
343cbc
343cbc
; The timeout for serving a single request after which the worker process will
343cbc
; be killed. This option should be used when the 'max_execution_time' ini option
343cbc
; does not stop script execution for some reason. A value of '0' means 'off'.
343cbc
; Available units: s(econds)(default), m(inutes), h(ours), or d(ays)
343cbc
; Default Value: 0
343cbc
;request_terminate_timeout = 0
343cbc
343cbc
; Set open file descriptor rlimit.
343cbc
; Default Value: system defined value
343cbc
;rlimit_files = 1024
343cbc
343cbc
; Set max core size rlimit.
343cbc
; Possible Values: 'unlimited' or an integer greater or equal to 0
343cbc
; Default Value: system defined value
343cbc
;rlimit_core = 0
343cbc
343cbc
; Chroot to this directory at the start. This value must be defined as an
343cbc
; absolute path. When this value is not set, chroot is not used.
343cbc
; Note: you can prefix with '$prefix' to chroot to the pool prefix or one
343cbc
; of its subdirectories. If the pool prefix is not set, the global prefix
343cbc
; will be used instead.
343cbc
; Note: chrooting is a great security feature and should be used whenever
343cbc
;       possible. However, all PHP paths will be relative to the chroot
343cbc
;       (error_log, sessions.save_path, ...).
343cbc
; Default Value: not set
343cbc
;chroot =
343cbc
343cbc
; Chdir to this directory at the start.
343cbc
; Note: relative path can be used.
343cbc
; Default Value: current directory or / when chroot
343cbc
;chdir = /var/www
343cbc
343cbc
; Redirect worker stdout and stderr into main error log. If not set, stdout and
343cbc
; stderr will be redirected to /dev/null according to FastCGI specs.
343cbc
; Note: on highloaded environement, this can cause some delay in the page
343cbc
; process time (several ms).
343cbc
; Default Value: no
343cbc
;catch_workers_output = yes
343cbc
343cbc
; Clear environment in FPM workers
343cbc
; Prevents arbitrary environment variables from reaching FPM worker processes
343cbc
; by clearing the environment in workers before env vars specified in this
343cbc
; pool configuration are added.
343cbc
; Setting to "no" will make all environment variables available to PHP code
343cbc
; via getenv(), $_ENV and $_SERVER.
343cbc
; Default Value: yes
343cbc
;clear_env = no
343cbc
343cbc
; Limits the extensions of the main script FPM will allow to parse. This can
343cbc
; prevent configuration mistakes on the web server side. You should only limit
343cbc
; FPM to .php extensions to prevent malicious users to use other extensions to
343cbc
; execute php code.
343cbc
; Note: set an empty value to allow all extensions.
343cbc
; Default Value: .php
343cbc
;security.limit_extensions = .php .php3 .php4 .php5 .php7
343cbc
343cbc
; Pass environment variables like LD_LIBRARY_PATH. All $VARIABLEs are taken from
343cbc
; the current environment.
343cbc
; Default Value: clean env
343cbc
;env[HOSTNAME] = $HOSTNAME
343cbc
;env[PATH] = /usr/local/bin:/usr/bin:/bin
343cbc
;env[TMP] = /tmp
343cbc
;env[TMPDIR] = /tmp
343cbc
;env[TEMP] = /tmp
343cbc
343cbc
; Additional php.ini defines, specific to this pool of workers. These settings
343cbc
; overwrite the values previously defined in the php.ini. The directives are the
343cbc
; same as the PHP SAPI:
343cbc
;   php_value/php_flag             - you can set classic ini defines which can
343cbc
;                                    be overwritten from PHP call 'ini_set'.
343cbc
;   php_admin_value/php_admin_flag - these directives won't be overwritten by
343cbc
;                                     PHP call 'ini_set'
343cbc
; For php_*flag, valid values are on, off, 1, 0, true, false, yes or no.
343cbc
343cbc
; Defining 'extension' will load the corresponding shared extension from
343cbc
; extension_dir. Defining 'disable_functions' or 'disable_classes' will not
343cbc
; overwrite previously defined php.ini values, but will append the new value
343cbc
; instead.
343cbc
343cbc
; Note: path INI options can be relative and will be expanded with the prefix
343cbc
; (pool, global or @prefix@)
343cbc
343cbc
; Default Value: nothing is defined by default except the values in php.ini and
343cbc
;                specified at startup with the -d argument
343cbc
;php_admin_value[sendmail_path] = /usr/sbin/sendmail -t -i -f www@my.domain.com
343cbc
;php_flag[display_errors] = off
343cbc
php_admin_value[error_log] = /var/log/php-fpm/www-error.log
343cbc
php_admin_flag[log_errors] = on
343cbc
;php_admin_value[memory_limit] = 128M
343cbc
343cbc
; Set the following data paths to directories owned by the FPM process user.
343cbc
;
343cbc
; Do not change the ownership of existing system directories, if the process
343cbc
; user does not have write permission, create dedicated directories for this
343cbc
; purpose.
343cbc
;
343cbc
; See warning about choosing the location of these directories on your system
343cbc
; at http://php.net/session.save-path
343cbc
php_value[session.save_handler] = files
343cbc
php_value[session.save_path]    = /var/lib/php/session
343cbc
php_value[soap.wsdl_cache_dir]  = /var/lib/php/wsdlcache
343cbc
;php_value[opcache.file_cache]  = /var/lib/php/opcache