Centos 7系统直接使用命令安装lamp环境
1、 yum install -y httpd php php-fpm mysql mysql-server php-mysql
依次启动
1、systemctl start httpd.service
2、systemctl start mysqld.service
3、systemctl start php-fpm.service
备注
第一、启动、终止、重启
systemctl start httpd.service #启动
systemctl stop httpd.service #停止
systemctl restart httpd.service #重启
第二、设置开机启动/关闭
systemctl enable httpd.service #开机启动
systemctl disable httpd.service #开机不启动
第三、检查httpd状态
systemctl status httpd.service
发现mysql无法启动
第一步:安装从网上下载文件的wget命令 并下载mysql的repo源
1、 yum -y install wget
2、 wget http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpm
第二步:安装mysql-community-release-el7-5.noarch.rpm包
rpm -ivh mysql-community-release-el7-5.noarch.rpm
第三步:查看下
会获得两个mysq