Skip to Content

How to downgrade PHP 7.4 to 7.1 in Centos ?

Downgrade PHP version 7.4 to 7.1 in Centos 

In this article, we will learn to downgrade php version 7.4 to version 7.1 in centos. For this, we will use some commands which we have explained in the given an example. Using this command, we can also downgrade php version 7.3 to version 7.2 centos, php version 7.2 to version 7.1 centos, php version 7.2 to version 7.0 centos, centos version 7.4 to version 7.3 php. Sometimes, many projects do not support the latest versions of the software. That's why we require downgrading the php new version to the old version.

The following are the steps to downgrade the PHP 7.4 to the 7.1 version in Centos. 

1.Before starting, check the version of PHP you are using.

[root@localhost ~]# php -v
PHP 7.4.33 (cli) (built: Dec 19 2022 13:32:43) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies

2.Downgrade from PHP 7.4 to 7.1:

[root@localhost ~]# yum remove "php-*" -y

 

3.Disable the php 7.4v and enable the php7.1v.Install the php modules of 7.1v as well.

[root@localhost ~]# yum --disablerepo=remi-php74 --enablerepo=remi-php71 install php php-gd php-mbstring php-mysql php-curl php-mcrypt

4.Check the version of PHP again.

[root@localhost ~]# php -v
PHP 7.1.33 (cli) (built: Dec 20 2022 07:49:28) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.1.0, Copyright (c) 1998-2018 Zend Technologies

 

After changing the PHP versions in Ezeelogin make sure you have changed the version of PHP in ioncube loader also.