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

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

问题描述

我正在服务器(Ubuntu 16.04)上运行Laravel应用.我有一个错误

I'm running Laravel app on server (Ubuntu 16.04). I have an error

无法打开流或文件"/var/www/mydomain.com/storage/logs/laravel.log":打开流失败:权限被拒绝

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

我已经用谷歌搜索了我的问题.我找到了此答案,但这没有帮助.正如我发现的许多其他答案所建议的那样,我无法设置777的存储许可(这很危险).
还有其他建议吗?

I've already google my question. I found this answer, but it wasn't helpful. I can't set 777 permission for storage (it's dangerous), as was suggested by many other answers I found.
Any other suggestions?

更新:

sudo chgrp -R www-data storage bootstrap/cache
sudo chmod -R ug+rwx storage bootstrap/cache

很有帮助

推荐答案

此命令很有帮助:

sudo chgrp -R www-data storage bootstrap/cache
sudo chmod -R ug+rwx storage bootstrap/cache

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

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