在 Debian 上“LNMP”通常指 Linux + Nginx + MySQL/MariaDB + PHP,重启方式取决于你是用 apt 直接安装 还是 LNMP 一键脚本 安装的。
systemctl restart nginx
查看状态:
systemctl status nginx
Debian 通常安装的是 MariaDB:
systemctl restart mariadb
或
systemctl restart mysql
查看状态:
systemctl status mariadb
先确认 PHP 版本:
php -v
例如 PHP 8.1:
systemctl restart php8.1-fpm
通用写法(按版本改):
systemctl restart phpX.X-fpm
systemctl restart nginx mariadb php8.1-fpm
如果你是用 lnmp.org 的脚本安装的:
lnmp restart
lnmp nginx restart
lnmp mysql restart
lnmp php-fpm restart
nginx -t
tail -n 50 /var/log/nginx/error.log
tail -n 50 /var/log/mysql/error.log
如果你能告诉我:
我可以给你更精确的重启和排错命令。