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 https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
Next once you have the EPEL repository, run:
dnf install https://rpms.remirepo.net/enterprise/remi-release-8.rpm
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
Ubuntu
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.4-mysql php7.4-dom php7.4-simplexml php7.4-ssh2 php7.4-xml php7.4-xmlreader php7.4-curl php7.4-exif php7.4-ftp php7.4-gd php7.4-iconv php7.4-imagick php7.4-json php7.4-mbstring php7.4-posix php7.4-sockets php7.4-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