Last Updated: February 25, 2016
·
3.479K
· jacksonj04

Making Laravel storage directories play nicely with Vagrant

If you're using Laravel under Vagrant, you may have run into issues where there aren't sufficient permissions for Laravel to do things with the storage directories for things like caching and sessions.

This is all down to how Vagrant maps folders, and the fix is easy. At the end of your config.vm.synced_folder line you just need to add an option to define the permissions:

:mount_options => ["dmode=777","fmode=666"]

so

config.vm.synced_folder "./", "/var/www", id: "vagrant", :nfs => false

becomes

config.vm.synced_folder "./", "/var/www", id: "vagrant", :nfs => false, :mount_options => ["dmode=777","fmode=666"]

3 Responses
Add your response

Thank you so much for this entry, it helped a lot!

over 1 year ago ·

Thanks for this, quick solution and it worked perfectly!

over 1 year ago ·

Worked Perfectly. Thank you

over 1 year ago ·