White Screen - PHP 7 on Ubuntu 16.04 fails to render scripts

The official Ubuntu 16.04 package is libapache2-mod-php7.0 (7.0.4-7ubuntu2), but it looks like you have gone outside of the supported software (i.e., the Ubuntu Main repository) following instructions sudo add-apt-repository ppa:ondrej/php in your link. Get rid of this, get rid of the ppa, and use the officially supported php 7.0 from the Ubuntu Main respository.

That said, it also looks like you may have installed libapache2-mod-php without also installing php. Using the "official" (supported) repository, the Ubuntu 16.04 Server Guide's Web Server section for PHP would suggest that the correct install command is:

sudo apt install php libapache2-mod-php

Finally, it looks like the ppa you are using was prepared for Ubuntu 14.04, as opposed to Ubuntu 16.04. There are significant differences between these versions, not the least being use of systemd as the init system. It is very conceivable that the "version" you obtained may have substantial issues on Ubuntu 16.04.


That "guide" was written by me, and it was targeting 14.04, when php 7 was still not officially released. Currently it might not even work on 14.04 as the package maintainer might have changed the package names.

Sorry for the inconvenience.


  1. sudo apt purge libapache2-mod-php7.2 libapache2-mod-php7.2

  2. sudo apt install libapache2-mod-php7.2 libapache2-mod-php7.2

  3. sudo a2enmod php7.2

  4. systemctl restart apache2

This works in the 7.2 version, just add at the end of php -> 7.2