在 CentOS 系统中,LAMP 服务包括 Apache、MySQL 和 PHP。要重启 LAMP 服务,请按照以下步骤操作:
打开终端。
输入以下命令以重启 Apache 服务:
sudo systemctl restart httpd
sudo systemctl restart mysqld
sudo systemctl restart php-fpm
sudo systemctl restart php-mysql
现在,您的 LAMP 服务应该已经成功重启。请注意,根据您的 CentOS 版本和 LAMP 安装方式,某些命令可能略有不同。如果您的系统使用的是较旧的 CentOS 版本(例如 CentOS 6),请使用以下命令:
sudo service httpd restart
sudo service mysqld restart
sudo service php-fpm restart
或者
sudo /etc/init.d/httpd restart
sudo /etc/init.d/mysqld restart
sudo /etc/init.d/php-fpm restart