cloudfire
cloudfire

Reputation: 27

How can I downgrade from PHP 7.2 to PHP 5.6 EC2 linux

I am new to Ec2. Where i have installed php 7. Php is running on ec2. But my php files are in 5.6. So whether running the file in php in ec2 linux. Its not working. So i have decide to downgrade php 7.2 to php 5.6.

How to Downgrade it. or else How can i uninstall php 7. and reinstall php 5.6.

Thanks in Advance...

Upvotes: 0

Views: 5674

Answers (2)

Rubén Pozo
Rubén Pozo

Reputation: 1083

You could use remi repository. Try with these commands:

#!/bin/bash
yum -y update
sudo yum -y install amazon-linux-extras
sudo yum -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
sudo yum -y install http://rpms.remirepo.net/enterprise/remi-release-7.rpm
sudo yum -y install yum-utils
sudo yum-config-manager --enable remi-php56 
sudo yum -y install php56-gd php56-curl php56-mysql php56-ldap php56-zip php56-fileinfo php56-php-pecl-zip
sudo scl enable php56 bash

You can find a complete guide in this link https://www.tecmint.com/install-php-5-6-on-centos-7/

Upvotes: 2

Walter Schweitzer
Walter Schweitzer

Reputation: 424

You can have multiple versions of PHP running on Linux.

$ sudo apt install php5.6 
$ sudo apt install php7.0 
$ sudo apt install php7.1 

Use the update-alternative command to switch and set the default version of PHP you want to run:

sudo update-alternatives --set php /usr/bin/php5.6

Then confirm:

php -v

Upvotes: 3

Related Questions