在 LNMP(Linux + Nginx + MySQL/MariaDB + PHP) 环境下,“重启”一般是指分别重启 Nginx、MySQL、PHP-FPM。下面按常见情况给你总结。
systemctl restart nginx
systemctl restart mysqld
或
systemctl restart mariadb
根据 PHP 版本不同,例如:
systemctl restart php-fpm
或
systemctl restart php7.4-fpm
systemctl restart php8.1-fpm
✅ 一次性重启 LNMP(手动)
systemctl restart nginx mysqld php-fpm
service nginx restart
service mysqld restart
service php-fpm restart
如果你用的是 lnmp.org 的一键安装包,直接用:
lnmp restart
也可以单独重启:
lnmp nginx restart
lnmp mysql restart
lnmp php-fpm restart
systemctl status nginx
systemctl status mysqld
systemctl status php-fpm
nginx -t
php-fpm -t
ss -lntp
systemctl restart mysql
systemctl restart php-fpm
systemctl restart nginx
如果你愿意,可以告诉我:
我可以给你更精确的命令 ✅