RHEL and CentOS

At the time of writing, Red Hat Enterprise Linux (RHEL) 8 and CentOS 8 were the current versions of these RPM-based Linux distributions. Both ship with PHP 7.2 by default.

The package repository maintained by Remi Collet is commonly used for installing newer PHP versions on RHEL and CentOS, including PHP 7.3 and PHP 7.4. Here is how you can add this repository to your package manager configuration and upgrade to PHP 7.4:

$ sudo dnf install \
  https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm

$ sudo dnf install \
  https://rpms.remirepo.net/enterprise/remi-release-8.rpm

$ sudo dnf install yum-utils

$ sudo dnf module reset php

$ sudo dnf module install php:remi-7.4

$ sudo dnf update