Is all of PHP installed?
# rpm -qa | grep -i php
And is it configured into Apache?
# grep -i php /etc/httpd/conf.d/*
/etc/httpd/conf.d/php.conf:# PHP is an HTML-embedded scripting language which attempts to make it
/etc/httpd/conf.d/php.conf:LoadModule php4_module modules/libphp4.so
/etc/httpd/conf.d/php.conf:# Cause the PHP interpreter handle files with a .php extension.
/etc/httpd/conf.d/php.conf: SetOutputFilter PHP
/etc/httpd/conf.d/php.conf: SetInputFilter PHP
/etc/httpd/conf.d/php.conf:# Add index.php to the list of files that will be served as directory
/etc/httpd/conf.d/ssl.conf:<Files ~ "\.(cgi|shtml|phtml|php3?)$">
There are basically no problems with PHP and Apache on RedHat 8. At the very least not with a simple "hello world" type program. Something isn't installed or enabled or something.. Stock if you install apache and php on RH8 it should just work, it will be configured as part of the install.