问题概述:
在linux环境下搭建php网站,访问页面时报错 could not be opened: failed to open stream: Permission denied
问题剖析:
看英文一看就是文件权限的问题,所以正常的做法都是加上777权限,但是还是一直报错
问题解决:
1,给当前文件夹赋予最高权限 chmod -R 777 app
2,修改selinux权限设定
vi /etc/selinux/config
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - No SELinux policy is loaded.
SELINUX=disabled // 改此处,别改错了
# SELINUXTYPE= can take one of three values:
# targeted - Targeted processes are protected,
# minimum - Modification of targeted policy. Only selected processes are protected.
# mls - Multi Level Security protection.
SELINUXTYPE=targeted