问题

软件 >> PHP
Questions in category: PHP (PHP).

重启 PHP

Posted by haifeng on 2019-05-05 15:36:41 last update 2019-05-06 22:58:21 | Answers (0) | 收藏


$ sudo service php5-fpm start       # 启动
$ sudo service php5-fpm stop        # 停止
$ sudo service php5-fpm restart     # 重启
$ sudo service php5-fpm reload      # 重载

 

参考

https://www.awaimai.com/2391.html

 

#cd /usr/local/php/sbin
# ./php-fpm -h
Usage: php-fpm [-n] [-e] [-h] [-i] [-m] [-v] [-t] [-p ] [-g ] [-c ] [-d foo[=bar]] [-y ] [-D] [-F [-O]]
  -c | 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


                   Specify alternative prefix path to FastCGI process manager (default: /usr/local/php).
  -g, --pid
                   Specify the PID file location.
  -y, --fpm-config
                   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)

 

root@xxx:/usr/local/php/sbin# ps aux|grep php-fpm
root      1372  0.0  0.5 219216  6088 ?        Ss    2017  30:37 php-fpm: master process (/usr/local/php/etc/php-fpm.conf)
www-data  6598  0.0  1.0 221248 10392 ?        S    Apr24   0:06 php-fpm: pool www
www-data 14345  0.0  1.0 220920 10356 ?        S    Apr29   0:04 php-fpm: pool www
www-data 16001  0.0  1.0 221176 10404 ?        S    Apr15   0:11 php-fpm: pool www

 

# kill -QUIT 1372
# cd /usr/local/php/sbin
# ./php-fpm


关闭 PHP5, 启动 PHP7

root@xxx:/usr/local/php7/sbin# ps aux | grep php-fpm
www-data  3201  0.0  0.6  75088  6500 ?        S    01:24   0:14 php-fpm: pool www                                                               
root      9085  0.0  0.0  73848   164 ?        Ss    2018  19:48 php-fpm: master process (/usr/local/etc/php-fpm.conf)                           
www-data 24272  0.0  0.6  75312  6180 ?        S    09:23   0:10 php-fpm: pool www                                                               
root     24881  0.0  0.0   9788   944 pts/6    S+   22:55   0:00 grep --color=auto php-fpm
www-data 26361  0.0  0.7  75308  7400 ?        S    20:23   0:01 php-fpm: pool www

 

# kill -QUIT 9085

 

如果 PHP7 编译并安装好了, 首先做以下工作
/usr/local/php7/etc# cp php-fpm.conf.default php-fpm.conf

vim php-fpm.conf

去掉 pid = run/php-fpm.pid 前的注释符

/usr/local/php7/etc/php-fpm.d# cp www.conf.default www.conf

cd /usr/local/php7/sbin

./php-fpm