On Rocky 8, per this RHEL page (enter “php” in the search boxes) it seems the php 7.2 (and 7.3) modules are EOL. php:7.4 is supported through end of 8.x release and php:8.0 goes EOL late this year. The default (even for recent installs) is php:7.2.
# dnf module list php
Last metadata expiration check: 1:11:55 ago on Mon 01 May 2023 09:39:05 AM EDT.
Rocky Linux 8 - AppStream
Name Stream Profiles Summary
php 7.2 [d][e] common [d], devel, minimal PHP scripting language
php 7.3 common [d], devel, minimal PHP scripting language
php 7.4 common [d], devel, minimal PHP scripting language
php 8.0 common [d], devel, minimal PHP scripting language
This just doesn’t seem proper for the default to be at php:7.2 rather than php:7.4. Sorry I can’t easily check a real RHEL system for comparison.
Perhaps helpful to others: I found dnf module switch-to php:7.4
is a relatively easy way to switch (easier than “reset” followed by “enable” + “distro-sync”).