Install epel-release
yum install -y epel-release
check all available PHP versions using the following command:
dnf module list php
// with following output
Oracle Linux 8 Application Stream (aarch64)
Name Stream Profiles Summary
php 7.2 [d] common [d], devel, minimal PHP scripting language
php 7.3 common [d], devel, minimal PHP scripting language
php 7.4 [e] common [d], devel, minimal PHP scripting language
php 8.0 common [d], devel, minimal PHP scripting language
The default PHP version is set to PHP 7.2. If you want to install the latest PHP 7.4, you will need to reset the default PHP steams.
Run the following command to reset the default PHP
dnf module reset php
Next set php7.4 as default
dnf module enable php:7.4
Now you can install php7.4
yum install php php-common