LAMP环境搭建

1、准备一台服务器

192.168.52.35

2、关闭防火墙

systemctl  stop firewalld

setenforce 0

3、安装lamp环境

yum -y install httpd mariadb mariadb-seever php php-gd php-mysql php-fpm

4、启动服务

[root@localhost ~]# systemctl start httpd
[root@localhost ~]# systemctl start php-fpm

5、编写Apache配置文件

vim /etc/httpd/conf/httpd.conf 

#
<IfModule dir_module>
   DirectoryIndex index.php index.html    #添加index.php
</IfModule>

#

6、编写php测试页面

[root@localhost ~]# cat /var/www/html/index.php
1111
<?php
phpinfo();
?>
[root@localhost ~]# 

7、重启Apache

systemctl restart httpd

8、lamp环境搭建完成

posted @ 2019-12-19 16:31  Zsecret  阅读(126)  评论(0编辑  收藏  举报