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