Vagrant Homestead 'storage' folder permission denied [closed]

人盡茶涼 提交于 2019-12-13 18:13:25

问题


Running Laravel on Homestead gives the following errors:

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

Now I understand that the permission for storage is not correct but trying the following didn't work:

  • Setting file permissions in the guest VM - didn't work
  • Changing file permission on the host machine (windows in this case) - didn't work
  • Lastly, Adding the following to the Vagrantfile changed the owner of the storage folder but still gives the same error: config.vm.synced_folder "~/project/storage", "~/project/storage", owner: "www-data", group: "www-data"

I'm not sure what to do next. Any help would be greatly appreciated.

Thank You.


回答1:


For me, I didn't have any permission issues when using Laravel with Homestead; it worked out of the box.

Anyway, SSH into your Vagrant machine, move towards the project's root and run the following commands.

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


来源:https://stackoverflow.com/questions/52276694/vagrant-homestead-storage-folder-permission-denied

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!