Home > Backend Development > PHP Tutorial > PHP uses php-fpm to restart and stop operation commands

PHP uses php-fpm to restart and stop operation commands

巴扎黑
Release: 2016-11-12 14:14:26
Original
1272 people have browsed it

php 5.3.3 has php-fpm embedded in the source code. There is no need to patch it like previous php versions. You only need to add compilation parameters when configuring.

The compilation parameters for php-fpm are –enable-fpm –with-fpm-user=www –with-fpm-group=www –with-libevent-dir=libevent location.

However, php-fpm under php 5.3.3 no longer supports the /usr/local/php/sbin/php-fpm (start|stop|reload) and other commands that php-fpm previously had. You need to use signal control:

The master process can understand the following signals:

SIGINT, SIGTERM Terminate immediately
SIGQUIT Terminate smoothly
SIGUSR1 Reopen the log file
SIGUSR2 Smoothly reload all worker processes and reload configuration and binary modules

Example:
php-fpm Close :
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`

View the number of php-fpm processes:

ps aux | grep -c php-fpm

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

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


Related labels:
php
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template