How to Downgrade PHP 7.1 to 5.6 on Ubuntu:
Suppose your system is Ubuntu and PHP 7.1 install on your system. But your application is not supporting PHP 7.1. So you need to downgrade PHP 7.1 to 5.6 without removing the new version. You can simply switch your PHP version to default used for Apache and command line.
We are assuming both PHP version is already installed on your system. So we are mentioning the steps to downgrade the PHP.
Downgrade PHP 7.1 to 5.6
In some situation we need to downgrade the PHP version without removing the new PHP. Follow below steps to downgrade the PHP.
Default PHP 7.1 is set on your system and you need to switch to PHP 5.6.
$ sudo a2dismod php7.1 $ sudo a2enmod php5.6 $ sudo service apache2 restart
$ sudo update-alternatives --set php /usr/bin/php5.6
Was this Tutorial helpful? Help others share on Facebook, Twitter, and Google Plus!