Vagrant Homestead 'storage' 文件夹权限被拒绝
Vagrant Homestead 'storage' folder permission denied
运行 Laravel 在 Homestead 上给出了以下错误:
The stream or file "/var/www/laravel/storage/logs/laravel.log" could
not be opened: failed to open stream: Permission denied
现在我明白 storage 的权限不正确,但尝试以下操作无效:
- 在来宾 VM 中设置文件权限 - 无效
- 更改主机上的文件权限(windows 在这种情况下)- 没有用
- 最后,将以下内容添加到 Vagrantfile 更改了存储文件夹的所有者,但仍然给出相同的错误:
config.vm.synced_folder "~/project/storage", "~/project/storage",
owner: "www-data", group: "www-data"
我不确定下一步该做什么。任何帮助将不胜感激。
谢谢。
对我来说,使用 Laravel 和 Homestead 时没有任何权限问题;它开箱即用。
无论如何,SSH 进入你的 Vagrant 机器,进入项目的根目录并运行执行以下命令。
sudo chgrp -R www-data storage bootstrap/cache
sudo chmod -R ug+rwx storage bootstrap/cache
运行 Laravel 在 Homestead 上给出了以下错误:
The stream or file "/var/www/laravel/storage/logs/laravel.log" could not be opened: failed to open stream: Permission denied
现在我明白 storage 的权限不正确,但尝试以下操作无效:
- 在来宾 VM 中设置文件权限 - 无效
- 更改主机上的文件权限(windows 在这种情况下)- 没有用
- 最后,将以下内容添加到 Vagrantfile 更改了存储文件夹的所有者,但仍然给出相同的错误:
config.vm.synced_folder "~/project/storage", "~/project/storage", owner: "www-data", group: "www-data"
我不确定下一步该做什么。任何帮助将不胜感激。
谢谢。
对我来说,使用 Laravel 和 Homestead 时没有任何权限问题;它开箱即用。
无论如何,SSH 进入你的 Vagrant 机器,进入项目的根目录并运行执行以下命令。
sudo chgrp -R www-data storage bootstrap/cache
sudo chmod -R ug+rwx storage bootstrap/cache