Home  >  Article  >  Backend Development  >  How to stop nginx and php services

How to stop nginx and php services

青灯夜游
青灯夜游Original
2021-03-30 10:13:243251browse

Method to stop nginx: execute the "nginx -s quit" or "nginx -s stop" command. How to stop the php service: execute the "kill -INT ` cat /usr/local/php/var/run/php-fpm .pid`" command.

How to stop nginx and php services

The operating environment of this tutorial: windows7 system, PHP7.1 version, DELL G3 computer

Stop the Nginx service Four methods

Stop the service calmly

This method is milder than stop and requires the process to complete the current work. stop.

nginx -s quit

Stop the service immediately

This method is tougher and stops the process directly regardless of whether the process is working or not.

nginx -s stop

systemctl stop

systemctl belongs to the Linux command

systemctl stop nginx.service

killall method kills the process

directly Kill the process and use it when the above is invalid. It is tough, simple and crude!

killall nginx

How to stop php service

INT, TERM: terminate immediately

QUIT: terminate smoothly

USR1: Reopen the log file

USR2: Smoothly reload all worker processes and reload configuration and binary modules

1, php-fpm Close:

kill   -INT ` cat  /usr/local/php/var/run/php-fpm .pid`

2. Restart php-fpm:

kill   -USR2 ` cat  /usr/local/php/var/run/php-fpm .pid`

3. Check the number of php-fpm processes:

ps   aux |  grep  -c php-fpm

Recommended learning: "PHP Video Tutorial"

The above is the detailed content of How to stop nginx and php services. For more information, please follow other related articles on the PHP Chinese website!

Statement:
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