Advertisement
sandyd

php-fpm default config

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