1 ; Start a new pool named 'default'.
2 ; the variable $pool can we used in any directive and will be replaced by the
3 ; pool name ('default' here)
7 ; It only applies on the following directives:
9 ; - 'listen' (unixsocket)
13 ; - 'php_admin_values'
14 ; When not set, the global prefix (or /usr) applies instead.
15 ; Note: This directive can also be relative to the global prefix.
17 ;prefix = /path/to/pools/$pool
19 ; Unix user/group of processes
20 ; Note: The user is mandatory. If the group is not set, the default user's group
25 ; The address on which to accept FastCGI requests.
27 ; 'ip.add.re.ss:port' - to listen on a TCP socket to a specific address on
29 ; 'port' - to listen on a TCP socket to all addresses on a
31 ; '/path/to/unix/socket' - to listen on a unix socket.
32 ; Note: This value is mandatory.
33 listen = /var/run/php5-fpm-default.sock
35 ; Set listen(2) backlog. A value of '-1' means unlimited.
36 ; Default Value: 128 (-1 on FreeBSD and OpenBSD)
39 ; Set permissions for unix socket, if one is used. In Linux, read/write
40 ; permissions must be set in order to allow connections from a web server. Many
41 ; BSD-derived systems allow connections regardless of permissions.
42 ; Default Values: user and group are set as the running user
44 listen.owner = www-data
45 listen.group = www-data
48 ; List of ipv4 addresses of FastCGI clients which are allowed to connect.
49 ; Equivalent to the FCGI_WEB_SERVER_ADDRS environment variable in the original
50 ; PHP FCGI (5.2.2+). Makes sense only with a tcp listening socket. Each address
51 ; must be separated by a comma. If this value is left blank, connections will be
52 ; accepted from any ip address.
54 ;listen.allowed_clients = 127.0.0.1
56 ; Choose how the process manager will control the number of child processes.
58 ; static - a fixed number (pm.max_children) of child processes;
59 ; dynamic - the number of child processes are set dynamically based on the
60 ; following directives. With this process management, there will be
61 ; always at least 1 children.
62 ; pm.max_children - the maximum number of children that can
63 ; be alive at the same time.
64 ; pm.start_servers - the number of children created on startup.
65 ; pm.min_spare_servers - the minimum number of children in 'idle'
66 ; state (waiting to process). If the number
67 ; of 'idle' processes is less than this
68 ; number then some children will be created.
69 ; pm.max_spare_servers - the maximum number of children in 'idle'
70 ; state (waiting to process). If the number
71 ; of 'idle' processes is greater than this
72 ; number then some children will be killed.
73 ; ondemand - no children are created at startup. Children will be forked when
74 ; new requests will connect. The following parameter are used:
75 ; pm.max_children - the maximum number of children that
76 ; can be alive at the same time.
77 ; pm.process_idle_timeout - The number of seconds after which
78 ; an idle process will be killed.
79 ; Note: This value is mandatory.
82 ; The number of child processes to be created when pm is set to 'static' and the
83 ; maximum number of child processes when pm is set to 'dynamic' or 'ondemand'.
84 ; This value sets the limit on the number of simultaneous requests that will be
85 ; served. Equivalent to the ApacheMaxClients directive with mpm_prefork.
86 ; Equivalent to the PHP_FCGI_CHILDREN environment variable in the original PHP
87 ; CGI. The below defaults are based on a server without much resources. Don't
88 ; forget to tweak pm.* to fit your needs.
89 ; Note: Used when pm is set to 'static', 'dynamic' or 'ondemand'
90 ; Note: This value is mandatory.
93 ; The number of child processes created on startup.
94 ; Note: Used only when pm is set to 'dynamic'
95 ; Default Value: min_spare_servers + (max_spare_servers - min_spare_servers) / 2
98 ; The desired minimum number of idle server processes.
99 ; Note: Used only when pm is set to 'dynamic'
100 ; Note: Mandatory when pm is set to 'dynamic'
101 pm.min_spare_servers = 2
103 ; The desired maximum number of idle server processes.
104 ; Note: Used only when pm is set to 'dynamic'
105 ; Note: Mandatory when pm is set to 'dynamic'
106 pm.max_spare_servers = 6
108 ; The number of seconds after which an idle process will be killed.
109 ; Note: Used only when pm is set to 'ondemand'
111 ;pm.process_idle_timeout = 10s;
113 ; The number of requests each child process should execute before respawning.
114 ; This can be useful to work around memory leaks in 3rd party libraries. For
115 ; endless request processing specify '0'. Equivalent to PHP_FCGI_MAX_REQUESTS.
117 ;pm.max_requests = 500
119 ; The URI to view the FPM status page. If this value is not set, no URI will be
120 ; recognized as a status page. It shows the following informations:
121 ; pool - the name of the pool;
122 ; process manager - static, dynamic or ondemand;
123 ; start time - the date and time FPM has started;
124 ; start since - number of seconds since FPM has started;
125 ; accepted conn - the number of request accepted by the pool;
126 ; listen queue - the number of request in the queue of pending
127 ; connections (see backlog in listen(2));
128 ; max listen queue - the maximum number of requests in the queue
129 ; of pending connections since FPM has started;
130 ; listen queue len - the size of the socket queue of pending connections;
131 ; idle processes - the number of idle processes;
132 ; active processes - the number of active processes;
133 ; total processes - the number of idle + active processes;
134 ; max active processes - the maximum number of active processes since FPM
136 ; max children reached - number of times, the process limit has been reached,
137 ; when pm tries to start more children (works only for
138 ; pm 'dynamic' and 'ondemand');
139 ; Value are updated in real time.
142 ; process manager: static
143 ; start time: 01/Jul/2011:17:53:49 +0200
145 ; accepted conn: 190460
147 ; max listen queue: 1
148 ; listen queue len: 42
150 ; active processes: 11
151 ; total processes: 15
152 ; max active processes: 12
153 ; max children reached: 0
155 ; By default the status page output is formatted as text/plain. Passing either
156 ; 'html', 'xml' or 'json' in the query string will return the corresponding
157 ; output syntax. Example:
158 ; http://www.foo.bar/status
159 ; http://www.foo.bar/status?json
160 ; http://www.foo.bar/status?html
161 ; http://www.foo.bar/status?xml
163 ; By default the status page only outputs short status. Passing 'full' in the
164 ; query string will also return status for each pool process.
166 ; http://www.foo.bar/status?full
167 ; http://www.foo.bar/status?json&full
168 ; http://www.foo.bar/status?html&full
169 ; http://www.foo.bar/status?xml&full
170 ; The Full status returns for each process:
171 ; pid - the PID of the process;
172 ; state - the state of the process (Idle, Running, ...);
173 ; start time - the date and time the process has started;
174 ; start since - the number of seconds since the process has started;
175 ; requests - the number of requests the process has served;
176 ; request duration - the duration in µs of the requests;
177 ; request method - the request method (GET, POST, ...);
178 ; request URI - the request URI with the query string;
179 ; content length - the content length of the request (only with POST);
180 ; user - the user (PHP_AUTH_USER) (or '-' if not set);
181 ; script - the main script called (or '-' if not set);
182 ; last request cpu - the %cpu the last request consumed
183 ; it's always 0 if the process is not in Idle state
184 ; because CPU calculation is done when the request
185 ; processing has terminated;
186 ; last request memory - the max amount of memory the last request consumed
187 ; it's always 0 if the process is not in Idle state
188 ; because memory calculation is done when the request
189 ; processing has terminated;
190 ; If the process is in Idle state, then informations are related to the
191 ; last request the process has served. Otherwise informations are related to
192 ; the current request being served.
194 ; ************************
197 ; start time: 01/Jul/2011:17:53:49 +0200
200 ; request duration: 1250261
201 ; request method: GET
202 ; request URI: /test_mem.php?N=10000
205 ; script: /home/fat/web/docs/php/test_mem.php
206 ; last request cpu: 0.00
207 ; last request memory: 0
209 ; Note: There is a real-time FPM status monitoring sample web page available
210 ; It's available in: ${prefix}/share/fpm/status.html
212 ; Note: The value must start with a leading slash (/). The value can be
213 ; anything, but it may not be a good idea to use the .php extension or it
214 ; may conflict with a real PHP file.
215 ; Default Value: not set
216 ;pm.status_path = /status
218 ; The ping URI to call the monitoring page of FPM. If this value is not set, no
219 ; URI will be recognized as a ping page. This could be used to test from outside
220 ; that FPM is alive and responding, or to
221 ; - create a graph of FPM availability (rrd or such);
222 ; - remove a server from a group if it is not responding (load balancing);
223 ; - trigger alerts for the operating team (24/7).
224 ; Note: The value must start with a leading slash (/). The value can be
225 ; anything, but it may not be a good idea to use the .php extension or it
226 ; may conflict with a real PHP file.
227 ; Default Value: not set
230 ; This directive may be used to customize the response of a ping request. The
231 ; response is formatted as text/plain with a 200 response code.
232 ; Default Value: pong
233 ;ping.response = pong
235 ; The access log file
237 ;access.log = log/$pool.access.log
239 ; The access log format.
240 ; The following syntax is allowed
241 ; %%: the '%' character
242 ; %C: %CPU used by the request
243 ; it can accept the following format:
244 ; - %{user}C for user CPU only
245 ; - %{system}C for system CPU only
246 ; - %{total}C for user + system CPU (default)
247 ; %d: time taken to serve the request
248 ; it can accept the following format:
249 ; - %{seconds}d (default)
254 ; %e: an environment variable (same as $_ENV or $_SERVER)
255 ; it must be associated with embraces to specify the name of the env
256 ; variable. Some exemples:
257 ; - server specifics like: %{REQUEST_METHOD}e or %{SERVER_PROTOCOL}e
258 ; - HTTP headers like: %{HTTP_HOST}e or %{HTTP_USER_AGENT}e
259 ; %f: script filename
260 ; %l: content-length of the request (for POST request only)
262 ; %M: peak of memory allocated by PHP
263 ; it can accept the following format:
264 ; - %{bytes}M (default)
271 ; it must be associated with embraces to specify the name of the header:
274 ; - %{Transfert-Encoding}o
276 ; %p: PID of the child that serviced the request
277 ; %P: PID of the parent of the child that serviced the request
278 ; %q: the query string
279 ; %Q: the '?' character if query string exists
280 ; %r: the request URI (without the query string, see %q and %Q)
281 ; %R: remote IP address
282 ; %s: status (response code)
283 ; %t: server time the request was received
284 ; it can accept a strftime(3) format:
285 ; %d/%b/%Y:%H:%M:%S %z (default)
286 ; %T: time the log has been written (the request has finished)
287 ; it can accept a strftime(3) format:
288 ; %d/%b/%Y:%H:%M:%S %z (default)
291 ; Default: "%R - %u %t \"%m %r\" %s"
292 ;access.format = %R - %u %t "%m %r%Q%q" %s %f %{mili}d %{kilo}M %C%%
294 ; The log file for slow requests
295 ; Default Value: not set
296 ; Note: slowlog is mandatory if request_slowlog_timeout is set
297 ;slowlog = log/$pool.log.slow
299 ; The timeout for serving a single request after which a PHP backtrace will be
300 ; dumped to the 'slowlog' file. A value of '0s' means 'off'.
301 ; Available units: s(econds)(default), m(inutes), h(ours), or d(ays)
303 ;request_slowlog_timeout = 0
305 ; The timeout for serving a single request after which the worker process will
306 ; be killed. This option should be used when the 'max_execution_time' ini option
307 ; does not stop script execution for some reason. A value of '0' means 'off'.
308 ; Available units: s(econds)(default), m(inutes), h(ours), or d(ays)
310 ;request_terminate_timeout = 0
312 ; Set open file descriptor rlimit.
313 ; Default Value: system defined value
316 ; Set max core size rlimit.
317 ; Possible Values: 'unlimited' or an integer greater or equal to 0
318 ; Default Value: system defined value
321 ; Chroot to this directory at the start. This value must be defined as an
322 ; absolute path. When this value is not set, chroot is not used.
323 ; Note: you can prefix with '$prefix' to chroot to the pool prefix or one
324 ; of its subdirectories. If the pool prefix is not set, the global prefix
325 ; will be used instead.
326 ; Note: chrooting is a great security feature and should be used whenever
327 ; possible. However, all PHP paths will be relative to the chroot
328 ; (error_log, sessions.save_path, ...).
329 ; Default Value: not set
332 ; Chdir to this directory at the start.
333 ; Note: relative path can be used.
334 ; Default Value: current directory or / when chroot
337 ; Redirect worker stdout and stderr into main error log. If not set, stdout and
338 ; stderr will be redirected to /dev/null according to FastCGI specs.
339 ; Note: on highloaded environement, this can cause some delay in the page
340 ; process time (several ms).
342 ;catch_workers_output = yes
344 ; Limits the extensions of the main script FPM will allow to parse. This can
345 ; prevent configuration mistakes on the web server side. You should only limit
346 ; FPM to .php extensions to prevent malicious users to use other extensions to
348 ; Note: set an empty value to allow all extensions.
349 ; Default Value: .php
350 ;security.limit_extensions = .php .php3 .php4 .php5
352 ; Pass environment variables like LD_LIBRARY_PATH. All $VARIABLEs are taken from
353 ; the current environment.
354 ; Default Value: clean env
355 ;env[HOSTNAME] = $HOSTNAME
356 ;env[PATH] = /usr/local/bin:/usr/bin:/bin
361 ; Additional php.ini defines, specific to this pool of workers. These settings
362 ; overwrite the values previously defined in the php.ini. The directives are the
363 ; same as the PHP SAPI:
364 ; php_value/php_flag - you can set classic ini defines which can
365 ; be overwritten from PHP call 'ini_set'.
366 ; php_admin_value/php_admin_flag - these directives won't be overwritten by
368 ; For php_*flag, valid values are on, off, 1, 0, true, false, yes or no.
370 ; Defining 'extension' will load the corresponding shared extension from
371 ; extension_dir. Defining 'disable_functions' or 'disable_classes' will not
372 ; overwrite previously defined php.ini values, but will append the new value
375 ; Note: path INI options can be relative and will be expanded with the prefix
376 ; (pool, global or /usr)
378 ; Default Value: nothing is defined by default except the values in php.ini and
379 ; specified at startup with the -d argument
380 ;php_admin_value[sendmail_path] = /usr/sbin/sendmail -t -i -f www@my.domain.com
381 ;php_flag[display_errors] = off
382 ;php_admin_value[error_log] = /var/log/fpm-php.www.log
383 ;php_admin_flag[log_errors] = on
384 ;php_admin_value[memory_limit] = 32M