一、php-fpm的命令使用
Usage: php [-n] [-e] [-h] [-i] [-m] [-v] [-t] [-p <prefix>] [-g <pid>] [-c <file>] [-d foo[=bar]] [-y <file>] [-D] [-F [-O]]
-c <path>|<file> Look for php.ini file in this directory
-n No php.ini file will be used
-d foo[=bar] Define INI entry foo with value 'bar'
-e Generate extended information for debugger/profiler
-h This help
-i PHP information
-m Show compiled in modules
-v Version number
-p, --prefix <dir>
Specify alternative prefix path to FastCGI process manager (default: /usr/local/Cellar/php/8.0.3).
-g, --pid <file>
Specify the PID file location.
-y, --fpm-config <file>
Specify alternative path to FastCGI process manager config file.
-t, --test Test FPM configuration and exit
-D, --daemonize force to run in background, and ignore daemonize option from config file
-F, --nodaemonize
force to stay in foreground, and ignore daemonize option from config file
-O, --force-stderr
force output to stderr in nodaemonize even if stderr is not a TTY
-R, --allow-to-run-as-root
Allow pool to run as root (disabled by default)
php 中php-fpm 的重启、终止操作命令:
service nginx restart
service php-fpm restart
查看php-fpm进程数:
ps aux | grep -c php-fpm
重启php-fpm
/etc/init.d/php-fpm restart
二、重启命令
INT, TERM 立刻终止
QUIT 平滑终止
USR1 重新打开日志文件
USR2 平滑重载所有worker进程并重新载入配置和二进制模块
查看进程
hadesdeMacBook-Pro:run test$ ps aux|grep php-fpm
test 53996 0.0 0.0 4493632 528 ?? S 8:37下午 0:00.00 /usr/local/opt/php/sbin/php-fpm --nodaemonize
test 53980 0.0 0.0 4493632 488 ?? S 8:37下午 0:00.00 /usr/local/opt/php/sbin/php-fpm --nodaemonize
test 53978 0.0 0.1 4493888 9584 ?? S 8:37下午 0:00.09 /usr/local/opt/php/sbin/php-fpm --nodaemonize
test 54220 0.0 0.0 4286452 828 s022 S+ 8:43下午 0:00.01 grep php-fpm
查找pid的位置
[global]
; Pid file
; Note: the default prefix is /usr/local/var
; Default Value: none
;pid = run/php-fpm.pid
php-fpm 关闭:
kill -INT `cat /var/run/php-fpm/php-fpm.pid`
kill -USR2 `cat /var/run/php-fpm/php-fpm.pid`