在 CentOS 上“重启 LAMP”一般是指重启 Apache、MySQL(MariaDB)、PHP 相关服务。下面分几种常见情况说明。
# 重启 Apache
service httpd restart
# 重启 MySQL / MariaDB
service mysqld restart
# 或
service mariadb restart
# PHP 一般不需要单独重启(作为 Apache 模块时随 Apache 重启)
# 重启 Apache
systemctl restart httpd
# 重启 MySQL / MariaDB
systemctl restart mysqld
# 或
systemctl restart mariadb
查看状态:
systemctl status httpd
systemctl status mariadb
systemctl restart httpd
systemctl restart mariadb
常见命令:
lnmp restart
或
/etc/init.d/nginx restart
/etc/init.d/mysql restart
systemctl enable httpd
systemctl enable mariadb
如果你能告诉我:
我可以给你更精确的一条命令。