Advertisement
Guest User

etc__php-fpm__www.conf

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