alankent / vagrant-magento2-apache-base

Base Vagrant image for building Magento 2 within
58 stars 29 forks source link

OS X Permissions fix #2

Closed astorm closed 8 years ago

astorm commented 9 years ago

Using Vagrant 1.6.5 with Virtual Box 4.3.2 on OS X 10.10.1 (Yosemite), the default vagrant setup results in a number of permissions errors that prevent Magento from running. Magento can't write to the var/cache folder or the var/generation folder, and new folders/files created from a web context seem to ignore PHP's umask setting and are created without the necessary write permissions.

Having the /var/www/magento2 folder sync with

config.vm.synced_folder "../magento2", "/var/www/magento2", :mount_options => ["dmode=777","fmode=666"]

appears to fix this problem, ("appears to" because I'm not familiar enough with how Vagrant handles permissions, umasks, etc. between the host/guest OS to know for certain that this has completely solved the problem)

Assuming this doesn't interfere with other systems, it'd be a good idea to ship with this as the default so Mac users don't run into this problem.

kojiromike commented 9 years ago

In case it's helpful at all, I had a similar problem with Docker/Apache. I solved it in the startup script for my Docker Apache instance by creating a new user with the UID that already owns the webroot and running Apache as that user.

If it's possible to do something similar in Vagrant, maybe impersonating the owner is easier than changing the permissions/ownership.

toddwolaver commented 9 years ago

I can confirm that using NFS on Mac OS X Yosemite 10.10.2 also resolves the permission issues.