准备

一台CentOS 7 虚拟机

yum更新完毕!

打开终端

一步systemctl stop firewalld  //关闭防火墙 

 

第二步systemctl disable firewalld  //禁用防火

 

第三步:yum install httpd  //下载apache

 

systemctl  status httpd  //查看apache状态

 

systemctl  start httpd  //启动apache

 

第四步:yum install mariadb mariadb.server  //下载数据库  数据库客户端

 

systemctl status mariadb  //查看数据库状态

systemctl start mariadb  //启动数据库

 

第五步:yum install php phpmysql  //下载php连接数据库中间件 

 

 第六步vim /var/www/test.php  //在网站根目录创建测试 

 

 systemctrestart  httpd  //重启apache

IP/test.php  //访问测试页 

 

至此LAMP搭建成功!! 

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注