Laravel XAMPP Mac 无法打开流或文件“/storage/logs/laravel.log”:无法打开流:权限被拒绝
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/53601575/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Laravel XAMPP Mac The stream or file "/storage/logs/laravel.log" could not be opened: failed to open stream: Permission denied
提问by user979331
I am trying to run an existing Laravel project on my localhost but when I try to run the dam thing I get this error:
我正在尝试在本地主机上运行现有的 Laravel 项目,但是当我尝试运行 dam 时,出现此错误:
The stream or file "/storage/logs/laravel.log" could not be opened: failed to open stream: Permission denied
流或文件“/storage/logs/laravel.log”无法打开:无法打开流:权限被拒绝
I have tried the following:
我尝试了以下方法:
chmod -R 775 storage
and chmod -R 777 storage
chmod -R 775 storage
和 chmod -R 777 storage
Still nothing, I have even tried to do chgrp -R www-data my-project
and I get this error in terminal
仍然什么都没有,我什至尝试过,但chgrp -R www-data my-project
在终端中出现此错误
chgrp: www-data: illegal group name
What am I doing wrong?
我究竟做错了什么?
回答by Victor Ifeanyi Ejiogu
Navigate to the project directory and run
导航到项目目录并运行
sudo chmod -R 777 storage/*
回答by Ismoil Shifoev
This is my solution.
这是我的解决方案。
First you need to run php artisan cache:clear
from the project directory, then chmod -R 777 app/storage
and finally composer dump-autoload
and now it will be working fine..
首先你需要php artisan cache:clear
从项目目录运行,然后chmod -R 777 app/storage
最后composer dump-autoload
和现在它会正常工作..
illegal group name actually means that the group you're specifying(after www-data going username).You need to either create the group, stop specifying a group, or specify a group that exists.
非法组名实际上意味着您指定的组(在 www-data 进入用户名之后)。您需要创建组、停止指定组或指定存在的组。