Advertisement
Guest User

Php-fpm configuration file

a guest
Aug 7th, 2013
407
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 21.81 KB | None | 0 0
  1.  
  2. ;;;;;;;;;;;;;;;;;;;;;
  3. ; FPM Configuration ;
  4. ;;;;;;;;;;;;;;;;;;;;;
  5.  
  6. ; All relative paths in this configuration file are relative to PHP's install
  7. ; prefix (/usr). This prefix can be dynamicaly changed by using the
  8. ; '-p' argument from the command line.
  9.  
  10. ; Include one or more files. If glob(3) exists, it is used to include a bunch of
  11. ; files from a glob(3) pattern. This directive can be used everywhere in the
  12. ; file.
  13. ; Relative path can also be used. They will be prefixed by:
  14. ; - the global prefix if it's been set (-p argument)
  15. ; - /usr otherwise
  16. ;include=/etc/php/fpm.d/*.conf
  17.  
  18. ;;;;;;;;;;;;;;;;;;
  19. ; Global Options ;
  20. ;;;;;;;;;;;;;;;;;;
  21.  
  22. [global]
  23. ; Pid file
  24. ; Note: the default prefix is /var
  25. ; Default Value: none
  26. pid = /run/php-fpm/php-fpm.pid
  27.  
  28. ; Error log file
  29. ; If it's set to "syslog", log is sent to syslogd instead of being written
  30. ; in a local file.
  31. ; Note: the default prefix is /var
  32. ; Default Value: log/php-fpm.log
  33. ;error_log = log/php-fpm.log
  34.  
  35. ; syslog_facility is used to specify what type of program is logging the
  36. ; message. This lets syslogd specify that messages from different facilities
  37. ; will be handled differently.
  38. ; See syslog(3) for possible values (ex daemon equiv LOG_DAEMON)
  39. ; Default Value: daemon
  40. ;syslog.facility = daemon
  41.  
  42. ; syslog_ident is prepended to every message. If you have multiple FPM
  43. ; instances running on the same server, you can change the default value
  44. ; which must suit common needs.
  45. ; Default Value: php-fpm
  46. ;syslog.ident = php-fpm
  47.  
  48. ; Log level
  49. ; Possible Values: alert, error, warning, notice, debug
  50. ; Default Value: notice
  51. ;log_level = notice
  52.  
  53. ; If this number of child processes exit with SIGSEGV or SIGBUS within the time
  54. ; interval set by emergency_restart_interval then FPM will restart. A value
  55. ; of '0' means 'Off'.
  56. ; Default Value: 0
  57. ;emergency_restart_threshold = 0
  58.  
  59. ; Interval of time used by emergency_restart_interval to determine when
  60. ; a graceful restart will be initiated. This can be useful to work around
  61. ; accidental corruptions in an accelerator's shared memory.
  62. ; Available Units: s(econds), m(inutes), h(ours), or d(ays)
  63. ; Default Unit: seconds
  64. ; Default Value: 0
  65. ;emergency_restart_interval = 0
  66.  
  67. ; Time limit for child processes to wait for a reaction on signals from master.
  68. ; Available units: s(econds), m(inutes), h(ours), or d(ays)
  69. ; Default Unit: seconds
  70. ; Default Value: 0
  71. ;process_control_timeout = 0
  72.  
  73. ; The maximum number of processes FPM will fork. This has been design to control
  74. ; the global number of processes when using dynamic PM within a lot of pools.
  75. ; Use it with caution.
  76. ; Note: A value of 0 indicates no limit
  77. ; Default Value: 0
  78. ; process.max = 128
  79.  
  80. ; Specify the nice(2) priority to apply to the master process (only if set)
  81. ; The value can vary from -19 (highest priority) to 20 (lower priority)
  82. ; Note: - It will only work if the FPM master process is launched as root
  83. ; - The pool process will inherit the master process priority
  84. ; unless it specified otherwise
  85. ; Default Value: no set
  86. ; process.priority = -19
  87.  
  88. ; Send FPM to background. Set to 'no' to keep FPM in foreground for debugging.
  89. ; Default Value: yes
  90. ;daemonize = yes
  91.  
  92. ; Set open file descriptor rlimit for the master process.
  93. ; Default Value: system defined value
  94. ;rlimit_files = 1024
  95.  
  96. ; Set max core size rlimit for the master process.
  97. ; Possible Values: 'unlimited' or an integer greater or equal to 0
  98. ; Default Value: system defined value
  99. ;rlimit_core = 0
  100.  
  101. ; Specify the event mechanism FPM will use. The following is available:
  102. ; - select (any POSIX os)
  103. ; - poll (any POSIX os)
  104. ; - epoll (linux >= 2.5.44)
  105. ; - kqueue (FreeBSD >= 4.1, OpenBSD >= 2.9, NetBSD >= 2.0)
  106. ; - /dev/poll (Solaris >= 7)
  107. ; - port (Solaris >= 10)
  108. ; Default Value: not set (auto detection)
  109. ;events.mechanism = epoll
  110.  
  111. ; When FPM is build with systemd integration, specify the interval,
  112. ; in second, between health report notification to systemd.
  113. ; Set to 0 to disable.
  114. ; Available Units: s(econds), m(inutes), h(ours)
  115. ; Default Unit: seconds
  116. ; Default value: 10
  117. ;systemd_interval = 10
  118.  
  119. ;;;;;;;;;;;;;;;;;;;;
  120. ; Pool Definitions ;
  121. ;;;;;;;;;;;;;;;;;;;;
  122.  
  123. ; Multiple pools of child processes may be started with different listening
  124. ; ports and different management options. The name of the pool will be
  125. ; used in logs and stats. There is no limitation on the number of pools which
  126. ; FPM can handle. Your system will tell you anyway :)
  127.  
  128. ; Start a new pool named 'www'.
  129. ; the variable $pool can we used in any directive and will be replaced by the
  130. ; pool name ('www' here)
  131. [www]
  132.  
  133. ; Per pool prefix
  134. ; It only applies on the following directives:
  135. ; - 'slowlog'
  136. ; - 'listen' (unixsocket)
  137. ; - 'chroot'
  138. ; - 'chdir'
  139. ; - 'php_values'
  140. ; - 'php_admin_values'
  141. ; When not set, the global prefix (or /usr) applies instead.
  142. ; Note: This directive can also be relative to the global prefix.
  143. ; Default Value: none
  144. ;prefix = /path/to/pools/$pool
  145.  
  146. ; Unix user/group of processes
  147. ; Note: The user is mandatory. If the group is not set, the default user's group
  148. ; will be used.
  149. user = http
  150. group = http
  151.  
  152. ; The address on which to accept FastCGI requests.
  153. ; Valid syntaxes are:
  154. ; 'ip.add.re.ss:port' - to listen on a TCP socket to a specific address on
  155. ; a specific port;
  156. ; 'port' - to listen on a TCP socket to all addresses on a
  157. ; specific port;
  158. ; '/path/to/unix/socket' - to listen on a unix socket.
  159. ; Note: This value is mandatory.
  160. ;listen = 127.0.0.1:9000
  161. listen = /run/php-fpm/php-fpm.sock
  162.  
  163. ; Set listen(2) backlog.
  164. ; Default Value: 128 (-1 on FreeBSD and OpenBSD)
  165. ;listen.backlog = 128
  166.  
  167. ; Set permissions for unix socket, if one is used. In Linux, read/write
  168. ; permissions must be set in order to allow connections from a web server. Many
  169. ; BSD-derived systems allow connections regardless of permissions.
  170. ; Default Values: user and group are set as the running user
  171. ; mode is set to 0666
  172. listen.owner = http
  173. listen.group = http
  174. listen.mode = 0660
  175.  
  176. ; List of ipv4 addresses of FastCGI clients which are allowed to connect.
  177. ; Equivalent to the FCGI_WEB_SERVER_ADDRS environment variable in the original
  178. ; PHP FCGI (5.2.2+). Makes sense only with a tcp listening socket. Each address
  179. ; must be separated by a comma. If this value is left blank, connections will be
  180. ; accepted from any ip address.
  181. ; Default Value: any
  182. ;listen.allowed_clients = 127.0.0.1
  183.  
  184. ; Specify the nice(2) priority to apply to the pool processes (only if set)
  185. ; The value can vary from -19 (highest priority) to 20 (lower priority)
  186. ; Note: - It will only work if the FPM master process is launched as root
  187. ; - The pool processes will inherit the master process priority
  188. ; unless it specified otherwise
  189. ; Default Value: no set
  190. ; priority = -19
  191.  
  192. ; Choose how the process manager will control the number of child processes.
  193. ; Possible Values:
  194. ; static - a fixed number (pm.max_children) of child processes;
  195. ; dynamic - the number of child processes are set dynamically based on the
  196. ; following directives. With this process management, there will be
  197. ; always at least 1 children.
  198. ; pm.max_children - the maximum number of children that can
  199. ; be alive at the same time.
  200. ; pm.start_servers - the number of children created on startup.
  201. ; pm.min_spare_servers - the minimum number of children in 'idle'
  202. ; state (waiting to process). If the number
  203. ; of 'idle' processes is less than this
  204. ; number then some children will be created.
  205. ; pm.max_spare_servers - the maximum number of children in 'idle'
  206. ; state (waiting to process). If the number
  207. ; of 'idle' processes is greater than this
  208. ; number then some children will be killed.
  209. ; ondemand - no children are created at startup. Children will be forked when
  210. ; new requests will connect. The following parameter are used:
  211. ; pm.max_children - the maximum number of children that
  212. ; can be alive at the same time.
  213. ; pm.process_idle_timeout - The number of seconds after which
  214. ; an idle process will be killed.
  215. ; Note: This value is mandatory.
  216. pm = dynamic
  217.  
  218. ; The number of child processes to be created when pm is set to 'static' and the
  219. ; maximum number of child processes when pm is set to 'dynamic' or 'ondemand'.
  220. ; This value sets the limit on the number of simultaneous requests that will be
  221. ; served. Equivalent to the ApacheMaxClients directive with mpm_prefork.
  222. ; Equivalent to the PHP_FCGI_CHILDREN environment variable in the original PHP
  223. ; CGI. The below defaults are based on a server without much resources. Don't
  224. ; forget to tweak pm.* to fit your needs.
  225. ; Note: Used when pm is set to 'static', 'dynamic' or 'ondemand'
  226. ; Note: This value is mandatory.
  227. pm.max_children = 5
  228.  
  229. ; The number of child processes created on startup.
  230. ; Note: Used only when pm is set to 'dynamic'
  231. ; Default Value: min_spare_servers + (max_spare_servers - min_spare_servers) / 2
  232. pm.start_servers = 2
  233.  
  234. ; The desired minimum number of idle server processes.
  235. ; Note: Used only when pm is set to 'dynamic'
  236. ; Note: Mandatory when pm is set to 'dynamic'
  237. pm.min_spare_servers = 1
  238.  
  239. ; The desired maximum number of idle server processes.
  240. ; Note: Used only when pm is set to 'dynamic'
  241. ; Note: Mandatory when pm is set to 'dynamic'
  242. pm.max_spare_servers = 3
  243.  
  244. ; The number of seconds after which an idle process will be killed.
  245. ; Note: Used only when pm is set to 'ondemand'
  246. ; Default Value: 10s
  247. ;pm.process_idle_timeout = 10s;
  248.  
  249. ; The number of requests each child process should execute before respawning.
  250. ; This can be useful to work around memory leaks in 3rd party libraries. For
  251. ; endless request processing specify '0'. Equivalent to PHP_FCGI_MAX_REQUESTS.
  252. ; Default Value: 0
  253. ;pm.max_requests = 500
  254.  
  255. ; The URI to view the FPM status page. If this value is not set, no URI will be
  256. ; recognized as a status page. It shows the following informations:
  257. ; pool - the name of the pool;
  258. ; process manager - static, dynamic or ondemand;
  259. ; start time - the date and time FPM has started;
  260. ; start since - number of seconds since FPM has started;
  261. ; accepted conn - the number of request accepted by the pool;
  262. ; listen queue - the number of request in the queue of pending
  263. ; connections (see backlog in listen(2));
  264. ; max listen queue - the maximum number of requests in the queue
  265. ; of pending connections since FPM has started;
  266. ; listen queue len - the size of the socket queue of pending connections;
  267. ; idle processes - the number of idle processes;
  268. ; active processes - the number of active processes;
  269. ; total processes - the number of idle + active processes;
  270. ; max active processes - the maximum number of active processes since FPM
  271. ; has started;
  272. ; max children reached - number of times, the process limit has been reached,
  273. ; when pm tries to start more children (works only for
  274. ; pm 'dynamic' and 'ondemand');
  275. ; Value are updated in real time.
  276. ; Example output:
  277. ; pool: www
  278. ; process manager: static
  279. ; start time: 01/Jul/2011:17:53:49 +0200
  280. ; start since: 62636
  281. ; accepted conn: 190460
  282. ; listen queue: 0
  283. ; max listen queue: 1
  284. ; listen queue len: 42
  285. ; idle processes: 4
  286. ; active processes: 11
  287. ; total processes: 15
  288. ; max active processes: 12
  289. ; max children reached: 0
  290. ;
  291. ; By default the status page output is formatted as text/plain. Passing either
  292. ; 'html', 'xml' or 'json' in the query string will return the corresponding
  293. ; output syntax. Example:
  294. ; http://www.foo.bar/status
  295. ; http://www.foo.bar/status?json
  296. ; http://www.foo.bar/status?html
  297. ; http://www.foo.bar/status?xml
  298. ;
  299. ; By default the status page only outputs short status. Passing 'full' in the
  300. ; query string will also return status for each pool process.
  301. ; Example:
  302. ; http://www.foo.bar/status?full
  303. ; http://www.foo.bar/status?json&full
  304. ; http://www.foo.bar/status?html&full
  305. ; http://www.foo.bar/status?xml&full
  306. ; The Full status returns for each process:
  307. ; pid - the PID of the process;
  308. ; state - the state of the process (Idle, Running, ...);
  309. ; start time - the date and time the process has started;
  310. ; start since - the number of seconds since the process has started;
  311. ; requests - the number of requests the process has served;
  312. ; request duration - the duration in ยตs of the requests;
  313. ; request method - the request method (GET, POST, ...);
  314. ; request URI - the request URI with the query string;
  315. ; content length - the content length of the request (only with POST);
  316. ; user - the user (PHP_AUTH_USER) (or '-' if not set);
  317. ; script - the main script called (or '-' if not set);
  318. ; last request cpu - the %cpu the last request consumed
  319. ; it's always 0 if the process is not in Idle state
  320. ; because CPU calculation is done when the request
  321. ; processing has terminated;
  322. ; last request memory - the max amount of memory the last request consumed
  323. ; it's always 0 if the process is not in Idle state
  324. ; because memory calculation is done when the request
  325. ; processing has terminated;
  326. ; If the process is in Idle state, then informations are related to the
  327. ; last request the process has served. Otherwise informations are related to
  328. ; the current request being served.
  329. ; Example output:
  330. ; ************************
  331. ; pid: 31330
  332. ; state: Running
  333. ; start time: 01/Jul/2011:17:53:49 +0200
  334. ; start since: 63087
  335. ; requests: 12808
  336. ; request duration: 1250261
  337. ; request method: GET
  338. ; request URI: /test_mem.php?N=10000
  339. ; content length: 0
  340. ; user: -
  341. ; script: /home/fat/web/docs/php/test_mem.php
  342. ; last request cpu: 0.00
  343. ; last request memory: 0
  344. ;
  345. ; Note: There is a real-time FPM status monitoring sample web page available
  346. ; It's available in: ${prefix}/share/fpm/status.html
  347. ;
  348. ; Note: The value must start with a leading slash (/). The value can be
  349. ; anything, but it may not be a good idea to use the .php extension or it
  350. ; may conflict with a real PHP file.
  351. ; Default Value: not set
  352. ;pm.status_path = /status
  353.  
  354. ; The ping URI to call the monitoring page of FPM. If this value is not set, no
  355. ; URI will be recognized as a ping page. This could be used to test from outside
  356. ; that FPM is alive and responding, or to
  357. ; - create a graph of FPM availability (rrd or such);
  358. ; - remove a server from a group if it is not responding (load balancing);
  359. ; - trigger alerts for the operating team (24/7).
  360. ; Note: The value must start with a leading slash (/). The value can be
  361. ; anything, but it may not be a good idea to use the .php extension or it
  362. ; may conflict with a real PHP file.
  363. ; Default Value: not set
  364. ;ping.path = /ping
  365.  
  366. ; This directive may be used to customize the response of a ping request. The
  367. ; response is formatted as text/plain with a 200 response code.
  368. ; Default Value: pong
  369. ;ping.response = pong
  370.  
  371. ; The access log file
  372. ; Default: not set
  373. ;access.log = log/$pool.access.log
  374.  
  375. ; The access log format.
  376. ; The following syntax is allowed
  377. ; %%: the '%' character
  378. ; %C: %CPU used by the request
  379. ; it can accept the following format:
  380. ; - %{user}C for user CPU only
  381. ; - %{system}C for system CPU only
  382. ; - %{total}C for user + system CPU (default)
  383. ; %d: time taken to serve the request
  384. ; it can accept the following format:
  385. ; - %{seconds}d (default)
  386. ; - %{miliseconds}d
  387. ; - %{mili}d
  388. ; - %{microseconds}d
  389. ; - %{micro}d
  390. ; %e: an environment variable (same as $_ENV or $_SERVER)
  391. ; it must be associated with embraces to specify the name of the env
  392. ; variable. Some exemples:
  393. ; - server specifics like: %{REQUEST_METHOD}e or %{SERVER_PROTOCOL}e
  394. ; - HTTP headers like: %{HTTP_HOST}e or %{HTTP_USER_AGENT}e
  395. ; %f: script filename
  396. ; %l: content-length of the request (for POST request only)
  397. ; %m: request method
  398. ; %M: peak of memory allocated by PHP
  399. ; it can accept the following format:
  400. ; - %{bytes}M (default)
  401. ; - %{kilobytes}M
  402. ; - %{kilo}M
  403. ; - %{megabytes}M
  404. ; - %{mega}M
  405. ; %n: pool name
  406. ; %o: ouput header
  407. ; it must be associated with embraces to specify the name of the header:
  408. ; - %{Content-Type}o
  409. ; - %{X-Powered-By}o
  410. ; - %{Transfert-Encoding}o
  411. ; - ....
  412. ; %p: PID of the child that serviced the request
  413. ; %P: PID of the parent of the child that serviced the request
  414. ; %q: the query string
  415. ; %Q: the '?' character if query string exists
  416. ; %r: the request URI (without the query string, see %q and %Q)
  417. ; %R: remote IP address
  418. ; %s: status (response code)
  419. ; %t: server time the request was received
  420. ; it can accept a strftime(3) format:
  421. ; %d/%b/%Y:%H:%M:%S %z (default)
  422. ; %T: time the log has been written (the request has finished)
  423. ; it can accept a strftime(3) format:
  424. ; %d/%b/%Y:%H:%M:%S %z (default)
  425. ; %u: remote user
  426. ;
  427. ; Default: "%R - %u %t \"%m %r\" %s"
  428. ;access.format = "%R - %u %t \"%m %r%Q%q\" %s %f %{mili}d %{kilo}M %C%%"
  429.  
  430. ; The log file for slow requests
  431. ; Default Value: not set
  432. ; Note: slowlog is mandatory if request_slowlog_timeout is set
  433. ;slowlog = log/$pool.log.slow
  434.  
  435. ; The timeout for serving a single request after which a PHP backtrace will be
  436. ; dumped to the 'slowlog' file. A value of '0s' means 'off'.
  437. ; Available units: s(econds)(default), m(inutes), h(ours), or d(ays)
  438. ; Default Value: 0
  439. ;request_slowlog_timeout = 0
  440.  
  441. ; The timeout for serving a single request after which the worker process will
  442. ; be killed. This option should be used when the 'max_execution_time' ini option
  443. ; does not stop script execution for some reason. A value of '0' means 'off'.
  444. ; Available units: s(econds)(default), m(inutes), h(ours), or d(ays)
  445. ; Default Value: 0
  446. ;request_terminate_timeout = 0
  447.  
  448. ; Set open file descriptor rlimit.
  449. ; Default Value: system defined value
  450. ;rlimit_files = 1024
  451.  
  452. ; Set max core size rlimit.
  453. ; Possible Values: 'unlimited' or an integer greater or equal to 0
  454. ; Default Value: system defined value
  455. ;rlimit_core = 0
  456.  
  457. ; Chroot to this directory at the start. This value must be defined as an
  458. ; absolute path. When this value is not set, chroot is not used.
  459. ; Note: you can prefix with '$prefix' to chroot to the pool prefix or one
  460. ; of its subdirectories. If the pool prefix is not set, the global prefix
  461. ; will be used instead.
  462. ; Note: chrooting is a great security feature and should be used whenever
  463. ; possible. However, all PHP paths will be relative to the chroot
  464. ; (error_log, sessions.save_path, ...).
  465. ; Default Value: not set
  466. ;chroot =
  467.  
  468. ; Chdir to this directory at the start.
  469. ; Note: relative path can be used.
  470. ; Default Value: current directory or / when chroot
  471. ;chdir = /srv/http
  472.  
  473. ; Redirect worker stdout and stderr into main error log. If not set, stdout and
  474. ; stderr will be redirected to /dev/null according to FastCGI specs.
  475. ; Note: on highloaded environement, this can cause some delay in the page
  476. ; process time (several ms).
  477. ; Default Value: no
  478. ;catch_workers_output = yes
  479.  
  480. ; Limits the extensions of the main script FPM will allow to parse. This can
  481. ; prevent configuration mistakes on the web server side. You should only limit
  482. ; FPM to .php extensions to prevent malicious users to use other extensions to
  483. ; exectute php code.
  484. ; Note: set an empty value to allow all extensions.
  485. ; Default Value: .php
  486. security.limit_extensions = .php .html .htm
  487.  
  488. ; Pass environment variables like LD_LIBRARY_PATH. All $VARIABLEs are taken from
  489. ; the current environment.
  490. ; Default Value: clean env
  491. ;env[HOSTNAME] = $HOSTNAME
  492. ;env[PATH] = /usr/local/bin:/usr/bin:/bin
  493. ;env[TMP] = /tmp
  494. ;env[TMPDIR] = /tmp
  495. ;env[TEMP] = /tmp
  496.  
  497. ; Additional php.ini defines, specific to this pool of workers. These settings
  498. ; overwrite the values previously defined in the php.ini. The directives are the
  499. ; same as the PHP SAPI:
  500. ; php_value/php_flag - you can set classic ini defines which can
  501. ; be overwritten from PHP call 'ini_set'.
  502. ; php_admin_value/php_admin_flag - these directives won't be overwritten by
  503. ; PHP call 'ini_set'
  504. ; For php_*flag, valid values are on, off, 1, 0, true, false, yes or no.
  505.  
  506. ; Defining 'extension' will load the corresponding shared extension from
  507. ; extension_dir. Defining 'disable_functions' or 'disable_classes' will not
  508. ; overwrite previously defined php.ini values, but will append the new value
  509. ; instead.
  510.  
  511. ; Note: path INI options can be relative and will be expanded with the prefix
  512. ; (pool, global or /usr)
  513.  
  514. ; Default Value: nothing is defined by default except the values in php.ini and
  515. ; specified at startup with the -d argument
  516. ;php_admin_value[sendmail_path] = /usr/sbin/sendmail -t -i -f www@my.domain.com
  517. ;php_flag[display_errors] = off
  518. ;php_admin_value[error_log] = /var/log/fpm-php.www.log
  519. ;php_admin_flag[log_errors] = on
  520. ;php_admin_value[memory_limit] = 32M
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement