Skip to Content

How to downgrade PHP 7.4 to 7.1 in Centos ?

Downgrade PHP version 7.4 to 7.1 in Centos 


Overview: This article helps Linux user to downgrade PHP from higher version(7.4) to lower version(7.1) on CentOS.


 Additionally, these steps can be used to downgrade PHP to various versions on CentOS, including 7.4 to 7.3, 7.3 to 7.2, 7.2 to 7.1, and 7.2 to 7.0. Since some projects may not be compatible with the latest PHP versions, downgrading to an older version is sometimes necessary.

Follow the steps below to downgrade PHP from version 7.4 to 7.1 on CentOS.

Step 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

Step 2: Remove the existing PHP 7.4 installation:

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

Step 3: Disable the PHP 7.4 repository, enable the PHP 7.1 repository, and install PHP 7.1 along with required modules:

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

Step 4: Verify the PHP version after the downgrade:

[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

Step 5: After downgrading PHP in Ezeelogin, ensure that the Ioncube Loader version is also updated accordingly.


Related Articles:

PHP extension ’mcrypt’ is required.

PHP Fatal error

PHP Fatal error: The file /usr/local/sbin/backup_ezlogin.php was encoded by the ionCube Encoder for PHP. Ioncube Encoder Error during Ezeelogin upgrade

PHP function ’exec’ is not available.

How to install and switch different versions of PHP in Ubuntu?