How to stop nginx and php services

青灯夜游
Release: 2023-03-09 08:14:01
Original
3185 people have browsed it

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
Copy after login

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
Copy after login

systemctl stop

systemctl belongs to the Linux command

systemctl stop nginx.service
Copy after login

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
Copy after login

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`
Copy after login

2. Restart php-fpm:

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

3. Check the number of php-fpm processes:

ps aux | grep -c php-fpm
Copy after login

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!

Related labels:
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
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!