Looks like some steps are missing in the above instruction.
It works for me like this:
sudo dnf install httpd php-fpm
sudo systemctl --now enable httpd.service php-fpm.service
sudo tee /var/www/html/info.php << EOF > /dev/null
<?php phpinfo(); ?>
EOF
sudo systemctl restart httpd.service php-fpm.service
curl http://localhost/info.php