This step should have been completed upon the installation of RHEL 8.4, but if you haven’t, you can complete it with:

Update

 

# yum update

 

Now you are ready to install PHP 7.4 :

 

Check Available PHP Versions

# dnf module list php

 

Enable PHP 7.4 Module

# dnf module switch-to php:7.4

 

Install PHP and Dependancy Modules

# yum install php php-cli php-common

 

 

Now you can able to check PHP Installed Version

# php -v

 

 

PHP 7.4.19 (cli) (built: May  4 2021 11:06:37) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
    with Zend OPcache v7.4.19, Copyright (c), by Zend Technologies