Php5.3 comes with php-fpm
/Usr/local/php/etc/php-fpm.conf
Pid = run/php-fpm.pid
Pid settings, var/run/php-fpm.pid in the installation directory by default, it is recommended to enable
Error_log = log/php-fpm.log
Error log, var/log/php-fpm.log in the installation directory by default
Log_level = notice
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 = 60
Emergency_restart_interval = 60 s
Indicates the number of php-cgi processes with SIGSEGV or SIGBUS errors within the value set by emergency_restart_interval. If the number of php-cgi processes exceeds emergency_restart_threshold, php-fpm will be restarted elegantly. These two options are generally kept by default.
Process_control_timeout = 0
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 = yes
Fpm is executed in the background. The default value is yes. You can change it to no for debugging.
In FPM, you can use different settings to run multiple process pools. These settings can be set separately for each process pool.
Listen = 127.0.0.1: 9000
Fpm listening port, that is, the address processed by php in nginx. Generally, the default value is enough.
Available formats: 'IP: port', 'Port', '/path/to/unix/socket'. Each process pool needs to be set.
Listen. backlog =-1
The number of backlogs.-1 indicates no limit. It is determined by the operating system. This line can be commented out. For details about backlog, refer:
Http://www.3gyou.cc /? P = 41
Listen. allowed_clients = 127.0.0.1
Allow access to the IP address of the FastCGI process. set any to an unlimited IP address. If you want to set nginx of other hosts to access this FPM process, set the IP address that can be accessed at a cost at listen. The default value is any.
Each address is separated by commas (,). If it is not set or empty, any server is allowed to request a connection.
Listen. owner = www
Listen. group = www
Listen. mode = 0666
Unix socket setting options. If you use tcp access, comment it out here.
User = www
Group = www
Accounts and groups for starting processes
Pm = dynamic
The options for controlling sub-processes include static and dynamic.
If static is selected, a fixed number of sub-processes is specified by pm. max_children.
If dynamic is selected, it is determined by the following parameters:
Pm. max_children, maximum number of child Processes
Pm. start_servers, number of processes at startup
Pm. min_spare_servers ensures the minimum number of idle processes. If the number of idle processes is smaller than this value, a new sub-process is created.
Pm. max_spare_servers to ensure the maximum number of idle processes. If the number of idle processes exceeds this value, clean up
For dedicated servers, you can set pm to static.
Pm. max_requests = 1000
Sets the number of service requests before each sub-process is reborn. it is very useful for third-party modules that may have memory leaks. if it is set to '0', the request is always accepted. equivalent to the PHP_FCGI_MAX_REQUESTS environment variable. default Value: 0.
Pm. status_path =/status
The URL of the FPM status page. If not set, the page cannot be accessed. Default Value: none.
Ping. path =/ping
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 = pong
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 = 0
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 '.
You can try to change this option when 502 errors occur frequently.
Request_slowlog_timeout = 10 s
When a request times out, the corresponding PHP call stack information is completely written to the slow log. Set it to '0' to 'off'
Slowlog = log/$ pool. log. slow
Logs of slow requests, used with request_slowlog_timeout
Rlimit_files = 1024
Set the rlimit limit for the file opening descriptor. Default Value: system defined value
By default, the system can open a 1024 handle. You can use ulimit-n to view the handle and modify it with ulimit-n 2048.
Rlimit_core = 0
Set the maximum limit value of the core rlimit. Available values: 'unlimited', 0, or positive integer. Default Value: system defined value.
Chroot =
The Chroot directory at startup. The defined directory must be an absolute path. If it is not set, chroot is not used.
Chdir =
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 = yes
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.