Advertisement
Guest User

php-fpm.conf

a guest
Oct 8th, 2010
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 11.29 KB | None | 0 0
  1. ;;;;;;;;;;;;;;;;;;;;;
  2. ; FPM Configuration ;
  3. ;;;;;;;;;;;;;;;;;;;;;
  4.  
  5. ; All relative paths in this configuration file are relative to PHP's install
  6. ; prefix.
  7.  
  8. ; Include one or more files. If glob(3) exists, it is used to include a bunch of
  9. ; files from a glob(3) pattern. This directive can be used everywhere in the
  10. ; file.
  11. ;include=/usr/local/etc/fpm.d/*.conf
  12.  
  13. ;;;;;;;;;;;;;;;;;;
  14. ; Global Options ;
  15. ;;;;;;;;;;;;;;;;;;
  16.  
  17. [global]
  18. ; Pid file
  19. ; Default Value: none
  20. pid = /usr/local/var/run/php-fpm.pid
  21.  
  22. ; Error log file
  23. ; Default Value: /usr/local/var/log/php-fpm.log
  24. error_log = /usr/local/var/log/php-fpm.log
  25.  
  26. ; Log level
  27. ; Possible Values: alert, error, warning, notice, debug
  28. ; Default Value: notice
  29. log_level = debug
  30.  
  31. ; If this number of child processes exit with SIGSEGV or SIGBUS within the time
  32. ; interval set by emergency_restart_interval then FPM will restart. A value
  33. ; of '0' means 'Off'.
  34. ; Default Value: 0
  35. ;emergency_restart_threshold = 0
  36.  
  37. ; Interval of time used by emergency_restart_interval to determine when
  38. ; a graceful restart will be initiated. This can be useful to work around
  39. ; accidental corruptions in an accelerator's shared memory.
  40. ; Available Units: s(econds), m(inutes), h(ours), or d(ays)
  41. ; Default Unit: seconds
  42. ; Default Value: 0
  43. ;emergency_restart_interval = 0
  44.  
  45. ; Time limit for child processes to wait for a reaction on signals from master.
  46. ; Available units: s(econds), m(inutes), h(ours), or d(ays)
  47. ; Default Unit: seconds
  48. ; Default Value: 0
  49. ;process_control_timeout = 0
  50.  
  51. ; Send FPM to background. Set to 'no' to keep FPM in foreground for debugging.
  52. ; Default Value: yes
  53. ;daemonize = yes
  54.  
  55. ;;;;;;;;;;;;;;;;;;;;
  56. ; Pool Definitions ;
  57. ;;;;;;;;;;;;;;;;;;;;
  58.  
  59. ; Multiple pools of child processes may be started with different listening
  60. ; ports and different management options. The name of the pool will be
  61. ; used in logs and stats. There is no limitation on the number of pools which
  62. ; FPM can handle. Your system will tell you anyway :)
  63.  
  64. ; Start a new pool named 'www'.
  65. [www]
  66.  
  67. ; The address on which to accept FastCGI requests.
  68. ; Valid syntaxes are:
  69. ; 'ip.add.re.ss:port' - to listen on a TCP socket to a specific address on
  70. ; a specific port;
  71. ; 'port' - to listen on a TCP socket to all addresses on a
  72. ; specific port;
  73. ; '/path/to/unix/socket' - to listen on a unix socket.
  74. ; Note: This value is mandatory.
  75. listen = 192.168.1.3:9000
  76.  
  77. ; Set listen(2) backlog. A value of '-1' means unlimited.
  78. ; Default Value: -1
  79. ;listen.backlog = -1
  80.  
  81. ; List of ipv4 addresses of FastCGI clients which are allowed to connect.
  82. ; Equivalent to the FCGI_WEB_SERVER_ADDRS environment variable in the original
  83. ; PHP FCGI (5.2.2+). Makes sense only with a tcp listening socket. Each address
  84. ; must be separated by a comma. If this value is left blank, connections will be
  85. ; accepted from any ip address.
  86. ; Default Value: any
  87. listen.allowed_clients = 192.168.1.3,192.168.1.2
  88.  
  89. ; Set permissions for unix socket, if one is used. In Linux, read/write
  90. ; permissions must be set in order to allow connections from a web server. Many
  91. ; BSD-derived systems allow connections regardless of permissions.
  92. ; Default Values: user and group are set as the running user
  93. ; mode is set to 0666
  94. ;listen.mode = 0666
  95.  
  96. ; Unix user/group of processes
  97. ; Note: The user is mandatory. If the group is not set, the default user's group
  98. ; will be used.
  99. user = www-data
  100. group = www-data
  101.  
  102. ; Choose how the process manager will control the number of child processes.
  103. ; Possible Values:
  104. ; static - a fixed number (pm.max_children) of child processes;
  105. ; dynamic - the number of child processes are set dynamically based on the
  106. ; following directives:
  107. ; pm.max_children - the maximum number of children that can
  108. ; be alive at the same time.
  109. ; pm.start_servers - the number of children created on startup.
  110. ; pm.min_spare_servers - the minimum number of children in 'idle'
  111. ; state (waiting to process). If the number
  112. ; of 'idle' processes is less than this
  113. ; number then some children will be created.
  114. ; pm.max_spare_servers - the maximum number of children in 'idle'
  115. ; state (waiting to process). If the number
  116. ; of 'idle' processes is greater than this
  117. ; number then some children will be killed.
  118. ; Note: This value is mandatory.
  119. pm = static
  120.  
  121. ; The number of child processes to be created when pm is set to 'static' and the
  122. ; maximum number of child processes to be created when pm is set to 'dynamic'.
  123. ; This value sets the limit on the number of simultaneous requests that will be
  124. ; served. Equivalent to the ApacheMaxClients directive with mpm_prefork.
  125. ; Equivalent to the PHP_FCGI_CHILDREN environment variable in the original PHP
  126. ; CGI.
  127. ; Note: Used when pm is set to either 'static' or 'dynamic'
  128. ; Note: This value is mandatory.
  129. pm.max_children = 100
  130.  
  131. ; The number of child processes created on startup.
  132. ; Note: Used only when pm is set to 'dynamic'
  133. ; Default Value: min_spare_servers + (max_spare_servers - min_spare_servers) / 2
  134. ;pm.start_servers =25
  135.  
  136. ; The desired minimum number of idle server processes.
  137. ; Note: Used only when pm is set to 'dynamic'
  138. ; Note: Mandatory when pm is set to 'dynamic'
  139. ;pm.min_spare_servers = 10
  140.  
  141. ; The desired maximum number of idle server processes.
  142. ; Note: Used only when pm is set to 'dynamic'
  143. ; Note: Mandatory when pm is set to 'dynamic'
  144. ;pm.max_spare_servers = 35
  145.  
  146. ; The number of requests each child process should execute before respawning.
  147. ; This can be useful to work around memory leaks in 3rd party libraries. For
  148. ; endless request processing specify '0'. Equivalent to PHP_FCGI_MAX_REQUESTS.
  149. ; Default Value: 0
  150. ;pm.max_requests = 500
  151.  
  152. ; The URI to view the FPM status page. If this value is not set, no URI will be
  153. ; recognized as a status page. By default, the status page shows the following
  154. ; information:
  155. ; accepted conn - the number of request accepted by the pool;
  156. ; pool - the name of the pool;
  157. ; process manager - static or dynamic;
  158. ; idle processes - the number of idle processes;
  159. ; active processes - the number of active processes;
  160. ; total processes - the number of idle + active processes.
  161. ; The values of 'idle processes', 'active processes' and 'total processes' are
  162. ; updated each second. The value of 'accepted conn' is updated in real time.
  163. ; Example output:
  164. ; accepted conn: 12073
  165. ; pool: www
  166. ; process manager: static
  167. ; idle processes: 35
  168. ; active processes: 65
  169. ; total processes: 100
  170. ; By default the status page output is formatted as text/plain. Passing either
  171. ; 'html' or 'json' as a query string will return the corresponding output
  172. ; syntax. Example:
  173. ; http://www.foo.bar/status
  174. ; http://www.foo.bar/status?json
  175. ; http://www.foo.bar/status?html
  176. ; Note: The value must start with a leading slash (/). The value can be
  177. ; anything, but it may not be a good idea to use the .php extension or it
  178. ; may conflict with a real PHP file.
  179. ; Default Value: not set
  180. ;pm.status_path = /status
  181.  
  182. ; The ping URI to call the monitoring page of FPM. If this value is not set, no
  183. ; URI will be recognized as a ping page. This could be used to test from outside
  184. ; that FPM is alive and responding, or to
  185. ; - create a graph of FPM availability (rrd or such);
  186. ; - remove a server from a group if it is not responding (load balancing);
  187. ; - trigger alerts for the operating team (24/7).
  188. ; Note: The value must start with a leading slash (/). The value can be
  189. ; anything, but it may not be a good idea to use the .php extension or it
  190. ; may conflict with a real PHP file.
  191. ; Default Value: not set
  192. ;ping.path = /ping
  193.  
  194. ; This directive may be used to customize the response of a ping request. The
  195. ; response is formatted as text/plain with a 200 response code.
  196. ; Default Value: pong
  197. ;ping.response = pong
  198.  
  199. ; The timeout for serving a single request after which the worker process will
  200. ; be killed. This option should be used when the 'max_execution_time' ini option
  201. ; does not stop script execution for some reason. A value of '0' means 'off'.
  202. ; Available units: s(econds)(default), m(inutes), h(ours), or d(ays)
  203. ; Default Value: 0
  204. ;request_terminate_timeout = 0
  205.  
  206. ; The timeout for serving a single request after which a PHP backtrace will be
  207. ; dumped to the 'slowlog' file. A value of '0s' means 'off'.
  208. ; Available units: s(econds)(default), m(inutes), h(ours), or d(ays)
  209. ; Default Value: 0
  210. ;request_slowlog_timeout = 0
  211.  
  212. ; The log file for slow requests
  213. ; Default Value: /usr/local/var/log/php-fpm.log.slow
  214. ;slowlog = /usr/local/var/log/php-fpm.log.slow
  215.  
  216. ; Set open file descriptor rlimit.
  217. ; Default Value: system defined value
  218. ;rlimit_files = 1024
  219.  
  220. ; Set max core size rlimit.
  221. ; Possible Values: 'unlimited' or an integer greater or equal to 0
  222. ; Default Value: system defined value
  223. ;rlimit_core = 0
  224.  
  225. ; Chroot to this directory at the start. This value must be defined as an
  226. ; absolute path. When this value is not set, chroot is not used.
  227. ; Note: chrooting is a great security feature and should be used whenever
  228. ; possible. However, all PHP paths will be relative to the chroot
  229. ; (error_log, sessions.save_path, ...).
  230. ; Default Value: not set
  231. ;chroot =
  232.  
  233. ; Chdir to this directory at the start. This value must be an absolute path.
  234. ; Default Value: current directory or / when chroot
  235. ;chdir = /var/www
  236.  
  237. ; Redirect worker stdout and stderr into main error log. If not set, stdout and
  238. ; stderr will be redirected to /dev/null according to FastCGI specs.
  239. ; Default Value: no
  240. ;catch_workers_output = yes
  241.  
  242. ; Pass environment variables like LD_LIBRARY_PATH. All $VARIABLEs are taken from
  243. ; the current environment.
  244. ; Default Value: clean env
  245. ;env[HOSTNAME] = $HOSTNAME
  246. ;env[PATH] = /usr/local/bin:/usr/bin:/bin
  247. ;env[TMP] = /tmp
  248. ;env[TMPDIR] = /tmp
  249. ;env[TEMP] = /tmp
  250.  
  251. ; Additional php.ini defines, specific to this pool of workers. These settings
  252. ; overwrite the values previously defined in the php.ini. The directives are the
  253. ; same as the PHP SAPI:
  254. ; php_value/php_flag - you can set classic ini defines which can
  255. ; be overwritten from PHP call 'ini_set'.
  256. ; php_admin_value/php_admin_flag - these directives won't be overwritten by
  257. ; PHP call 'ini_set'
  258. ; For php_*flag, valid values are on, off, 1, 0, true, false, yes or no.
  259.  
  260. ; Defining 'extension' will load the corresponding shared extension from
  261. ; extension_dir. Defining 'disable_functions' or 'disable_classes' will not
  262. ; overwrite previously defined php.ini values, but will append the new value
  263. ; instead.
  264.  
  265. ; Default Value: nothing is defined by default except the values in php.ini and
  266. ; specified at startup with the -d argument
  267. ;php_admin_value[sendmail_path] = /usr/sbin/sendmail -t -i -f www@my.domain.com
  268. ;php_flag[display_errors] = off
  269. ;php_admin_value[error_log] = /var/log/fpm-php.www.log
  270. ;php_admin_flag[log_errors] = on
  271. ;php_admin_value[memory_limit] = 32M
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement