在 Linux 下“重启 LAMP”一般是指重启 Linux + Apache + MySQL(MariaDB) + PHP 这套环境。不同发行版命令略有不同,下面按常见系统说明。
sudo systemctl restart apache2
sudo systemctl restart mysql
# 或
sudo systemctl restart mariadb
sudo systemctl restart apache2
sudo systemctl restart mysql
sudo systemctl restart httpd
sudo systemctl restart mysqld
# 或
sudo systemctl restart mariadb
systemctl status apache2 # Ubuntu
systemctl status httpd # CentOS
systemctl status mysql
lnmp restart
或单独:
lnmp apache restart
lnmp mysql restart
service apache2 restart
service httpd restart
service mysql restart
如果你能告诉我:
我可以给你更精确的一条命令。