Upgrading and Downgrading PHP 5.6 and 7.0

Followed the instructions
https://askubuntu.com/questions/761713/how-can-i-downgrade-from-php-7-to-php-5-6-on-ubuntu-16-04#answer-762161

Possible Errors

If you need to install a new fresh apache2
https://askubuntu.com/questions/451674/cant-install-apache2-again#answer-451679

If you come across an error similar to below when running
$ systemctl status apache2.service

ERROR:
 *** Restarting web server apache2                                                                                                                                          [fail]
 * The apache2 configtest failed.
Output of config test was:
apache2: Syntax error on line 140 of /etc/apache2/apache2.conf: Syntax error on line 1 of /etc/apache2/mods-enabled/php7.load: Cannot load /usr/lib/apache2/modules/libphp7.so into server: /usr/lib/apache2/modules/libphp7.so: cannot open shared object file: No such file or directory
Action 'configtest' failed.
The Apache error log may have more information.**

Solution:
$ sudo apt-get install libapache2-mod-php7.0
https://askubuntu.com/questions/536128/apache2-start-error-when-using-php5-module-ubuntu-server#answer-536141

If error “AH00534: httpd: Configuration error: More than one MPM loaded”

Solution:
Disable all apache2/mods-enabled/mpm* except for mpm_prefork
https://stackoverflow.com/questions/24060620/error-starting-apache-httpd-configuration-error-more-than-one-mpm-loaded#answer-25447262
http://www.mylinuxguide.com/apache-is-running-a-threaded-mpm-but-your-php-module-is-not-compiled-to-be-threadsafe/

tags:
php5.6
php7.0