linux环境下php网站报错could not be opened: failed to open stream: Permission denied

问题概述:

在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

备注:如果遇到其它问题,你有更好的解决方法,又或者哪里有错误,都可以留言,我们一起探讨哦!!!,看到这了,就喜欢或者留个言吧 (* ̄︶ ̄)。

你可能感兴趣的:(linux环境下php网站报错could not be opened: failed to open stream: Permission denied)