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