Runtime configuration
The FPM configuration file isPhp-fpm.confThe syntax is similarPHP. ini.
Php-fpm.conf Global configuration segment
-
-
PID String
-
-
PID file location. The default value is null.
-
-
Error_log String
-
-
Location of the error log. Default Value:Installation path # install_prefix #/log/php-fpm.log.
-
-
Log_level String
-
-
Error level. available level: Alert (must be handled immediately), error (error), warning (warning), notice (important information), debug (debugging information ). default Value: Notice.
-
-
Emergency_restart_threshold Int
-
-
If the sub-processEmergency_restart_intervalIf you receive the SIGSEGV or sigbus exit information number set by this parameter within the set time, FPM restarts. 0 indicates 'disabling this function'. Default Value: 0 (disabled ).
-
-
Emergency_restart_interval Mixed
-
-
Emergency_restart_interval is used to set the interval of smooth restart. this helps solve the problem of shared memory usage in the accelerator. available unit: S (seconds), m (minutes), H (hours), or D (days ). default unit: S (seconds ). default Value: 0 (off ).
-
-
Process_control_timeout Mixed
-
-
Set the timeout time for the sub-process to receive the multiplexing signals of the main process. available unit: S (seconds), m (minutes), H (hours), or D (days) default unit: S (seconds ). default Value: 0.
-
-
Daemonize Boolean
-
-
Set FPM to run in the background. Set 'no' to keep FPM running in the foreground for debugging. Default Value: Yes.
Run configuration section
In FPM, you can use different settings to run multiple process pools. These settings can be set separately for each process pool.
-
-
Listen String
-
-
Set the address for receiving the FastCGI request. The available format is 'IP: port', 'Port', '/path/to/Unix/socket'. Each process pool needs to be set.
-
-
Listen. Backlog Int
-
-
Set the length of the semi-join queue of listen (2). '-1' indicates no limit. Default Value:-1.
-
-
Listen. allowed_clients String
-
-
Set the IPv4 address of the server that allows connection to FastCGI. equivalent to the fcgi_web_server_addrs environment variable in PHP FastCGI (5.2.2 +. only applies to TCP listeners. each address is separated by a comma. if it is not set or empty, any server is allowed to request a connection. default Value: Any.
-
-
Listen. Owner String
-
-
If this parameter is used, the UNIX socket permission is set. in Linux, read and write permissions must be set for Web server connection. in many BSD-derived systems, permissions can be ignored to allow free connection. default Value: The account used for the operation, with the permission of 0666.
-
-
Listen. Group String
-
-
SeeListen. Owner.
-
-
Listen. Mode String
-
-
SeeListen. Owner.
-
-
User String
-
-
UNIX user running the FPM process. It must be set.
-
-
Group String
-
-
UNIX user group in which FPM processes run. If no setting is set, the default user group is used.
-
-
PM String
-
-
Set how the Process Manager manages sub-processes. Available values:Static,Dynamic. Required.
Static-The number of sub-processes is fixed (PM. max_children).
Dynamic-The number of sub-processes is dynamically set based on the following Configuration:PM. max_children,PM. start_servers,PM. min_spare_servers,PM. max_spare_servers.
-
-
PM. max_children Int
-
-
Number of sub-processes,PMSetStaticIndicates the created,PMSetDynamicIt indicates the maximum value that can be created. It must be set.
This option sets the number of requests that can provide services at the same time. Similar to the setting of maxclients in Apache mpm_prefork and the setting of common PHP FastCGIPhp_fcgi_childrenEnvironment variable.
-
-
PM. start_servers In
-
-
Set the number of sub-processes created at startup.PMSetDynamicUse. Default Value: min_spare_servers + (max_spare_servers-min_spare_servers)/2.
-
-
PM. min_spare_servers Int
-
-
Set the minimum number of idle service processes.PMSetDynamicMust be set.
-
-
PM. max_spare_servers Int
-
-
Set the maximum number of idle service processes.PMSetDynamicMust be set.
-
-
PM. max_requests Int
-
-
Set the number of service requests before each sub-process is reborn. This is very useful for third-party modules that may have memory leaks. If it is set to '0', requests are always accepted. It is equivalentPhp_fcgi_max_requestsEnvironment variable. Default Value: 0.
-
-
PM. status_path String
-
-
The URL of the FPM status page. If not set, the page cannot be accessed. Default Value: none.
-
-
Ping. Path String
-
-
The Ping URL of the FPM monitoring page. If this parameter is not set, you cannot access the ping page. This page is used to check whether the FPM is alive and can respond to requests. Note that it must start with a slash (/).
-
-
Ping. Response String
-
-
It is used to define the response of ping requests. The returned text is in the text/plain format of HTTP 200. Default Value: Pong.
-
-
Request_terminate_timeout Mixed
-
-
Set the timeout duration of a single request. this option may apply to PhP. the 'max _ execution_time 'in ini settings is not useful for stopping the running script for some special reasons. set to '0' to 'off '. available units: S (econds) (default), m (inutes), H (ours), or D (ays ). default Value: 0.
-
-
Request_slowlog_timeout Mixed
-
-
When a request times out, the corresponding PHP call stack information is completely written to the slow log. set to '0' to 'off '. available unit: S (seconds) (default), m (minutes), H (hours), or D (days ). default Value: 0.
-
-
Slowlog String
-
-
Slow request logging. Default Value:# Install_prefix #/log/php-fpm.log.slow.
-
-
Rlimit_files Int
-
-
Set the rlimit limit for the file opening descriptor. Default Value: system defined value.
-
-
Rlimit_core Int
-
-
Set the maximum limit value of the core rlimit. Available values: 'unlimited', 0, or positive integer. Default Value: system defined value.
-
-
Chroot String
-
-
The chroot directory at startup. The defined directory must be an absolute path. If it is not set, chroot is not used.
-
-
Chdir String
-
-
Set the startup directory. The directory will be automatically chdir to this directory during startup. The defined directory must be an absolute path. Default Value: Current Directory, or/directory (when chroot is enabled ).
-
-
Catch_workers_output Boolean
-
-
Redirects stdout and stderr in the running process to the main error log file. If not set, stdout and stderr will be redirected to/dev/null according to FastCGI rules. Default Value: null.
You can also pass additional environment variables for a runtime pool, or update the PHP configuration value. You canPhp-fpm.confThe following configuration parameters are used:
Example #1 pass environment variables to the runtime pool and set PHP configuration values
Env [hostname] = $ hostname env [path] =/usr/local/bin:/usr/bin: /bin env [TMP] =/TMP env [tmpdir] =/TMP env [temp] =/tmp php_admin_value [sendmail_path] =/usr/sbin/sendmail-t-I-f www@my.domain.com php_flag [display_errors] = off php_admin_value [error_log] =/var/log/fpm-php.www.log php_admin_flag [log_errors] = on php_admin_value [memory_limit] = 32 m
PHP configuration value throughPhp_valueOrPhp_flagAnd overwrite the previous values. Note that disable_functions or disable_classesPHP. iniThe value defined in will not be overwritten, but the new settings will be appended to the original value.
use the value defined by php_admin_value or php_admin_flag , it cannot be overwritten by ini_set () In php Code .