fritzkink
2023-12-24 499bcf333d26bc63203b224241efc0f5fbe44e2b
commit | author | age
499bcf 1 ;;;;;;;;;;;;;;;;;;;;;
F 2 ; FPM Configuration ;
3 ;;;;;;;;;;;;;;;;;;;;;
4
5 ; All relative paths in this configuration file are relative to PHP's install
6 ; prefix (/usr/php/8.2). This prefix can be dynamicaly changed by using the
7 ; '-p' argument from the command line.
8
9 ; Include one or more files. If glob(3) exists, it is used to include a bunch of
10 ; files from a glob(3) pattern. This directive can be used everywhere in the
11 ; file.
12 ; Relative path can also be used. They will be prefixed by:
13 ;  - the global prefix if it's been set (-p argument)
14 ;  - /usr/php/8.2 otherwise
15 ;include=etc/fpm.d/*.conf
16
17 ;;;;;;;;;;;;;;;;;;
18 ; Global Options ;
19 ;;;;;;;;;;;;;;;;;;
20
21 [global]
22 ; Pid file
23 ; Note: the default prefix is /var/php/8.2
24 ; Default Value: none
25 ;pid = run/php-fpm.pid
26
27 ; Error log file
28 ; If it's set to "syslog", log is sent to syslogd instead of being written
29 ; in a local file.
30 ; Note: the default prefix is /var/php/8.2
31 ; Default Value: log/php-fpm.log
32 ;error_log = log/php-fpm.log
33 error_log = syslog
34
35 ; syslog_facility is used to specify what type of program is logging the
36 ; message. This lets syslogd specify that messages from different facilities
37 ; will be handled differently.
38 ; See syslog(3) for possible values (ex daemon equiv LOG_DAEMON)
39 ; Default Value: daemon
40 ;syslog.facility = daemon
41
42 ; syslog_ident is prepended to every message. If you have multiple FPM
43 ; instances running on the same server, you can change the default value
44 ; which must suit common needs.
45 ; Default Value: php-fpm
46 ;syslog.ident = php-fpm
47
48 ; Log level
49 ; Possible Values: alert, error, warning, notice, debug
50 ; Default Value: notice
51 ;log_level = notice
52
53 ; If this number of child processes exit with SIGSEGV or SIGBUS within the time
54 ; interval set by emergency_restart_interval then FPM will restart. A value
55 ; of '0' means 'Off'.
56 ; Default Value: 0
57 ;emergency_restart_threshold = 0
58
59 ; Interval of time used by emergency_restart_interval to determine when
60 ; a graceful restart will be initiated.  This can be useful to work around
61 ; accidental corruptions in an accelerator's shared memory.
62 ; Available Units: s(econds), m(inutes), h(ours), or d(ays)
63 ; Default Unit: seconds
64 ; Default Value: 0
65 ;emergency_restart_interval = 0
66
67 ; Time limit for child processes to wait for a reaction on signals from master.
68 ; Available units: s(econds), m(inutes), h(ours), or d(ays)
69 ; Default Unit: seconds
70 ; Default Value: 0
71 ;process_control_timeout = 0
72
73 ; The maximum number of processes FPM will fork. This has been design to control
74 ; the global number of processes when using dynamic PM within a lot of pools.
75 ; Use it with caution.
76 ; Note: A value of 0 indicates no limit
77 ; Default Value: 0
78 ; process.max = 128
79
80 ; Specify the nice(2) priority to apply to the master process (only if set)
81 ; The value can vary from -19 (highest priority) to 20 (lower priority)
82 ; Note: - It will only work if the FPM master process is launched as root
83 ;       - The pool process will inherit the master process priority
84 ;         unless it specified otherwise
85 ; Default Value: no set
86 ; process.priority = -19
87
88 ; Send FPM to background. Set to 'no' to keep FPM in foreground for debugging.
89 ; Default Value: yes
90 ;daemonize = yes
91
92 ; Set open file descriptor rlimit for the master process.
93 ; Default Value: system defined value
94 ;rlimit_files = 1024
95
96 ; Set max core size rlimit for the master process.
97 ; Possible Values: 'unlimited' or an integer greater or equal to 0
98 ; Default Value: system defined value
99 ;rlimit_core = 0
100
101 ; Specify the event mechanism FPM will use. The following is available:
102 ; - select     (any POSIX os)
103 ; - poll       (any POSIX os)
104 ; - epoll      (linux >= 2.5.64)
105 ; - kqueue     (FreeBSD >= 4.1, OpenBSD >= 2.9, NetBSD >= 2.0)
106 ; - /dev/poll  (Solaris >= 7)
107 ; - port       (Solaris >= 10)
108 ; Default Value: not set (auto detection)
109 ;events.mechanism = /dev/poll
110
111 ; When FPM is build with systemd integration, specify the interval,
112 ; in second, between health report notification to systemd.
113 ; Set to 0 to disable.
114 ; Available Units: s(econds), m(inutes), h(ours)
115 ; Default Unit: seconds
116 ; Default value: 10
117 ;systemd_interval = 10
118
119 ;;;;;;;;;;;;;;;;;;;;
120 ; Pool Definitions ;
121 ;;;;;;;;;;;;;;;;;;;;
122
123 ; Multiple pools of child processes may be started with different listening
124 ; ports and different management options.  The name of the pool will be
125 ; used in logs and stats. There is no limitation on the number of pools which
126 ; FPM can handle. Your system will tell you anyway :)
127
128 ; Start a new pool named 'www'.
129 ; the variable $pool can we used in any directive and will be replaced by the
130 ; pool name ('www' here)
131 [www]
132
133 ; Per pool prefix
134 ; It only applies on the following directives:
135 ; - 'slowlog'
136 ; - 'listen' (unixsocket)
137 ; - 'chroot'
138 ; - 'chdir'
139 ; - 'php_values'
140 ; - 'php_admin_values'
141 ; When not set, the global prefix (or /usr/php/8.2) applies instead.
142 ; Note: This directive can also be relative to the global prefix.
143 ; Default Value: none
144 ;prefix = /path/to/pools/$pool
145
146 ; Unix user/group of processes
147 ; Note: The user is mandatory. If the group is not set, the default user's group
148 ;       will be used.
149 ; user = webservd
150 ; group = webservd
151
152 ; The address on which to accept FastCGI requests.
153 ; Valid syntaxes are:
154 ;   'ip.add.re.ss:port'    - to listen on a TCP socket to a specific address on
155 ;                            a specific port;
156 ;   'port'                 - to listen on a TCP socket to all addresses on a
157 ;                            specific port;
158 ;   '/path/to/unix/socket' - to listen on a unix socket.
159 ; Note: This value is mandatory.
160 listen = 127.0.0.1:9000
161
162 ; Set listen(2) backlog.
163 ; Default Value: 128 (-1 on FreeBSD and OpenBSD)
164 ;listen.backlog = 128
165
166 ; Set permissions for unix socket, if one is used. In Linux, read/write
167 ; permissions must be set in order to allow connections from a web server. Many
168 ; BSD-derived systems allow connections regardless of permissions.
169 ; Default Values: user and group are set as the running user
170 ;                 mode is set to 0666
171 ;listen.owner = nobody
172 ;listen.group = nobody
173 ;listen.mode = 0666
174
175 ; List of ipv4 addresses of FastCGI clients which are allowed to connect.
176 ; Equivalent to the FCGI_WEB_SERVER_ADDRS environment variable in the original
177 ; PHP FCGI (5.2.2+). Makes sense only with a tcp listening socket. Each address
178 ; must be separated by a comma. If this value is left blank, connections will be
179 ; accepted from any ip address.
180 ; Default Value: any
181 ;listen.allowed_clients = 127.0.0.1
182
183 ; Specify the nice(2) priority to apply to the pool processes (only if set)
184 ; The value can vary from -19 (highest priority) to 20 (lower priority)
185 ; Note: - It will only work if the FPM master process is launched as root
186 ;       - The pool processes will inherit the master process priority
187 ;         unless it specified otherwise
188 ; Default Value: no set
189 ; priority = -19
190
191 ; Choose how the process manager will control the number of child processes.
192 ; Possible Values:
193 ;   static  - a fixed number (pm.max_children) of child processes;
194 ;   dynamic - the number of child processes are set dynamically based on the
195 ;             following directives. With this process management, there will be
196 ;             always at least 1 children.
197 ;             pm.max_children      - the maximum number of children that can
198 ;                                    be alive at the same time.
199 ;             pm.start_servers     - the number of children created on startup.
200 ;             pm.min_spare_servers - the minimum number of children in 'idle'
201 ;                                    state (waiting to process). If the number
202 ;                                    of 'idle' processes is less than this
203 ;                                    number then some children will be created.
204 ;             pm.max_spare_servers - the maximum number of children in 'idle'
205 ;                                    state (waiting to process). If the number
206 ;                                    of 'idle' processes is greater than this
207 ;                                    number then some children will be killed.
208 ;  ondemand - no children are created at startup. Children will be forked when
209 ;             new requests will connect. The following parameter are used:
210 ;             pm.max_children           - the maximum number of children that
211 ;                                         can be alive at the same time.
212 ;             pm.process_idle_timeout   - The number of seconds after which
213 ;                                         an idle process will be killed.
214 ; Note: This value is mandatory.
215 pm = dynamic
216
217 ; The number of child processes to be created when pm is set to 'static' and the
218 ; maximum number of child processes when pm is set to 'dynamic' or 'ondemand'.
219 ; This value sets the limit on the number of simultaneous requests that will be
220 ; served. Equivalent to the ApacheMaxClients directive with mpm_prefork.
221 ; Equivalent to the PHP_FCGI_CHILDREN environment variable in the original PHP
222 ; CGI. The below defaults are based on a server without much resources. Don't
223 ; forget to tweak pm.* to fit your needs.
224 ; Note: Used when pm is set to 'static', 'dynamic' or 'ondemand'
225 ; Note: This value is mandatory.
226 pm.max_children = 10
227
228 ; The number of child processes created on startup.
229 ; Note: Used only when pm is set to 'dynamic'
230 ; Default Value: min_spare_servers + (max_spare_servers - min_spare_servers) / 2
231 pm.start_servers = 5
232
233 ; The desired minimum number of idle server processes.
234 ; Note: Used only when pm is set to 'dynamic'
235 ; Note: Mandatory when pm is set to 'dynamic'
236 pm.min_spare_servers = 5
237
238 ; The desired maximum number of idle server processes.
239 ; Note: Used only when pm is set to 'dynamic'
240 ; Note: Mandatory when pm is set to 'dynamic'
241 pm.max_spare_servers = 5
242
243 ; The number of seconds after which an idle process will be killed.
244 ; Note: Used only when pm is set to 'ondemand'
245 ; Default Value: 10s
246 ;pm.process_idle_timeout = 10s;
247
248 ; The number of requests each child process should execute before respawning.
249 ; This can be useful to work around memory leaks in 3rd party libraries. For
250 ; endless request processing specify '0'. Equivalent to PHP_FCGI_MAX_REQUESTS.
251 ; Default Value: 0
252 ;pm.max_requests = 500
253
254 ; The URI to view the FPM status page. If this value is not set, no URI will be
255 ; recognized as a status page. It shows the following informations:
256 ;   pool                 - the name of the pool;
257 ;   process manager      - static, dynamic or ondemand;
258 ;   start time           - the date and time FPM has started;
259 ;   start since          - number of seconds since FPM has started;
260 ;   accepted conn        - the number of request accepted by the pool;
261 ;   listen queue         - the number of request in the queue of pending
262 ;                          connections (see backlog in listen(2));
263 ;   max listen queue     - the maximum number of requests in the queue
264 ;                          of pending connections since FPM has started;
265 ;   listen queue len     - the size of the socket queue of pending connections;
266 ;   idle processes       - the number of idle processes;
267 ;   active processes     - the number of active processes;
268 ;   total processes      - the number of idle + active processes;
269 ;   max active processes - the maximum number of active processes since FPM
270 ;                          has started;
271 ;   max children reached - number of times, the process limit has been reached,
272 ;                          when pm tries to start more children (works only for
273 ;                          pm 'dynamic' and 'ondemand');
274 ; Value are updated in real time.
275 ; Example output:
276 ;   pool:                 www
277 ;   process manager:      static
278 ;   start time:           01/Jul/2011:17:53:49 +0200
279 ;   start since:          62636
280 ;   accepted conn:        190460
281 ;   listen queue:         0
282 ;   max listen queue:     1
283 ;   listen queue len:     42
284 ;   idle processes:       4
285 ;   active processes:     11
286 ;   total processes:      15
287 ;   max active processes: 12
288 ;   max children reached: 0
289 ;
290 ; By default the status page output is formatted as text/plain. Passing either
291 ; 'html', 'xml' or 'json' in the query string will return the corresponding
292 ; output syntax. Example:
293 ;   http://www.foo.bar/status
294 ;   http://www.foo.bar/status?json
295 ;   http://www.foo.bar/status?html
296 ;   http://www.foo.bar/status?xml
297 ;
298 ; By default the status page only outputs short status. Passing 'full' in the
299 ; query string will also return status for each pool process.
300 ; Example:
301 ;   http://www.foo.bar/status?full
302 ;   http://www.foo.bar/status?json&full
303 ;   http://www.foo.bar/status?html&full
304 ;   http://www.foo.bar/status?xml&full
305 ; The Full status returns for each process:
306 ;   pid                  - the PID of the process;
307 ;   state                - the state of the process (Idle, Running, ...);
308 ;   start time           - the date and time the process has started;
309 ;   start since          - the number of seconds since the process has started;
310 ;   requests             - the number of requests the process has served;
311 ;   request duration     - the duration in µs of the requests;
312 ;   request method       - the request method (GET, POST, ...);
313 ;   request URI          - the request URI with the query string;
314 ;   content length       - the content length of the request (only with POST);
315 ;   user                 - the user (PHP_AUTH_USER) (or '-' if not set);
316 ;   script               - the main script called (or '-' if not set);
317 ;   last request cpu     - the %cpu the last request consumed
318 ;                          it's always 0 if the process is not in Idle state
319 ;                          because CPU calculation is done when the request
320 ;                          processing has terminated;
321 ;   last request memory  - the max amount of memory the last request consumed
322 ;                          it's always 0 if the process is not in Idle state
323 ;                          because memory calculation is done when the request
324 ;                          processing has terminated;
325 ; If the process is in Idle state, then informations are related to the
326 ; last request the process has served. Otherwise informations are related to
327 ; the current request being served.
328 ; Example output:
329 ;   ************************
330 ;   pid:                  31330
331 ;   state:                Running
332 ;   start time:           01/Jul/2011:17:53:49 +0200
333 ;   start since:          63087
334 ;   requests:             12808
335 ;   request duration:     1250261
336 ;   request method:       GET
337 ;   request URI:          /test_mem.php?N=10000
338 ;   content length:       0
339 ;   user:                 -
340 ;   script:               /home/fat/web/docs/php/test_mem.php
341 ;   last request cpu:     0.00
342 ;   last request memory:  0
343 ;
344 ; Note: There is a real-time FPM status monitoring sample web page available
345 ;       It's available in: /var/php/8.2/fpm/status.html
346 ;
347 ; Note: The value must start with a leading slash (/). The value can be
348 ;       anything, but it may not be a good idea to use the .php extension or it
349 ;       may conflict with a real PHP file.
350 ; Default Value: not set
351 ;pm.status_path = /status
352
353 ; The ping URI to call the monitoring page of FPM. If this value is not set, no
354 ; URI will be recognized as a ping page. This could be used to test from outside
355 ; that FPM is alive and responding, or to
356 ; - create a graph of FPM availability (rrd or such);
357 ; - remove a server from a group if it is not responding (load balancing);
358 ; - trigger alerts for the operating team (24/7).
359 ; Note: The value must start with a leading slash (/). The value can be
360 ;       anything, but it may not be a good idea to use the .php extension or it
361 ;       may conflict with a real PHP file.
362 ; Default Value: not set
363 ;ping.path = /ping
364
365 ; This directive may be used to customize the response of a ping request. The
366 ; response is formatted as text/plain with a 200 response code.
367 ; Default Value: pong
368 ;ping.response = pong
369
370 ; The access log file
371 ; Default: not set
372 ;access.log = log/$pool.access.log
373
374 ; The access log format.
375 ; The following syntax is allowed
376 ;  %%: the '%' character
377 ;  %C: %CPU used by the request
378 ;      it can accept the following format:
379 ;      - %{user}C for user CPU only
380 ;      - %{system}C for system CPU only
381 ;      - %{total}C  for user + system CPU (default)
382 ;  %d: time taken to serve the request
383 ;      it can accept the following format:
384 ;      - %{seconds}d (default)
385 ;      - %{miliseconds}d
386 ;      - %{mili}d
387 ;      - %{microseconds}d
388 ;      - %{micro}d
389 ;  %e: an environment variable (same as $_ENV or $_SERVER)
390 ;      it must be associated with embraces to specify the name of the env
391 ;      variable. Some exemples:
392 ;      - server specifics like: %{REQUEST_METHOD}e or %{SERVER_PROTOCOL}e
393 ;      - HTTP headers like: %{HTTP_HOST}e or %{HTTP_USER_AGENT}e
394 ;  %f: script filename
395 ;  %l: content-length of the request (for POST request only)
396 ;  %m: request method
397 ;  %M: peak of memory allocated by PHP
398 ;      it can accept the following format:
399 ;      - %{bytes}M (default)
400 ;      - %{kilobytes}M
401 ;      - %{kilo}M
402 ;      - %{megabytes}M
403 ;      - %{mega}M
404 ;  %n: pool name
405 ;  %o: ouput header
406 ;      it must be associated with embraces to specify the name of the header:
407 ;      - %{Content-Type}o
408 ;      - %{X-Powered-By}o
409 ;      - %{Transfert-Encoding}o
410 ;      - ....
411 ;  %p: PID of the child that serviced the request
412 ;  %P: PID of the parent of the child that serviced the request
413 ;  %q: the query string
414 ;  %Q: the '?' character if query string exists
415 ;  %r: the request URI (without the query string, see %q and %Q)
416 ;  %R: remote IP address
417 ;  %s: status (response code)
418 ;  %t: server time the request was received
419 ;      it can accept a strftime(3) format:
420 ;      %d/%b/%Y:%H:%M:%S %z (default)
421 ;  %T: time the log has been written (the request has finished)
422 ;      it can accept a strftime(3) format:
423 ;      %d/%b/%Y:%H:%M:%S %z (default)
424 ;  %u: remote user
425 ;
426 ; Default: "%R - %u %t \"%m %r\" %s"
427 ;access.format = "%R - %u %t \"%m %r%Q%q\" %s %f %{mili}d %{kilo}M %C%%"
428
429 ; The log file for slow requests
430 ; Default Value: not set
431 ; Note: slowlog is mandatory if request_slowlog_timeout is set
432 ;slowlog = log/$pool.log.slow
433
434 ; The timeout for serving a single request after which a PHP backtrace will be
435 ; dumped to the 'slowlog' file. A value of '0s' means 'off'.
436 ; Available units: s(econds)(default), m(inutes), h(ours), or d(ays)
437 ; Default Value: 0
438 ;request_slowlog_timeout = 0
439
440 ; The timeout for serving a single request after which the worker process will
441 ; be killed. This option should be used when the 'max_execution_time' ini option
442 ; does not stop script execution for some reason. A value of '0' means 'off'.
443 ; Available units: s(econds)(default), m(inutes), h(ours), or d(ays)
444 ; Default Value: 0
445 ;request_terminate_timeout = 0
446
447 ; Set open file descriptor rlimit.
448 ; Default Value: system defined value
449 ;rlimit_files = 1024
450
451 ; Set max core size rlimit.
452 ; Possible Values: 'unlimited' or an integer greater or equal to 0
453 ; Default Value: system defined value
454 ;rlimit_core = 0
455
456 ; Chroot to this directory at the start. This value must be defined as an
457 ; absolute path. When this value is not set, chroot is not used.
458 ; Note: you can prefix with '$prefix' to chroot to the pool prefix or one
459 ; of its subdirectories. If the pool prefix is not set, the global prefix
460 ; will be used instead.
461 ; Note: chrooting is a great security feature and should be used whenever
462 ;       possible. However, all PHP paths will be relative to the chroot
463 ;       (error_log, sessions.save_path, ...).
464 ; Default Value: not set
465 ;chroot =
466
467 ; Chdir to this directory at the start.
468 ; Note: relative path can be used.
469 ; Default Value: current directory or / when chroot
470 ;chdir = /var/www
471
472 ; Redirect worker stdout and stderr into main error log. If not set, stdout and
473 ; stderr will be redirected to /dev/null according to FastCGI specs.
474 ; Note: on highloaded environement, this can cause some delay in the page
475 ; process time (several ms).
476 ; Default Value: no
477 ;catch_workers_output = yes
478
479 ; Limits the extensions of the main script FPM will allow to parse. This can
480 ; prevent configuration mistakes on the web server side. You should only limit
481 ; FPM to .php extensions to prevent malicious users to use other extensions to
482 ; exectute php code.
483 ; Note: set an empty value to allow all extensions.
484 ; Default Value: .php
485 ;security.limit_extensions = .php .php3 .php4 .php5
486
487 ; Pass environment variables like LD_LIBRARY_PATH. All $VARIABLEs are taken from
488 ; the current environment.
489 ; Default Value: clean env
490 ;env[HOSTNAME] = $HOSTNAME
491 ;env[PATH] = /usr/local/bin:/usr/bin:/bin
492 ;env[TMP] = /tmp
493 ;env[TMPDIR] = /tmp
494 ;env[TEMP] = /tmp
495
496 ; Additional php.ini defines, specific to this pool of workers. These settings
497 ; overwrite the values previously defined in the php.ini. The directives are the
498 ; same as the PHP SAPI:
499 ;   php_value/php_flag             - you can set classic ini defines which can
500 ;                                    be overwritten from PHP call 'ini_set'.
501 ;   php_admin_value/php_admin_flag - these directives won't be overwritten by
502 ;                                     PHP call 'ini_set'
503 ; For php_*flag, valid values are on, off, 1, 0, true, false, yes or no.
504
505 ; Defining 'extension' will load the corresponding shared extension from
506 ; extension_dir. Defining 'disable_functions' or 'disable_classes' will not
507 ; overwrite previously defined php.ini values, but will append the new value
508 ; instead.
509
510 ; Note: path INI options can be relative and will be expanded with the prefix
511 ; (pool, global or /usr/php/8.2)
512
513 ; Default Value: nothing is defined by default except the values in php.ini and
514 ;                specified at startup with the -d argument
515 ;php_admin_value[sendmail_path] = /usr/sbin/sendmail -t -i -f www@my.domain.com
516 ;php_flag[display_errors] = off
517 ;php_admin_value[error_log] = /var/log/fpm-php.www.log
518 ;php_admin_flag[log_errors] = on
519 ;php_admin_value[memory_limit] = 32M