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 @php_fpm_prefix@) 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. 23user = @php_fpm_user@ 24group = @php_fpm_group@ 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. 36listen = 127.0.0.1:9000 37 38; Set listen(2) backlog. 39; Default Value: 511 (-1 on FreeBSD and OpenBSD) 40;listen.backlog = 511 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. The owner 45; and group can be specified either by name or by their numeric IDs. 46; Default Values: user and group are set as the running user 47; mode is set to 0660 48;listen.owner = @php_fpm_user@ 49;listen.group = @php_fpm_group@ 50;listen.mode = 0660 51; When POSIX Access Control Lists are supported you can set them using 52; these options, value is a comma separated list of user/group names. 53; When set, listen.owner and listen.group are ignored 54;listen.acl_users = 55;listen.acl_groups = 56 57; List of addresses (IPv4/IPv6) of FastCGI clients which are allowed to connect. 58; Equivalent to the FCGI_WEB_SERVER_ADDRS environment variable in the original 59; PHP FCGI (5.2.2+). Makes sense only with a tcp listening socket. Each address 60; must be separated by a comma. If this value is left blank, connections will be 61; accepted from any ip address. 62; Default Value: any 63;listen.allowed_clients = 127.0.0.1 64 65; Specify the nice(2) priority to apply to the pool processes (only if set) 66; The value can vary from -19 (highest priority) to 20 (lower priority) 67; Note: - It will only work if the FPM master process is launched as root 68; - The pool processes will inherit the master process priority 69; unless it specified otherwise 70; Default Value: no set 71; process.priority = -19 72 73; Set the process dumpable flag (PR_SET_DUMPABLE prctl) even if the process user 74; or group is differrent than the master process user. It allows to create process 75; core dump and ptrace the process for the pool user. 76; Default Value: no 77; process.dumpable = yes 78 79; Choose how the process manager will control the number of child processes. 80; Possible Values: 81; static - a fixed number (pm.max_children) of child processes; 82; dynamic - the number of child processes are set dynamically based on the 83; following directives. With this process management, there will be 84; always at least 1 children. 85; pm.max_children - the maximum number of children that can 86; be alive at the same time. 87; pm.start_servers - the number of children created on startup. 88; pm.min_spare_servers - the minimum number of children in 'idle' 89; state (waiting to process). If the number 90; of 'idle' processes is less than this 91; number then some children will be created. 92; pm.max_spare_servers - the maximum number of children in 'idle' 93; state (waiting to process). If the number 94; of 'idle' processes is greater than this 95; number then some children will be killed. 96; ondemand - no children are created at startup. Children will be forked when 97; new requests will connect. The following parameter are used: 98; pm.max_children - the maximum number of children that 99; can be alive at the same time. 100; pm.process_idle_timeout - The number of seconds after which 101; an idle process will be killed. 102; Note: This value is mandatory. 103pm = dynamic 104 105; The number of child processes to be created when pm is set to 'static' and the 106; maximum number of child processes when pm is set to 'dynamic' or 'ondemand'. 107; This value sets the limit on the number of simultaneous requests that will be 108; served. Equivalent to the ApacheMaxClients directive with mpm_prefork. 109; Equivalent to the PHP_FCGI_CHILDREN environment variable in the original PHP 110; CGI. The below defaults are based on a server without much resources. Don't 111; forget to tweak pm.* to fit your needs. 112; Note: Used when pm is set to 'static', 'dynamic' or 'ondemand' 113; Note: This value is mandatory. 114pm.max_children = 5 115 116; The number of child processes created on startup. 117; Note: Used only when pm is set to 'dynamic' 118; Default Value: (min_spare_servers + max_spare_servers) / 2 119pm.start_servers = 2 120 121; The desired minimum number of idle server processes. 122; Note: Used only when pm is set to 'dynamic' 123; Note: Mandatory when pm is set to 'dynamic' 124pm.min_spare_servers = 1 125 126; The desired maximum number of idle server processes. 127; Note: Used only when pm is set to 'dynamic' 128; Note: Mandatory when pm is set to 'dynamic' 129pm.max_spare_servers = 3 130 131; The number of seconds after which an idle process will be killed. 132; Note: Used only when pm is set to 'ondemand' 133; Default Value: 10s 134;pm.process_idle_timeout = 10s; 135 136; The number of requests each child process should execute before respawning. 137; This can be useful to work around memory leaks in 3rd party libraries. For 138; endless request processing specify '0'. Equivalent to PHP_FCGI_MAX_REQUESTS. 139; Default Value: 0 140;pm.max_requests = 500 141 142; The URI to view the FPM status page. If this value is not set, no URI will be 143; recognized as a status page. It shows the following informations: 144; pool - the name of the pool; 145; process manager - static, dynamic or ondemand; 146; start time - the date and time FPM has started; 147; start since - number of seconds since FPM has started; 148; accepted conn - the number of request accepted by the pool; 149; listen queue - the number of request in the queue of pending 150; connections (see backlog in listen(2)); 151; max listen queue - the maximum number of requests in the queue 152; of pending connections since FPM has started; 153; listen queue len - the size of the socket queue of pending connections; 154; idle processes - the number of idle processes; 155; active processes - the number of active processes; 156; total processes - the number of idle + active processes; 157; max active processes - the maximum number of active processes since FPM 158; has started; 159; max children reached - number of times, the process limit has been reached, 160; when pm tries to start more children (works only for 161; pm 'dynamic' and 'ondemand'); 162; Value are updated in real time. 163; Example output: 164; pool: www 165; process manager: static 166; start time: 01/Jul/2011:17:53:49 +0200 167; start since: 62636 168; accepted conn: 190460 169; listen queue: 0 170; max listen queue: 1 171; listen queue len: 42 172; idle processes: 4 173; active processes: 11 174; total processes: 15 175; max active processes: 12 176; max children reached: 0 177; 178; By default the status page output is formatted as text/plain. Passing either 179; 'html', 'xml' or 'json' in the query string will return the corresponding 180; output syntax. Example: 181; http://www.foo.bar/status 182; http://www.foo.bar/status?json 183; http://www.foo.bar/status?html 184; http://www.foo.bar/status?xml 185; 186; By default the status page only outputs short status. Passing 'full' in the 187; query string will also return status for each pool process. 188; Example: 189; http://www.foo.bar/status?full 190; http://www.foo.bar/status?json&full 191; http://www.foo.bar/status?html&full 192; http://www.foo.bar/status?xml&full 193; The Full status returns for each process: 194; pid - the PID of the process; 195; state - the state of the process (Idle, Running, ...); 196; start time - the date and time the process has started; 197; start since - the number of seconds since the process has started; 198; requests - the number of requests the process has served; 199; request duration - the duration in µs of the requests; 200; request method - the request method (GET, POST, ...); 201; request URI - the request URI with the query string; 202; content length - the content length of the request (only with POST); 203; user - the user (PHP_AUTH_USER) (or '-' if not set); 204; script - the main script called (or '-' if not set); 205; last request cpu - the %cpu the last request consumed 206; it's always 0 if the process is not in Idle state 207; because CPU calculation is done when the request 208; processing has terminated; 209; last request memory - the max amount of memory the last request consumed 210; it's always 0 if the process is not in Idle state 211; because memory calculation is done when the request 212; processing has terminated; 213; If the process is in Idle state, then informations are related to the 214; last request the process has served. Otherwise informations are related to 215; the current request being served. 216; Example output: 217; ************************ 218; pid: 31330 219; state: Running 220; start time: 01/Jul/2011:17:53:49 +0200 221; start since: 63087 222; requests: 12808 223; request duration: 1250261 224; request method: GET 225; request URI: /test_mem.php?N=10000 226; content length: 0 227; user: - 228; script: /home/fat/web/docs/php/test_mem.php 229; last request cpu: 0.00 230; last request memory: 0 231; 232; Note: There is a real-time FPM status monitoring sample web page available 233; It's available in: @EXPANDED_DATADIR@/fpm/status.html 234; 235; Note: The value must start with a leading slash (/). The value can be 236; anything, but it may not be a good idea to use the .php extension or it 237; may conflict with a real PHP file. 238; Default Value: not set 239;pm.status_path = /status 240 241; The ping URI to call the monitoring page of FPM. If this value is not set, no 242; URI will be recognized as a ping page. This could be used to test from outside 243; that FPM is alive and responding, or to 244; - create a graph of FPM availability (rrd or such); 245; - remove a server from a group if it is not responding (load balancing); 246; - trigger alerts for the operating team (24/7). 247; Note: The value must start with a leading slash (/). The value can be 248; anything, but it may not be a good idea to use the .php extension or it 249; may conflict with a real PHP file. 250; Default Value: not set 251;ping.path = /ping 252 253; This directive may be used to customize the response of a ping request. The 254; response is formatted as text/plain with a 200 response code. 255; Default Value: pong 256;ping.response = pong 257 258; The access log file 259; Default: not set 260;access.log = log/$pool.access.log 261 262; The access log format. 263; The following syntax is allowed 264; %%: the '%' character 265; %C: %CPU used by the request 266; it can accept the following format: 267; - %{user}C for user CPU only 268; - %{system}C for system CPU only 269; - %{total}C for user + system CPU (default) 270; %d: time taken to serve the request 271; it can accept the following format: 272; - %{seconds}d (default) 273; - %{miliseconds}d 274; - %{mili}d 275; - %{microseconds}d 276; - %{micro}d 277; %e: an environment variable (same as $_ENV or $_SERVER) 278; it must be associated with embraces to specify the name of the env 279; variable. Some exemples: 280; - server specifics like: %{REQUEST_METHOD}e or %{SERVER_PROTOCOL}e 281; - HTTP headers like: %{HTTP_HOST}e or %{HTTP_USER_AGENT}e 282; %f: script filename 283; %l: content-length of the request (for POST request only) 284; %m: request method 285; %M: peak of memory allocated by PHP 286; it can accept the following format: 287; - %{bytes}M (default) 288; - %{kilobytes}M 289; - %{kilo}M 290; - %{megabytes}M 291; - %{mega}M 292; %n: pool name 293; %o: output header 294; it must be associated with embraces to specify the name of the header: 295; - %{Content-Type}o 296; - %{X-Powered-By}o 297; - %{Transfert-Encoding}o 298; - .... 299; %p: PID of the child that serviced the request 300; %P: PID of the parent of the child that serviced the request 301; %q: the query string 302; %Q: the '?' character if query string exists 303; %r: the request URI (without the query string, see %q and %Q) 304; %R: remote IP address 305; %s: status (response code) 306; %t: server time the request was received 307; it can accept a strftime(3) format: 308; %d/%b/%Y:%H:%M:%S %z (default) 309; The strftime(3) format must be encapsuled in a %{<strftime_format>}t tag 310; e.g. for a ISO8601 formatted timestring, use: %{%Y-%m-%dT%H:%M:%S%z}t 311; %T: time the log has been written (the request has finished) 312; it can accept a strftime(3) format: 313; %d/%b/%Y:%H:%M:%S %z (default) 314; The strftime(3) format must be encapsuled in a %{<strftime_format>}t tag 315; e.g. for a ISO8601 formatted timestring, use: %{%Y-%m-%dT%H:%M:%S%z}t 316; %u: remote user 317; 318; Default: "%R - %u %t \"%m %r\" %s" 319;access.format = "%R - %u %t \"%m %r%Q%q\" %s %f %{mili}d %{kilo}M %C%%" 320 321; The log file for slow requests 322; Default Value: not set 323; Note: slowlog is mandatory if request_slowlog_timeout is set 324;slowlog = log/$pool.log.slow 325 326; The timeout for serving a single request after which a PHP backtrace will be 327; dumped to the 'slowlog' file. A value of '0s' means 'off'. 328; Available units: s(econds)(default), m(inutes), h(ours), or d(ays) 329; Default Value: 0 330;request_slowlog_timeout = 0 331 332; Depth of slow log stack trace. 333; Default Value: 20 334;request_slowlog_trace_depth = 20 335 336; The timeout for serving a single request after which the worker process will 337; be killed. This option should be used when the 'max_execution_time' ini option 338; does not stop script execution for some reason. A value of '0' means 'off'. 339; Available units: s(econds)(default), m(inutes), h(ours), or d(ays) 340; Default Value: 0 341;request_terminate_timeout = 0 342 343; The timeout set by 'request_terminate_timeout' ini option is not engaged after 344; application calls 'fastcgi_finish_request' or when application has finished and 345; shutdown functions are being called (registered via register_shutdown_function). 346; This option will enable timeout limit to be applied unconditionally 347; even in such cases. 348; Default Value: no 349;request_terminate_timeout_track_finished = no 350 351; Set open file descriptor rlimit. 352; Default Value: system defined value 353;rlimit_files = 1024 354 355; Set max core size rlimit. 356; Possible Values: 'unlimited' or an integer greater or equal to 0 357; Default Value: system defined value 358;rlimit_core = 0 359 360; Chroot to this directory at the start. This value must be defined as an 361; absolute path. When this value is not set, chroot is not used. 362; Note: you can prefix with '$prefix' to chroot to the pool prefix or one 363; of its subdirectories. If the pool prefix is not set, the global prefix 364; will be used instead. 365; Note: chrooting is a great security feature and should be used whenever 366; possible. However, all PHP paths will be relative to the chroot 367; (error_log, sessions.save_path, ...). 368; Default Value: not set 369;chroot = 370 371; Chdir to this directory at the start. 372; Note: relative path can be used. 373; Default Value: current directory or / when chroot 374;chdir = /var/www 375 376; Redirect worker stdout and stderr into main error log. If not set, stdout and 377; stderr will be redirected to /dev/null according to FastCGI specs. 378; Note: on highloaded environement, this can cause some delay in the page 379; process time (several ms). 380; Default Value: no 381;catch_workers_output = yes 382 383; Decorate worker output with prefix and suffix containing information about 384; the child that writes to the log and if stdout or stderr is used as well as 385; log level and time. This options is used only if catch_workers_output is yes. 386; Settings to "no" will output data as written to the stdout or stderr. 387; Default value: yes 388;decorate_workers_output = no 389 390; Clear environment in FPM workers 391; Prevents arbitrary environment variables from reaching FPM worker processes 392; by clearing the environment in workers before env vars specified in this 393; pool configuration are added. 394; Setting to "no" will make all environment variables available to PHP code 395; via getenv(), $_ENV and $_SERVER. 396; Default Value: yes 397;clear_env = no 398 399; Limits the extensions of the main script FPM will allow to parse. This can 400; prevent configuration mistakes on the web server side. You should only limit 401; FPM to .php extensions to prevent malicious users to use other extensions to 402; execute php code. 403; Note: set an empty value to allow all extensions. 404; Default Value: .php 405;security.limit_extensions = .php .php3 .php4 .php5 .php7 406 407; Pass environment variables like LD_LIBRARY_PATH. All $VARIABLEs are taken from 408; the current environment. 409; Default Value: clean env 410;env[HOSTNAME] = $HOSTNAME 411;env[PATH] = /usr/local/bin:/usr/bin:/bin 412;env[TMP] = /tmp 413;env[TMPDIR] = /tmp 414;env[TEMP] = /tmp 415 416; Additional php.ini defines, specific to this pool of workers. These settings 417; overwrite the values previously defined in the php.ini. The directives are the 418; same as the PHP SAPI: 419; php_value/php_flag - you can set classic ini defines which can 420; be overwritten from PHP call 'ini_set'. 421; php_admin_value/php_admin_flag - these directives won't be overwritten by 422; PHP call 'ini_set' 423; For php_*flag, valid values are on, off, 1, 0, true, false, yes or no. 424 425; Defining 'extension' will load the corresponding shared extension from 426; extension_dir. Defining 'disable_functions' or 'disable_classes' will not 427; overwrite previously defined php.ini values, but will append the new value 428; instead. 429 430; Note: path INI options can be relative and will be expanded with the prefix 431; (pool, global or @prefix@) 432 433; Default Value: nothing is defined by default except the values in php.ini and 434; specified at startup with the -d argument 435;php_admin_value[sendmail_path] = /usr/sbin/sendmail -t -i -f www@my.domain.com 436;php_flag[display_errors] = off 437;php_admin_value[error_log] = /var/log/fpm-php.www.log 438;php_admin_flag[log_errors] = on 439;php_admin_value[memory_limit] = 32M 440