php-fpm.conf 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251
  1. ; Start a new pool named 'www'.
  2. ; the variable $pool can we used in any directive and will be replaced by the
  3. ; pool name ('www' here)
  4. [YNH_WWW_APP]
  5. ; Per pool prefix
  6. ; It only applies on the following directives:
  7. ; - 'slowlog'
  8. ; - 'listen' (unixsocket)
  9. ; - 'chroot'
  10. ; - 'chdir'
  11. ; - 'php_values'
  12. ; - 'php_admin_values'
  13. ; When not set, the global prefix (or /usr) applies instead.
  14. ; Note: This directive can also be relative to the global prefix.
  15. ; Default Value: none
  16. ;prefix = /path/to/pools/$pool
  17. ; The address on which to accept FastCGI requests.
  18. ; Valid syntaxes are:
  19. ; 'ip.add.re.ss:port' - to listen on a TCP socket to a specific address on
  20. ; a specific port;
  21. ; 'port' - to listen on a TCP socket to all addresses on a
  22. ; specific port;
  23. ; '/path/to/unix/socket' - to listen on a unix socket.
  24. ; Note: This value is mandatory.
  25. listen = /var/run/php5-fpm-YNH_WWW_APP.sock
  26. ; Set listen(2) backlog. A value of '-1' means unlimited.
  27. ; Default Value: 128 (-1 on FreeBSD and OpenBSD)
  28. ;listen.backlog = -1
  29. ; List of ipv4 addresses of FastCGI clients which are allowed to connect.
  30. ; Equivalent to the FCGI_WEB_SERVER_ADDRS environment variable in the original
  31. ; PHP FCGI (5.2.2+). Makes sense only with a tcp listening socket. Each address
  32. ; must be separated by a comma. If this value is left blank, connections will be
  33. ; accepted from any ip address.
  34. ; Default Value: any
  35. ;listen.allowed_clients = 127.0.0.1
  36. ; Set permissions for unix socket, if one is used. In Linux, read/write
  37. ; permissions must be set in order to allow connections from a web server. Many
  38. ; BSD-derived systems allow connections regardless of permissions.
  39. ; Default Values: user and group are set as the running user
  40. ; mode is set to 0666
  41. listen.owner = www-data
  42. listen.group = www-data
  43. listen.mode = 0600
  44. ; Unix user/group of processes
  45. ; Note: The user is mandatory. If the group is not set, the default user's group
  46. ; will be used.
  47. user = www-data
  48. group = www-data
  49. ; Choose how the process manager will control the number of child processes.
  50. ; Possible Values:
  51. ; static - a fixed number (pm.max_children) of child processes;
  52. ; dynamic - the number of child processes are set dynamically based on the
  53. ; following directives:
  54. ; pm.max_children - the maximum number of children that can
  55. ; be alive at the same time.
  56. ; pm.start_servers - the number of children created on startup.
  57. ; pm.min_spare_servers - the minimum number of children in 'idle'
  58. ; state (waiting to process). If the number
  59. ; of 'idle' processes is less than this
  60. ; number then some children will be created.
  61. ; pm.max_spare_servers - the maximum number of children in 'idle'
  62. ; state (waiting to process). If the number
  63. ; of 'idle' processes is greater than this
  64. ; number then some children will be killed.
  65. ; Note: This value is mandatory.
  66. pm = dynamic
  67. ; The number of child processes to be created when pm is set to 'static' and the
  68. ; maximum number of child processes to be created when pm is set to 'dynamic'.
  69. ; This value sets the limit on the number of simultaneous requests that will be
  70. ; served. Equivalent to the ApacheMaxClients directive with mpm_prefork.
  71. ; Equivalent to the PHP_FCGI_CHILDREN environment variable in the original PHP
  72. ; CGI.
  73. ; Note: Used when pm is set to either 'static' or 'dynamic'
  74. ; Note: This value is mandatory.
  75. pm.max_children = 6
  76. ; The number of child processes created on startup.
  77. ; Note: Used only when pm is set to 'dynamic'
  78. ; Default Value: min_spare_servers + (max_spare_servers - min_spare_servers) / 2
  79. pm.start_servers = 3
  80. ; The desired minimum number of idle server processes.
  81. ; Note: Used only when pm is set to 'dynamic'
  82. ; Note: Mandatory when pm is set to 'dynamic'
  83. pm.min_spare_servers = 3
  84. ; The desired maximum number of idle server processes.
  85. ; Note: Used only when pm is set to 'dynamic'
  86. ; Note: Mandatory when pm is set to 'dynamic'
  87. pm.max_spare_servers = 5
  88. ; The number of requests each child process should execute before respawning.
  89. ; This can be useful to work around memory leaks in 3rd party libraries. For
  90. ; endless request processing specify '0'. Equivalent to PHP_FCGI_MAX_REQUESTS.
  91. ; Default Value: 0
  92. pm.max_requests = 500
  93. ; The URI to view the FPM status page. If this value is not set, no URI will be
  94. ; recognized as a status page. By default, the status page shows the following
  95. ; information:
  96. ; accepted conn - the number of request accepted by the pool;
  97. ; pool - the name of the pool;
  98. ; process manager - static or dynamic;
  99. ; idle processes - the number of idle processes;
  100. ; active processes - the number of active processes;
  101. ; total processes - the number of idle + active processes.
  102. ; max children reached - number of times, the process limit has been reached,
  103. ; when pm tries to start more children (works only for
  104. ; pm 'dynamic')
  105. ; The values of 'idle processes', 'active processes' and 'total processes' are
  106. ; updated each second. The value of 'accepted conn' is updated in real time.
  107. ; Example output:
  108. ; accepted conn: 12073
  109. ; pool: www
  110. ; process manager: static
  111. ; idle processes: 35
  112. ; active processes: 65
  113. ; total processes: 100
  114. ; max children reached: 1
  115. ; By default the status page output is formatted as text/plain. Passing either
  116. ; 'html' or 'json' as a query string will return the corresponding output
  117. ; syntax. Example:
  118. ; http://www.foo.bar/status
  119. ; http://www.foo.bar/status?json
  120. ; http://www.foo.bar/status?html
  121. ; Note: The value must start with a leading slash (/). The value can be
  122. ; anything, but it may not be a good idea to use the .php extension or it
  123. ; may conflict with a real PHP file.
  124. ; Default Value: not set
  125. pm.status_path = /fpm-status
  126. ; The ping URI to call the monitoring page of FPM. If this value is not set, no
  127. ; URI will be recognized as a ping page. This could be used to test from outside
  128. ; that FPM is alive and responding, or to
  129. ; - create a graph of FPM availability (rrd or such);
  130. ; - remove a server from a group if it is not responding (load balancing);
  131. ; - trigger alerts for the operating team (24/7).
  132. ; Note: The value must start with a leading slash (/). The value can be
  133. ; anything, but it may not be a good idea to use the .php extension or it
  134. ; may conflict with a real PHP file.
  135. ; Default Value: not set
  136. ping.path = /ping
  137. ; This directive may be used to customize the response of a ping request. The
  138. ; response is formatted as text/plain with a 200 response code.
  139. ; Default Value: pong
  140. ;ping.response = pong
  141. ; The timeout for serving a single request after which the worker process will
  142. ; be killed. This option should be used when the 'max_execution_time' ini option
  143. ; does not stop script execution for some reason. A value of '0' means 'off'.
  144. ; Available units: s(econds)(default), m(inutes), h(ours), or d(ays)
  145. ; Default Value: 0
  146. request_terminate_timeout = 120s
  147. ; The timeout for serving a single request after which a PHP backtrace will be
  148. ; dumped to the 'slowlog' file. A value of '0s' means 'off'.
  149. ; Available units: s(econds)(default), m(inutes), h(ours), or d(ays)
  150. ; Default Value: 0
  151. request_slowlog_timeout = 5s
  152. ; The log file for slow requests
  153. ; Default Value: not set
  154. ; Note: slowlog is mandatory if request_slowlog_timeout is set
  155. slowlog = /var/log/nginx/YNH_WWW_APP.slow.log
  156. ; Set open file descriptor rlimit.
  157. ; Default Value: system defined value
  158. rlimit_files = 4096
  159. ; Set max core size rlimit.
  160. ; Possible Values: 'unlimited' or an integer greater or equal to 0
  161. ; Default Value: system defined value
  162. rlimit_core = 0
  163. ; Chroot to this directory at the start. This value must be defined as an
  164. ; absolute path. When this value is not set, chroot is not used.
  165. ; Note: you can prefix with '$prefix' to chroot to the pool prefix or one
  166. ; of its subdirectories. If the pool prefix is not set, the global prefix
  167. ; will be used instead.
  168. ; Note: chrooting is a great security feature and should be used whenever
  169. ; possible. However, all PHP paths will be relative to the chroot
  170. ; (error_log, sessions.save_path, ...).
  171. ; Default Value: not set
  172. ;chroot =
  173. ; Chdir to this directory at the start.
  174. ; Note: relative path can be used.
  175. ; Default Value: current directory or / when chroot
  176. chdir = /var/www/YNH_WWW_ALIAS
  177. ; Redirect worker stdout and stderr into main error log. If not set, stdout and
  178. ; stderr will be redirected to /dev/null according to FastCGI specs.
  179. ; Note: on highloaded environement, this can cause some delay in the page
  180. ; process time (several ms).
  181. ; Default Value: no
  182. catch_workers_output = yes
  183. ; Pass environment variables like LD_LIBRARY_PATH. All $VARIABLEs are taken from
  184. ; the current environment.
  185. ; Default Value: clean env
  186. ;env[HOSTNAME] = $HOSTNAME
  187. ;env[PATH] = /usr/local/bin:/usr/bin:/bin
  188. ;env[TMP] = /tmp
  189. ;env[TMPDIR] = /tmp
  190. ;env[TEMP] = /tmp
  191. ; Additional php.ini defines, specific to this pool of workers. These settings
  192. ; overwrite the values previously defined in the php.ini. The directives are the
  193. ; same as the PHP SAPI:
  194. ; php_value/php_flag - you can set classic ini defines which can
  195. ; be overwritten from PHP call 'ini_set'.
  196. ; php_admin_value/php_admin_flag - these directives won't be overwritten by
  197. ; PHP call 'ini_set'
  198. ; For php_*flag, valid values are on, off, 1, 0, true, false, yes or no.
  199. ; Defining 'extension' will load the corresponding shared extension from
  200. ; extension_dir. Defining 'disable_functions' or 'disable_classes' will not
  201. ; overwrite previously defined php.ini values, but will append the new value
  202. ; instead.
  203. ; Note: path INI options can be relative and will be expanded with the prefix
  204. ; (pool, global or /usr)
  205. ; Default Value: nothing is defined by default except the values in php.ini and
  206. ; specified at startup with the -d argument
  207. ;php_admin_value[sendmail_path] = /usr/sbin/sendmail -t -i -f www@my.domain.com
  208. ;php_flag[display_errors] = off
  209. ;php_admin_value[error_log] = /var/log/fpm-php.www.log
  210. ;php_admin_flag[log_errors] = on
  211. ;php_admin_value[memory_limit] = 32M
  212. # Common values to change to increase file upload limit
  213. ;php_value[upload_max_filesize] = 50M
  214. ;php_value[post_max_size] = 50M
  215. ;php_value[mail.add_x_header] = Off
  216. # Other common parameters
  217. ;php_value[max_execution_time] = 600
  218. ;php_value[max_input_time] = 300
  219. ;php_value[memory_limit] = 256M
  220. ;php_value[short_open_tag] = On