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