Blame SOURCES/php-fpm-www.conf

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