PHP and Apache2 broken after upgrade to Ubuntu 16.04
Ubuntu 16.04 comes with PHP 7.0. You need to install libapache2-mod-php
package and then disable all traces of PHP5.
- Uninstall PHP5.x package:
sudo apt-get purge php5-common
(this will remove all PHP 5 packages. - Install default (7.0) PHP apache2 SAPI:
sudo apt-get install libapache2-mod-php
- If the apache2 is still broken do:
sudo rm /etc/apache2/mods-enabled/php5.*
to disable PHP5 mod and enable PHP 7.0 withsudo a2enmod php7.0
.