在 Linux 上“重启 LNMP”通常是指重启 Nginx、MySQL(或 MariaDB)、PHP-FPM 这三类服务。下面按常见情况说明。
# Nginx
systemctl restart nginx
# MySQL / MariaDB
systemctl restart mysql
# 或
systemctl restart mariadb
# PHP-FPM(版本号可能不同)
systemctl restart php-fpm
# 或
systemctl restart php7.4-fpm
如果你用的是 LNMP 一键安装包:
lnmp restart
也可单独重启:
lnmp nginx restart
lnmp mysql restart
lnmp php-fpm restart
service nginx restart
service mysql restart
service php-fpm restart
lnmp start # 启动
lnmp stop # 停止
lnmp restart # 重启
lnmp reload # 平滑重载(不中断服务)
systemctl status nginx
systemctl status mysql
systemctl status php-fpm
或查看端口:
netstat -lntp | grep -E '80|3306|9000'
如果你能告诉我:
我可以给你最精确的重启命令。