centos搭建好了lamp,能访问.html文件,无法访问.php文件

centos搭建好了lamp,无法访问.php文件,能访问.html文件

我是安装好redis扩展后,重启了服务器,结果就不能访问.php文件了

若是重启服务器后无法访问,这种情况请直接关闭防火墙,然后刷新浏览器。具体方法在最下面给出

解决方法:

1、检查Apache,php和Mariadb服务是否正常运行

1.1、检查Apache服务

systemctl status httpd.service

看到   Active: active (running)  就说明运行正常。

否则开启Apache服务

systemctl enable httpd && systemctl start httpd  //开启服务,并设置开机启动

1.2检查php是否在运行

ps -ef | grep php

看到

root 4411 3967 0 22:30 pts/1 00:00:00 grep --color=auto php

就说明正常运行

1.3检查Mariadb服务

systemctl status mariadb.service

看到   Active: active (running)  就说明运行正常。

否则开启Mariadb服务

systemctl enable mariadb && systemctl start mariadb  //开启服务,并设置开机启动

2、若以上环境都正常,请尝试关闭防火墙

执行下面命令:


systemctl stop firewalld.service

 

posted @ 2020-07-07 22:39  养猪至富  阅读(456)  评论(0编辑  收藏  举报