在 Linux 的 LNMP(Linux + Nginx + MySQL/MariaDB + PHP) 环境中,“重启”通常分为整体重启和单独重启某个服务。下面按常见发行版说明。
# CentOS 7+/Ubuntu/Debian
systemctl restart nginx
# 查看状态
systemctl status nginx
systemctl restart mysqld # MySQL
# 或
systemctl restart mariadb # MariaDB
# PHP 版本不同,服务名可能不同
systemctl restart php-fpm
# 或
systemctl restart php7.4-fpm
systemctl restart php8.1-fpm
systemctl restart nginx
systemctl restart mysqld
systemctl restart php-fpm
如果你是用 lnmp.org 一键包 安装的:
lnmp restart # 重启所有
lnmp nginx restart
lnmp mysql restart
lnmp php-fpm restart
其他命令:
lnmp start
lnmp stop
lnmp status
如果是老服务器(无 systemd):
service nginx restart
service mysql restart
service php-fpm restart
nginx -t
tail -n 50 /var/log/nginx/error.log
journalctl -xe
restart nginxphp-fpmmysql/mariadblnmp restart如果你能告诉我:
我可以给你精确命令。