Getting started with Grav and Apache on Ubuntu 18.04

Hello folks;

First off, I’m a relative newcomer to Grav. I started by installing PHP. The PPA for Ubuntu has version 7.3.7, which I’ve installed. For my first experiments I unpacked Grav 1.3.9 to a location in my user home and ran the built-in PHP server. This gave me some confidence, thank you!

Next, I found that the PHP install included Apache2, so I’m using that. The web root is at /var/www/html. I downloaded Grav 1.3.11 and have tried to use that. I unpacked Grav as /var/www/html/grav-admin.

At this point, opening localhost produces the Apache greeting but opening localhost/grav-admin only produces a blank page.

I Googled and found comments that folks are having issues with Apache not being able to run PHP. So, in a new subdirectory /var/www/html/grav I entered a PHP hello program which I saved as index.php

<?php echo "Hello World!"; echo "PHP is so easy!"; ?>

In using Firefox to open localhost/grav I see the following…

Hello World!PHP is so easy!

So, maybe this is proof that Apache2 is serving PHP code? In any case, I’m stuck. Any and all advice will be appreciated, thanks in advance.

So far, I’ve found a reference about the proverbial, “PHP white screen of death…” and that looking at log files is a good thing to do…

I found an entry in /var/log/apache2/error.log that indicates that php7 wasn’t able to create a directory, which tells me that there is an issue with permissions.

Okay, now the Grav troubleshooting documentation has a section on dealing with permissions. I’m back to digging…

Okay, I’ve opted to use group file permissions… I created a group named grav, added www-data as well as root to the group, then chown -R to the grav-admin folder to the grav group.

Then I restarted apache2, used Firefox to open localhost/grav-admin and received the “Grav Problems” page, telling me that curl is not installed, which I presume means php-curl.

But according to the system package manager, php-curl as well as curl are both installed. Back to digging… how can this be?

Okay, another step forward. I looked closer and found that somehow I ended up with php-curl which has a dependency on php version 7.2, while I have a flavor of php version 7.3.

I’ll admit that when I decided to go live with Grav, that I updated my system to Ubuntu 18.04 which has LTS. I’m guessing that’s where things broke on me…

After uninstalling and installing php-curl, verifying the dependencies, restarting apache2, I opened grav and made a new administrator account. I’ll leave grav-admin where it is, for now… and with a smile on my face, I’ll call it a night…

Check this instalation howto on linux