I can’t get grav working on Ubuntu or any linux distro. I have installed XAMPP and unzipped a grav skeleton to htdocs but when I open it as a subdomain of localhost I get the following:
Fatal error: Uncaught exception ‘RuntimeException’ with message ‘Creating directory ‘/opt/lampp/htdocs/grav-onepage/cache/compiled/files’ failed on error mkdir(): Permission denied’ in /opt/lampp/htdocs/grav-onepage/vendor/rockettheme/toolbox/File/src/Fil e.php:400 Stack trace: #0 /opt/lampp/htdocs/grav-onepage/vendor/rockettheme/toolbox/File/src/Fil e.php(195): RocketTheme\Toolbox\File\File->mkdir(’/opt/lampp/htdo…’) #1 /opt/lampp/htdocs/grav-onepage/vendor/rockettheme/toolbox/File/src/Fil e.php(316): RocketTheme\Toolbox\File\File->lock() #2 /opt/lampp/htdocs/grav-onepage/vendor/rockettheme/toolbox/File/src/Php File.php(31): RocketTheme\Toolbox\File\File->save(Array) #3 /opt/lampp/htdocs/grav-onepage/system/src/Grav/Common/File/CompiledFil e.php(67): RocketTheme\Toolbox\File\PhpFile->save(Array) #4 /opt/lampp/htdocs/grav-onepage/system/src/Grav/Common/Config/Setup.php (163): Grav\Comm on\File\CompiledYamlFile->content() #5 /opt/lampp/htdocs/grav-onepage/system/src/Grav/Common/Grav.php(213): Grav\Common\Config\Setup->init() #6 in /opt/lampp/htdocs/grav-onepage/vendor/rockettheme/toolbox/File/src/Fil e.php on line 400
Is there a quick fix for file permissions that needs to be run? Or do I have to wrestle with the apache config files?
This happens because you do not have permission to write in the htdocs folder. If I were you I would change the folder where to put Grav. In the Apache directory there should be these two folders, among other: sites-available and sites-enabled. The first is the 000-default.conf file, in the second a shortcut file to it. You should change the DocumentRoot directive with a path which you have write rights: for example, change /opt/lampp/htdocs/ in /home/<your-username>/htdocs. Same thing for the Directory directive. You must do this by Admin, so sudo -s, etc.
Why don’t you take a look at one of our VPS hosting guides. This explains a simple way to get Grav running from a bare-bones vanilla install of Ubuntu in such a way that permissions are not an issue.
Just skip the VPS sign-up part and begin with the OS related section.
Thanks @rhukster I have it working using the linode instructions, although I have to point at localhost rather than http://linode.dev
My concern is that I am supposed to give remote help to some colleagues to install grav locally on their Macs. They are total novices in server management and this setup procedure will melt their brains!
I found that getting a local install of Grav using Xampp on windows is literally a 5 minute job. I understand that unix is a much more granular system for servers and security, but is there no way of making it a simple local install for Mac/Linux?