unixcop Admin

How to Install PHP 7.4 on CentOS 8 | RHEL 8

In this article, we will illustrate how to install PHP 7.4 on CentOS 8 and RHEL 8.


PHP is a general-purpose scripting language geared towards web development. The PHP reference implementation is now produced by The PHP Group. PHP originally stood for Personal Home Page, but it now stands for the recursive initialism

PHP: Hypertext Preprocessor.

PHP is the most popular server-side scripting language and used in developing static and dynamic web sites.

Install PHP 7.4

  • Enable EPEL and Remi Repository

By default CentOS 8 and RHEL 8 package repositories, PHP 7.2 / 7.3 is available and to install latest version of PHP 7.4, we must configure EPEL and REMI repositories, so to enable the repositories, run the following commands:

dnf install epel-release -y
dnf install -y
  • View available PHP versions
dnf module list php
  • Reset then Enable latest PHP Module Stream remi-7.4
dnf module reset php:remi-7.4
dnf module enable php:remi-7.4
  • Check the version of current PHP
php -v
  • Install then Verify PHP
dnf install phpphp-common php-cli 
  • Verify the PHP version again
php -v
Install PHP 7.4
Install PHP 7.4
  • While installing PHP, php-fpm is also installed as its dependency, it will be treated as FastCGI Server, so use below command to start and enable FPM service,
systemctl start php-fpm
systemctl enable php-fpm


That’s all

In this article, I hope these steps help you install and configure PHP 7.4 on your CentOS 8 and RHEL 8 System.


PHP 7.4 release notes


Please enter your comment!
Please enter your name here

Latest articles

Join us on Facebook