centos下更改目录权限后仍不可写怎么办

centos下更改目录权限后仍不可写怎么办,第1张

centos下更改目录权限后仍不可写怎么办

问题描述:

在 CentOS 上搭建环境时,无论如何修改用户权限为 777 或者 755 、变更文件所属用户, Laravel 框架总是报错 "The stream or file "/var/www/laravel56/storage/logs/laravel.log" could not be opened: failed to open stream: Permission denied"。

解决方法:

关闭selinux即可。

编辑 /etc/selinux/config 文件,将 SELINUX 项修改为:SELINUX=disabled

#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 these two values: 
# targeted - Only targeted network daemons are protected. 
# strict - Full SELinux protection. 
SELINUXTYPE=targeted

推荐教程:centos教程

以上就是centos下更改目录权限后仍不可写怎么办的详细内容,

欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/yw/712365.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2022-04-24
下一篇2022-04-24

发表评论

登录后才能评论

评论列表(0条)

    保存