I am using vagrant to run my vm using ubuntu, apache, etc. This is running on my OSX host.
Everything works fine until my php application tries to create a folder, files within that folder, etc. I get Permission denied. What am I missing on the provision / configuration of the vagrant file?
in this case, if you're using Vagrant + Apache2.
the solution is:
Change these lines to:
User vagrant
Group vagrant
run sudo service apache2 restart
its not possible to change /vagrant directory owner to www-data (apache user);
Anyway, it works for me.
Edit Vagrantfile
config.vm.synced_folder "./", "/var/www", owner: "www-data", group: "www-data"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With