Recommended VPS Complete list of best VPS hosting providers.

Fix PHP Not Rendered on Ubuntu LAMP Server

Some users reported that they could not make PHP to render their PHP scripts / pages when they installed Apache webserver and PHP7 on Ubuntu 16.04 server / vps. Well, recently I found out that they might have just missed some dependencies to install. Ubuntu 16.04 comes with PHP7 package by default. Hence if you have managed to install via apt-get then most-likely you’ll have PHP7 to install. Some users blamed PHP7 incompatibility but since the phpinfo page doesn’t work that it means that PHP does not render any php pages. How to fix it then?

Actually it’s simple. The main cause is that libapache2 module and libapache2 for php7 module are not installed yet. Simply use apt-get command to install those missing modules and restart Apache2 to solve the problem :

apt-get install libapache2-mod-php -y
service apache2 restart

that’s it.

libapache2-mod-php7.0 module

Please read my complete guide on how to install LAMP on Ubuntu 16.03 server.

Add a Comment

Your email address will not be published. Required fields are marked *

Get more stuff like this
in your inbox

Subscribe and get interesting stuff plus faster updates to your email.