問題描述:
在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下更改目錄權限後仍不可寫入怎麼辦的詳細內容。更多資訊請關注PHP中文網其他相關文章!