I have seen this a lot of times, Whenever I install Virtualmin and then install a wordpress script, It always installs the php 5.4 or 7.2 with it, But the wordpress’s latest version asks for a newer php version. And then we need to ssh and install the latest php package. Why this workaround is needed, when you can just include the latest php with the virtualmin?
This is because Virtualmin installer doesn’t install anything extra on its own but relies on what your standard OS repositories provide. If you want out of the box newer PHP version installed, simply use newer OS version. For example Alma Linux 8 or Ubuntu 20.04.