“流或文件"laravel.log"无法打开:无法打开流:权限被拒绝" [英] "The stream or file "laravel.log" could not be opened: failed to open stream: Permission denied"

查看:29
本文介绍了“流或文件"laravel.log"无法打开:无法打开流:权限被拒绝"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

几天前我将文件上传到我的cent OS服务器,它工作正常,但从今天开始我收到错误.

I upload the file to my cent OS server a few days ago, it was working fine, but from today I am getting the error.

流或文件/var/www/html/hasibtest/storage/logs/laravel.log"无法打开:无法打开流:权限被拒绝

The stream or file "/var/www/html/hasibtest/storage/logs/laravel.log" could not be opened: failed to open stream: Permission denied

我的日志文件在哪里具有 777 权限,我也在尝试使用 0755、0644

Where My log file is with 777 permission I am also trying with 0755, 0644

谁能告诉我如何解决这个问题?

can anyone tell me how I can resolve this issue?

推荐答案

先试试这个递归获取目录的所有权

first try this to take ownership of the directory recursively

sudo chown -R $USER:www-data storage
sudo chown -R $USER:www-data bootstrap/cache

然后使用以下设置正确的目录访问权限

Then use the following to set proper directory access

chmod -R 775 storage
chmod -R 775 bootstrap/cache

永远不要将目录权限设置为 777(除非您知道自己在做什么)

这篇关于“流或文件"laravel.log"无法打开:无法打开流:权限被拒绝"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆