Heim  >  Artikel  >  Backend-Entwicklung  >  php使用php-fpm重启、停止操作命令

php使用php-fpm重启、停止操作命令

巴扎黑
巴扎黑Original
2016-11-12 14:14:261197Durchsuche

php 5.3.3 源码中已经内嵌了 php-fpm,不用象以前的php版本一样专门打补丁了,只需要在configure的时候添加编译参数即可。

关于php-fpm的编译参数有 –enable-fpm –with-fpm-user=www –with-fpm-group=www –with-libevent-dir=libevent位置。

但是,php 5.3.3 下的php-fpm 不再支持 php-fpm 以前具有的 /usr/local/php/sbin/php-fpm (start|stop|reload)等命令,需要使用信号控制:

master进程可以理解以下信号:

SIGINT, SIGTERM 立刻终止 
SIGQUIT 平滑终止 
SIGUSR1 重新打开日志文件 
SIGUSR2 平滑重载所有worker进程并重新载入配置和二进制模块

示例: 
php-fpm 关闭: 
kill -SIGINT `cat /usr/local/php/var/run/php-fpm.pid` 
php-fpm 重启: 
kill -SIGUSR2 `cat /usr/local/php/var/run/php-fpm.pid`

查看php-fpm进程数:

ps aux | grep -c php-fpm

netstat -anpo | grep "php-cgi" | wc -l

netstat -anop | grep "php-fpm" | wc -l


Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn
Vorheriger Artikel:常见的PHP开发框架Nächster Artikel:PHP下的cURL库