• Tips how to use Flatfile CMS Grav with simple PHP webhosting

    I’m now using Grav for more than 6 months on my website Fussball im FreeTV so I thought it’s now about time to write a summary in order to help new users. Maybe you run into the same questions….

    How everything started

    Fussball im FreeTV is available as app for iOS, Android and WindowsPhone. Next to the apps I also want to supply the information on the internet in case someone wants to have a look with his browser instead of a dedicated app. The website is hosted on a very basic webhosting package from IP-Projects (I don’t get any donation or else from them but I could really recommend them for their very fair prices and excellent support. And as you see, Grav works perfect there. And they never complained when I used more diskspace than I’ve paid for, see below). First I thought about installing WordPress as I’ve done multiple times before. But do I need all this stuff? Do I need a user interface? The requirements are clear: I want to set up a system and maintain the data automatically. The data is already available in a database, so I want to write a simple export which will then automatically upload the new pages to the new system. I don’t need an admin nor a user interface. I don’t need a MySQL-Database. I just want to configure it once. So why not have a look at some new upcoming Flatfile CMS?

     

    About Grav

    I searched around for some PHP flatfile cms. I’ve already used Dokuwiki  before. I liked it, but I wanted to use something new. Curiosity is always a good thing! So I evaluated some of them, and in the end I decided to use Grav for several reasons:

    1. It’s free
    2. It’s open source (on Github)
    3. It’s created by RocketTheme. Well, I don’t know their quality, but I’ve seen them for years so I guess there is a good team supporting this CMS. I just want to avoid that the main developer somewhen retires. Of course this might happen also in this case, nevertheless it gave me a bit more trust.
    4. They have fast support in their forum
    5. There were already several plugins (around 20 as far as I remember) which fit to all my requirements.
    6. They have a good documentation
    7. Works fine with just PHP and FTP.

    So I installed Grav, and now half a year later I’m still very happy with my decision!

     

    Install Grav on webhosting

    Installing Grav means: Just upload the files via FTP! Of course you might have a closer look at the installation guide. Only problem: For updating it’s recommended to do some command line actions, but I don’t have SSH access in my little webpackage…. Anyway it’s also possible to update manually. Grav has a very good separation of common code and user changes so you could update Grav core or any plugins without overwriting your own settings! It really works brillant and I never ran into any problems. Nevertheless it’s of course recommended to backup your whole grav path before installing updates. So yes, it works fine on simple PHP Webspace without SSH access!

     

    Your own settings

    As said before, Grav separates the code from your settings. But of course you have to take care to do your settings in the right path. Therefore make sure you understood the basic tutorial  to avoid changes within e.g. a system directory instead of your own user directory!

     

    Disable cache

    Some weeks after installation I’ve noticed that I could not upload any new files to the webspace. Nevertheless everything worked fine. I’ve logged in to the admin panel of my webhosting package and saw that I’ve hit the limit: I’m using more diskspace than I should! I tried to download my whole Grav path and found the reason: The cache-directory contained thousands of (sub)directories! Subdirectories like /30/a7/1e/5d/66/05/8b/51/2e/b1/11/… Not sure whether this was the reason for the admin panel to count a wrong size but I tried to disable the cache…. Well, that did not work, because I could not upload / modify any files on my website. So I took the site offline, disabled the cache in user/config/system.yaml and started to delete the directories. Did you every tried to delete hundred of thousands of subdirectories via FTP? It takes hours! Therefore I was really happy to find CacheBuster some days ago. Seems Gertt had a similar problem…. I installed it and it works like a charm! After deleting all cache-subdirectories, admin panel showed a correct size of 400 MB instead of 1.7 GB, and now I was able to upload files again. So my advice: Take care about your cache! Grav offers several cache options, but it’s always good to install CacheBuster first so you have an easy solution if you ran into similar problems.

     

    Update Plugins via Admin Panel

    Since some weeks, Grav has an Admin Panel plugin. Yes, it’s currently beta, and there are still some bugs or missing features. Nevertheless it’s already brillant for keeping your plugins uptodate. Previously, on manual update, you had to download the zip from github, extract, and upload via FTP. Now it’s just one single click! And additionally it’s also just one single click for backup! (Nevertheless I still grab a backup via FTP manually in case of Grave core updates…. you never know). So now it’s also dead-easy to update plugins without SSH access!

    Update Themes via Admin Panel

    Updating themes is as easy as updating plugins via Admin Panel. Thought so. Unfortunately some parts of my own design got lost when I updated the Antimatter theme. I must admit that I made some changes directly in the themes directory, ignoring the separation of the plugin data and my own modifications… I should have read Easy Theme Development with Inheritance  before… So now I had to do this manually. Comparing all the files to find my changes… Hope you read this article before changing the theme on your own! Otherwise you might download your current version from the release path of Antimatter theme

     

    Summary

    After 6 months of usage, I could recommend Grav if you need a simple CMS and if you have a technical background and like to play around a bit. Current release of Grav is 0.9.37, so it’s close to the first major release. Nevertheless you should have at least little knowledge about FTP, and also HTML / PHP might be helpful. And of course you don’t have thousands of plugins like WordPress, Drupal or Joomla. But for a little filebased CMS, Grav will probably fit your needs!

Leave a comment

If you want to share your opinion, leave a comment.

You may use these HTML tags and attributes:

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>