How Do I Safely Downgrade From PHP 7.4 to PHP 7.2

I’m running Linux Ubuntu 20.04.

I’m trying to install Mautic, but Mautic keeps giving me an error message saying that their software can’t process PHP 7.4 yet and that I needed to downgrade to 7.2.

What is the best way to do this?

Any support is greatly appreciated.

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Hi @AaronEsteban1,

You don’t actually upgrade or downgrade PHP versions, you can just install a second one, in your case 7.2.

Anyway, let’s see how to install PHP 7.2

**Centos 8 **

To get started, you need to add EPEL & Remi repository from where you will be able to install PHP 7.2 on CentOS 8 Linux.

dnf install

Next once you have the EPEL repository, run:

dnf install

Upon successful addition of EPEL and Remi repositories, execute the command below to get a list of available PHP module streams.

 dnf module list php

You should see an output of PHP version. The one we care about is remi-7.2, the latest PHP stream, To enable the module stream run the following :

dnf module enable php:remi-7.2

Once the PHP remi-7.2 module has been enabled, you can then proceed and install PHP

dnf install php php-cli php-common


sudo apt-add-repository ppa:ondrej/php

Update the repository index.

sudo apt update

Install PHP 7.2 with the below command.

sudo apt install -y php7.2 php7.2-cli php7.2-common php7.2-fpm

To install extensions run

sudo apt install -y php7.2-mysql php7.2-dom php7.2-simplexml php7.2-ssh2 php7.2-xml php7.2-xmlreader php7.2-curl  php7.2-exif  php7.2-ftp php7.2-gd  php7.2-iconv php7.2-imagick php7.2-json  php7.2-mbstring php7.2-posix php7.2-sockets php7.2-tokenizer

The above are the standard required extensions. Having said that it’s good to have these extensions as well.

sudo apt install -y php7.2-mysqli php7.2-pdo  php7.2-sqlite3 php7.2-ctype php7.2-fileinfo php7.2-zip php7.2-exif

Regards, KFSys