說明:本配置文件是php8.0編譯安裝后得到的默認(rèn)配置文件,翻譯采用有道詞典,作者僅僅修改部分翻譯錯誤的地方,方便自己查看對應(yīng)的配置時作為參考使用。
譯文:/usr/local/php/etc/php-fpm.conf
;;;;;;;;;;;;;;;;;;;;;
; FPM配置;
;;;;;;;;;;;;;;;;;;;;;
; 這個配置文件中的所有相對路徑都是相對于PHP的安裝前綴(/usr/local/ PHP)的。
; 這個前綴可以通過使用命令行中的'-p'參數(shù)來動態(tài)更改。
;;;;;;;;;;;;;;;;;;
; 全局選項(xiàng);
;;;;;;;;;;;;;;;;;;
[global]
; Pid文件
; 注意:默認(rèn)前綴是/usr/local/php/var
; Default Value: none
; pid = run/php-fpm.pid
; 錯誤日志文件
; 如果設(shè)置為syslog,日志將被發(fā)送到syslogd,而不是寫入本地文件。
; 注意:默認(rèn)前綴是/usr/local/php/var
; Default Value: log/php-fpm.log
; error_log = log/php-fpm.log
; syslog_facility用于指定記錄消息的程序類型。
; 這讓syslogd指定來自不同設(shè)施的消息將以不同的方式處理。
; 參見syslog(3)獲取可能的值(ex daemon equiv LOG_DAEMON)
; Default Value: daemon
; syslog.facility = daemon
; syslog_ident是每個消息的前綴。如果在同一臺服務(wù)器上運(yùn)行多個FPM實(shí)例,
; 則可以更改默認(rèn)值,該值必須滿足常見需求。
; Default Value: php-fpm
; syslog.ident = php-fpm
; 日志級別
; 取值包括:alert、error、warning、notice、debug
; Default Value: notice
; log_level = notice
; 對單行中的字符數(shù)進(jìn)行日志限制(日志條目)。如果行超出了限制,它將被換行。
; 該限制適用于所有記錄的字符,包括消息前綴和后綴(如果存在的話)。
; 然而,新行字符不計入其中,因?yàn)樗辉谟涗浀轿募枋龇麜r出現(xiàn)。
; 這意味著在記錄到syslog時不存在新的行字符。
; Default Value: 1024
; log_limit = 4096
; 日志緩沖指定日志行是否被緩沖,這意味著該行是在單個寫操作中寫入的。
; 如果值為false,則數(shù)據(jù)直接寫入文件描述符。
; 這是一種實(shí)驗(yàn)性的選項(xiàng),可以潛在地提高日志記錄性能和一些繁重日志記錄場景的內(nèi)存使用。
; 如果將日志記錄到syslog,這個選項(xiàng)將被忽略,因?yàn)樗仨毧偸潜痪彌_。。
; Default value: yes
; log_buffering = no
; 如果這個數(shù)目的子進(jìn)程在emergency_restart_interval設(shè)置的時間間隔內(nèi)退出SIGSEGV或SIGBUS,
; 則FPM將重新啟動。值“0”表示“關(guān)閉”。
; Default Value: 0
; emergency_restart_threshold = 0
; emergency_restart_interval用于確定何時啟動安全重啟的時間間隔。
; 這對于處理加速器共享內(nèi)存中的意外損壞非常有用。
; 可用單位: s(秒)、m(分鐘)、h(小時) 或 d(天)
; 可用單位: s(econds), m(inutes), h(ours), or d(ays)
; 默認(rèn)單位: seconds
; Default Value: 0
; emergency_restart_interval = 0
; 子進(jìn)程等待主進(jìn)程信號反應(yīng)的時間限制。
; 可用單位: s(秒)、m(分鐘)、h(小時) 或 d(天)
; 默認(rèn)單位: seconds
; Default Value: 0
; process_control_timeout = 0
; FPM將分叉的最大進(jìn)程數(shù)。
; 這是為了在許多池中使用動態(tài)PM時控制全局進(jìn)程數(shù)量而設(shè)計的。小心使用。
; 備注:0表示無限制
; Default Value: 0
; process.max = 128
; 指定nice(2)優(yōu)先級應(yīng)用于主進(jìn)程(僅當(dāng)設(shè)置)。
; 取值范圍從-19(最高優(yōu)先級)到20(最低優(yōu)先級)。
; 注意:
; - 只有當(dāng)FPM主進(jìn)程作為根進(jìn)程啟動時,它才會工作
; - 除非另有指定,否則池進(jìn)程將繼承主進(jìn)程優(yōu)先級
; Default Value: no set
; process.priority = -19
; 發(fā)送FPM到后臺。設(shè)置為'no'以保持FPM在前臺進(jìn)行調(diào)試。
; Default Value: yes
; daemonize = yes
; 設(shè)置主進(jìn)程的打開文件描述符rlimit。
; Default Value: system defined value
; rlimit_files = 1024
; 設(shè)置主進(jìn)程的最大核心大小限制。
; 可能值:“無限”或大于或等于0的整數(shù)
; Default Value: system defined value
; rlimit_core = 0
; 指定FPM將使用的事件機(jī)制。以下是可用的:
; - select (any POSIX os)
; - poll (any POSIX os)
; - epoll (linux >= 2.5.44)
; - kqueue (FreeBSD >= 4.1, OpenBSD >= 2.9, NetBSD >= 2.0)
; - /dev/poll (Solaris >= 7)
; - port (Solaris >= 10)
; Default Value: not set (auto detection)
; events.mechanism = epoll
; 當(dāng)使用systemd集成構(gòu)建FPM時,請指定向systemd發(fā)送運(yùn)行狀況報告通知之間的間隔(以秒為單位)。
; 設(shè)置為0為禁用。
; 可用單位: s(秒)、m(分鐘)、h(小時)
; 默認(rèn)單位: seconds
; Default value: 10
; systemd_interval = 10
;;;;;;;;;;;;;;;;;;;;
; 池定義;
;;;;;;;;;;;;;;;;;;;;
; 可以使用不同的偵聽端口和不同的管理選項(xiàng)啟動多個子進(jìn)程池。
; 池的名稱將在日志和統(tǒng)計中使用。FPM可以處理的池的數(shù)量沒有限制。你的系統(tǒng)會告訴你的
; 包含一個或多個文件。如果glob(3)存在,則使用它包含來自glob(3)模式的一堆文件。
; 這個指令可以在文件的任何地方使用。
; 也可以使用相對路徑。它們的前綴將是:
; - 如果設(shè)置了全局前綴(-p參數(shù)) ,就使用全局前綴(-p參數(shù))
; - 否則使用默認(rèn)前綴 /usr/local/php
include=/usr/local/php/etc/php-fpm.d/*.conf
原文:/usr/local/php/etc/php-fpm.conf
;;;;;;;;;;;;;;;;;;;;;
; FPM Configuration ;
;;;;;;;;;;;;;;;;;;;;;
; All relative paths in this configuration file are relative to PHP's install
; prefix (/usr/local/php). This prefix can be dynamically changed by using the
; '-p' argument from the command line.
;;;;;;;;;;;;;;;;;;
; Global Options ;
;;;;;;;;;;;;;;;;;;
[global]
; Pid file
; Note: the default prefix is /usr/local/php/var
; Default Value: none
;pid = run/php-fpm.pid
; Error log file
; If it's set to "syslog", log is sent to syslogd instead of being written
; into a local file.
; Note: the default prefix is /usr/local/php/var
; Default Value: log/php-fpm.log
;error_log = log/php-fpm.log
; syslog_facility is used to specify what type of program is logging the
; message. This lets syslogd specify that messages from different facilities
; will be handled differently.
; See syslog(3) for possible values (ex daemon equiv LOG_DAEMON)
; Default Value: daemon
;syslog.facility = daemon
; syslog_ident is prepended to every message. If you have multiple FPM
; instances running on the same server, you can change the default value
; which must suit common needs.
; Default Value: php-fpm
;syslog.ident = php-fpm
; Log level
; Possible Values: alert, error, warning, notice, debug
; Default Value: notice
;log_level = notice
; Log limit on number of characters in the single line (log entry). If the
; line is over the limit, it is wrapped on multiple lines. The limit is for
; all logged characters including message prefix and suffix if present. However
; the new line character does not count into it as it is present only when
; logging to a file descriptor. It means the new line character is not present
; when logging to syslog.
; Default Value: 1024
;log_limit = 4096
; Log buffering specifies if the log line is buffered which means that the
; line is written in a single write operation. If the value is false, then the
; data is written directly into the file descriptor. It is an experimental
; option that can potentially improve logging performance and memory usage
; for some heavy logging scenarios. This option is ignored if logging to syslog
; as it has to be always buffered.
; Default value: yes
;log_buffering = no
; If this number of child processes exit with SIGSEGV or SIGBUS within the time
; interval set by emergency_restart_interval then FPM will restart. A value
; of '0' means 'Off'.
; Default Value: 0
;emergency_restart_threshold = 0
; Interval of time used by emergency_restart_interval to determine when
; a graceful restart will be initiated. This can be useful to work around
; accidental corruptions in an accelerator's shared memory.
; Available Units: s(econds), m(inutes), h(ours), or d(ays)
; Default Unit: seconds
; Default Value: 0
;emergency_restart_interval = 0
; Time limit for child processes to wait for a reaction on signals from master.
; Available units: s(econds), m(inutes), h(ours), or d(ays)
; Default Unit: seconds
; Default Value: 0
;process_control_timeout = 0
; The maximum number of processes FPM will fork. This has been designed to control
; the global number of processes when using dynamic PM within a lot of pools.
; Use it with caution.
; Note: A value of 0 indicates no limit
; Default Value: 0
; process.max = 128
; Specify the nice(2) priority to apply to the master process (only if set)
; The value can vary from -19 (highest priority) to 20 (lowest priority)
; Note: - It will only work if the FPM master process is launched as root
; - The pool process will inherit the master process priority
; unless specified otherwise
; Default Value: no set
; process.priority = -19
; Send FPM to background. Set to 'no' to keep FPM in foreground for debugging.
; Default Value: yes
;daemonize = yes
; Set open file descriptor rlimit for the master process.
; Default Value: system defined value
;rlimit_files = 1024
; Set max core size rlimit for the master process.
; Possible Values: 'unlimited' or an integer greater or equal to 0
; Default Value: system defined value
;rlimit_core = 0
; Specify the event mechanism FPM will use. The following is available:
; - select (any POSIX os)
; - poll (any POSIX os)
; - epoll (linux >= 2.5.44)
; - kqueue (FreeBSD >= 4.1, OpenBSD >= 2.9, NetBSD >= 2.0)
; - /dev/poll (Solaris >= 7)
; - port (Solaris >= 10)
; Default Value: not set (auto detection)
;events.mechanism = epoll
; When FPM is built with systemd integration, specify the interval,
; in seconds, between health report notification to systemd.
; Set to 0 to disable.
; Available Units: s(econds), m(inutes), h(ours)
; Default Unit: seconds
; Default value: 10
;systemd_interval = 10
;;;;;;;;;;;;;;;;;;;;
; Pool Definitions ;
;;;;;;;;;;;;;;;;;;;;
; Multiple pools of child processes may be started with different listening
; ports and different management options. The name of the pool will be
; used in logs and stats. There is no limitation on the number of pools which
; FPM can handle. Your system will tell you anyway :)
; Include one or more files. If glob(3) exists, it is used to include a bunch of
; files from a glob(3) pattern. This directive can be used everywhere in the
; file.
; Relative path can also be used. They will be prefixed by:
; - the global prefix if it's been set (-p argument)
; - /usr/local/php otherwise
include=/usr/local/php/etc/php-fpm.d/*.conf