How to change PHP 7 to PHP 5.6 on Ubuntu16 - Pirates Tech | How To - techOcean


Wherever we want to go, we go... that's what a ship is, you know.

-Captain Jack Sparrow

The seas may be rough, but I am the Captain! No matter how difficult, I will Always Prevail.

-Captain Jack Sparrow

Tuesday, 2 August 2016

How to change PHP 7 to PHP 5.6 on Ubuntu16

 By default Ubuntu 16.04 (Xenial) comes with php 7.0
 You can install php 5.6 in parallel and switch between them

Steps To Begin Open Terminal Get root Access by typing su

-> add-apt-repository ppa:ondrej/php

-> apt update

-> apt install php5.6 libapache2-mod-php5.6 php5.6-curl php5.6-gd php5.6-mbstring php5.6-mcrypt php5.6-mysql php5.6-xml php5.6-xmlrpc

-> a2dismod php7.0

-> a2enmod php5.6

-> service apache2 restart

 sudo ln -sfn /usr/bin/php5.6 /etc/alternatives/php

Now PHP 5.6 is Enabled

Switch PHP version:

    From php5.6 to php7.0 :
        sudo a2dismod php5.6 ; sudo a2enmod php7.0 ; sudo service apache2 restart

        sudo ln -sfn /usr/bin/php7.0 /etc/alternatives/php

    From php7.0 to php5.6:
        sudo a2dismod php7.0 ; sudo a2enmod php5.6 ; sudo service apache2 restart

        sudo ln -sfn /usr/bin/php5.6 /etc/alternatives/php

If you want to disable the proxy_fcgi apache module:
sudo a2dismod proxy_fcgi proxy; sudo service apache2 restart

No comments:

Post a Comment