but the code was just displaying in the browser as is rather than executing. this seems like its happened many times before, but since this is a new env, I thought I should ask first.
Virtualmin works mainly with individual server domains. I don’t know if php is set up for that server? Does it do this for any virtual server you have added?
Try reading the docs (I know we all look at documentation last), your treating virtualmin as if it was a clean install of Rocky with apache default config.
That’s almost always because mod_php has been installed on the system. Don’t install mod_php. If you’ve installed mod_php you should uninstall it. mod_php is in the php or phpVERSION-php package on EL systems.
That’s never going to do anything on a properly configured Virtualmin system. /var/www is not where any DocumentRoot will be or should be.
Virtualmin domain document roots live in /home/domainname/public_html.
You have a couple of special-cased CGI bins in /var/www on your old system, for reasons we’ve already discussed at great length. But, no document root should ever be there, and no PHP will ever be there.
i keep “install scripts” from my last server rebuild. this is done in case I want/need to migrate to another service, and hopefully, I can keep the project time to under a day.
also, I keep them around in case of an emergency.
these install scripts contain tests that may have worked at one time, but not anymore so they need to be removed.
and apparently running a PHP script from /var/www/html is a good example of an obsolete test so I have just learned.
so of course these install scripts should be kept as current as possible.
probably for the php test I will include something like this in the install scripts:
If you are running multiple websites, then yes, this is not the setup used by many anymore. If you are setting up a single host, then it is still probably valid.