Search code examples
laravel-5vagrantpyrocms

PyroCMS in a Vagrant box user permissions


I am setting up a dev environment for Pryocms in a Ubuntu based Vagrant dev box. The problem I have is that when PyroCMS creates anything in the storage directory it is not created with permissions for anyone to read and write, so the system then throws an error saying file un-writeable. To carry on I have to chmod -R 777 storage and then it moves on, but if something new is created the problem arises again. PyroCMS seems to be creating files in my username to?


Solution

  • I have managed to fix the issue using the following:

    config.vm.synced_folder '~/projects', '/home/vagrant/projects', :owner=> 'vagrant', :group=>'www-data', :mount_options => ['dmode=777', 'fmode=777']
    

    I understand that this may not be a great fix and certainly not for a production server but for a local box it certainly works, by forcing the mounted shared to use 777 permissions.