PHP-FPM Start-up
?????? PHP 5.3.3 Source In the beginning contains php-fpm, do not specifically re-patched, just to solve the source code directly configure, about the php-fpm of the compilation parameters –enable-fpm–with-fpm-user=www– With-fpm-group=www–with-libevent-dir=libevent position.
?
This php-fpm no longer supports commands such as the/USR/LOCAL/PHP/SBIN/PHP-FPM (start|stop|reload) of the PHP-FPM patch and requires the use of signal control:
?
The master process can understand the following signals
?
SIGINT, SIGTERM immediately terminate.
Sigquit Smooth Termination
SIGUSR1 Reopen log file
SIGUSR2 smoothly overloads all worker processes and reloads the configuration and binary modules
?
Example:
PHP-FPM off:
Kill-sigint ' Cat/usr/local/php/var/run/php-fpm.pid '
PHP-FPM Restart:
KILL-SIGUSR2 ' Cat/usr/local/php/var/run/php-fpm.pid '
?
Second, the configuration file is no longer used in the XML format, changed to INI, but the configuration parameters almost as before, can be referenced in the format of XML format configuration.
?
—————-Supplemental Content —————-
PHP-FPM Start-up:
?
Cp-f (php-5.3.x-source-dir)/sapi/fpm/init.d.php-fpm/etc/init.d/php-fpmchmod 755/etc/init.d/php-fpm/etc/init.d/ PHP-FPM start/sbin/chkconfig--add php-fpm (Add to boot Service list)/sbin/chkconfig php-fpm on
?
PHP-FPM start, stop, and restart:
/ETC/INIT.D/PHP-FPM start
/ETC/INIT.D/PHP-FPM stop
/ETC/INIT.D/PHP-FPM Reload
----Reference http://ideas.spkcn.com/technology/php-technology/133.html-------------------------------------------
?
?
?
Contract several directories
/usr/local/php/sbin/php-fpm
/usr/local/php/etc/php-fpm.conf
/usr/local/php/etc/php.ini
?
?
#测试php-fpm configuration/usr/local/php/sbin/php-fpm-t/usr/local/php/sbin/php-fpm-c/usr/local/php/etc/php.ini-y/usr/local/ Php/etc/php-fpm.conf-t #启动php-fpm/usr/local/php/sbin/php-fpm/usr/local/php/sbin/php-fpm-c/usr/local/php/etc/ Php.ini-y/usr/local/php/etc/php-fpm.conf #关闭php-fpmkill-int ' cat/usr/local/php/var/run/php-fpm.pid ' # Restart PHP-FPMKILL-USR2 ' Cat/usr/local/php/var/run/php-fpm.pid '
?
Second, php-fpm.conf important parameters of the detailed
?
PID = run/php-fpm.pid#pid settings, default in the installation directory of Var/run/php-fpm.pid, it is recommended to turn on error_log = log/php-fpm.log# error log, default in the installation directory var/log/ Php-fpm.log log_level = notice# error level. The available levels are: alert (which must be processed immediately), error (Error condition), warning (warning condition), notice (general important information), debug (debug information). Default: Notice. Emergency_restart_threshold = 60emergency_restart_interval = 60s# is represented in Emergency_restart_ If the number of php-cgi processes with SIGSEGV or sigbus errors within the values set by interval is more than Emergency_restart_threshold, PHP-FPM will be gracefully restarted. These two options generally leave the default values. Process_control_timeout = 0# Sets the time-out period for the child process to accept the primary process multiplexing signal. Available units: s (seconds), M (min), H (Hours), or D (day) default units: s (seconds). Default value: 0. daemonize = yes# background performs fpm, default is yes, if for debugging you can change to No. In FPM, you can use different settings to run multiple process pools. These settings can be set individually for each process pool. Listen = 127.0.0.1:9000#FPM Listening port, that is, the address of PHP processing in Nginx, the general default value can be. The available formats are: ' Ip:port ', ' Port ', '/path/to/unix/socket '. Each process pool needs to be set. Listen.backlog = -1#backlog, 1 means unrestricted, determined by the operating system, and this line is commented out. Backlog meaning reference: http://www.3gyou.cc/?p=41 listen.allowed_clients = 127.0.0.1# Allow access to the IP of the fastcgi process, set any to unlimited IP, If you want to set the nginx of another host to access this FPM process, listen to set the IP that can be accessed at a cost. The default value is any. Each address is separated by commas. If not set or empty, allow any server to request connection Listen.owner = Wwwlisten.group = Wwwlisten.mode = 0666#unix Socket setting option, if accessed using TCP, Comment here. user = Wwwgroup = www# The account and group that started the process pm = Dynamic #对于专用服务器, PM can be set to static. #如何控制子进程, the options are static and dynamic. If Static is selected, the number of fixed child processes is specified by Pm.max_children. If dynamic is selected, it is determined by the following argument: Pm.max_children #, maximum number of child processes Pm.start_servers #, number of processes at startup Pm.min_spare_servers #, minimum number of idle processes guaranteed, If the idle process is less than this value, the new child process Pm.max_spare_servers # is created, the maximum number of idle processes is guaranteed, and if the idle process is greater than this value, this is cleaned pm.max_requests = 1000# Sets the number of requests for the service before each child process is reborn. is useful for third-party modules that may have a memory leak. If set to ' 0 ', the request is always accepted. Equivalent to the PHP_FCGI_MAX_REQUESTS environment variable. Default value: 0. Pm.status_path = URL of the/STATUS#FPM status page. If not set, the status page cannot be accessed. Default value: None. The Munin monitor uses the ping URL to the Ping.path =/PING#FPM monitoring page. If not set, the ping page cannot be accessed. This page is used to externally detect whether FPM is alive and can respond to requests. Note that you must start with a slash (/). Ping.response = pong# is used to define the return of the ping request accordingly. Returns the Text/plain format text for HTTP 200. Default value: Pong. Request_terminate_timeout = 0# Sets the time-out for a single request to abort. This option may be useful for scripts in php.ini settings where ' Max_execution_time ' is not aborted for some special reason. Set to ' 0 ' for ' Off '. You can try changing this option when a 502 error occurs frequently. Request_slowlog_timeout = 10s# When a time-out is requested for this setting, the corresponding PHP call stack information is written to the slow log in its entirety. Set to ' 0 ' means ' Off 'Slowlog = log/$pool. log.slow# Slow-Request logging, with request_slowlog_timeout use Rlimit_files = 1024# to set the rlimit limit of the file opening descriptor. Default: System-defined value default open handle is 1024, can be viewed using ULIMIT-N, ulimit-n 2048 modified. Rlimit_core = 0# Sets the maximum limit value for the core rlimit. Available values: ' Unlimited ', 0, or positive integer. Default value: System-defined value. Chroot = #启动时的Chroot目录. The defined directory needs to be an absolute path. If not set, Chroot is not used. ChDir = #设置启动目录, which is automatically chdir to the directory at startup. The defined directory needs to be an absolute path. Default: The current directory, or/directory (chroot) catch_workers_output = yes# redirect stdout and stderr into the primary error log file during the run. If not set, stdout and stderr will be redirected to/dev/null according to the FASTCGI rules. Default value: Empty.
? Reference: http://www.4wei.cn/archives/1002061
?
?