Install PHP
1.Add the EPEL (Extra Packages for Enterprise Linux) repository
#dnf install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
2.Add the REMI repository for Rocky Linux 9
#dnf install https://rpms.remirepo.net/enterprise/remi-release-9.2.rpm
3. Install yum utilities.
#dnf -y install yum-utils
4.Verify the list of an available repositories on the Rocky Linux system
#dnf repolist
5.To enable php 8.3 Remi repository.
#dnf module reset php
#dnf module install php:remi-8.3
#dnf update
6.Check available PHP modules on your system
#dnf module list php
7.Install PHP packages
#dnf install php
8.Verify the PHP version
#php --version / -v
9.Install additional PHP extensions
#dnf install php-mcrypt php-{imagick,apcu,geoip,memcached,zstd}
10.Verify all available PHP extensions on your system
#php -m
#php -m | grep imagick