I updated PHP 5 to PHP 7, but I noticed the old version was still configured in my Apache server, so I uninstalled it. Then everything got messy and being all this confusing as this is unless you're an experienced administrator, I just reinstalled apache2 with PHP 7.
However, now the PHP module is not even working because text is being rendered plainly. I am trying to reinstall the PHP 7 module into my apache server but something weird is happening:
When I try installing it with sudo apt-get install libapache2-mod-php7.0, I am getting a dpkg error, but the module is being installed because if I run sudo apt-get remove libapache2-mod-php7.0 it can be uninstalled.
So what can I do? How can I properly install and configure the PHP 7 module in Apache?
Edit
I ran sudo dpkg --configure -a and got this output:
Configuring libapache2-mod-php7.0 (7.0.7-4+deb.sury.org~trusty+1) ...
dpkg: error processing package libapache2-mod-php7.0 (--configure): subprocess installed post-installation script returned error exit status 1
Errors were found processing: libapache2-mod-php7.0 13 1 Answer
Disable 5.6 mod first
sudo a2dismod php5.6Now you should enable PHP7 ones:
sudo a2enmod php7.0To reflect changes Apache restart is required:
sudo service apache2 restart