在 Debian 下的 LNMP(Linux + Nginx + MySQL/MariaDB + PHP) 环境,重启方式取决于你是 源码安装、APT 安装,还是使用了 LNMP 一键包。下面按常见情况说明:
如果你是用 LNMP.org 一键包安装的:
# 重启所有服务
lnmp restart
# 单独重启
lnmp nginx restart
lnmp mysql restart
lnmp php-fpm restart
systemctl restart nginx
# MySQL
systemctl restart mysql
# 或 MariaDB
systemctl restart mariadb
先确认 PHP 版本(如 7.4、8.1):
systemctl restart php7.4-fpm
# 或
systemctl restart php8.1-fpm
systemctl restart nginx mysql php8.1-fpm
/usr/local/nginx/sbin/nginx -s reload
# 或
service nginx restart
/etc/init.d/mysql restart
/etc/init.d/php-fpm restart
systemctl status nginx
systemctl status mysql
systemctl status php8.1-fpm
reload(不中断服务)restart如果你能告诉我:
我可以给你完全对应的一条命令。