Spent far too long trying to install Grav... :(

I have spent the last few of my days off trying to get my virtual machine hosting Grav.

I am using vagrant to run a virtual box where I have the standard LAMP stack installed.

php version is 5.5.9
apache is running fine.

I can confirm my LAMP setup is working as I am currently hosting a few other sites from work using this setup… All of these sites use php.

However when trying to run Grav for the first time I am running into a 500 response when pointing my browser to the grav directory.

so I called my apache error log…

[:error] [pid 2011] [client 192.168.33.1:50166] PHP Fatal error: Uncaught exception ‘RuntimeException’ with message ‘Creating directory ‘/vagrant/sites/grav/cache//compiled/files’ failed on error mkdir(): Permission denied’ in /vagrant/sites/grav/vendor/rockettheme/toolbox/File/src/File.php:420
Stack

But I have already changed permissions to 777 to every file and folder in my virtual box. I also changed owner to the vagrant box to vagrant of user group vagrant. -> chown vagrant : vagrant. I confirmed the changes were made by running ‘ls -l’ on various folders also.

I am out of ideas now but desperately want to get using this CMS because I have heard a lot of good things and have a project that I keep pushing back because of this issue.

I hope someone can help.

Thanks in advance

I have no experience with Vagrant but basically Grav can’t write to that folder because the user running Apache does not have permissions to create it.

If the files are owned by the vagrant user, also make sure Apache is run by that same user.

This document on permissions explains other possible scenarios.

Thanks for your response !
When you say what user apache is run by, do you mean what user started apache in the first place? or what user installed apache?

How can I check this?
thanks again

The user that is running the Apache daemon. The default is www-data, but www is also common. From the terminal, a ps -axshould show you the user running httpd or apachectl, whatever it is nowadays.

Not familiar with Vagrant+grav either, personally I’m running grav on a laravel valet setup and it works like a charm, maybe you could try that!

laravel valet