How to upgrade Virtualmin scripts when PHP version checks fail

When things have been running for long enough various updates and configuration changes start adding up with leftovers bound to cause an issue sooner or later.
With Virtualmin, one such issue is the system’s inability to automatically update its scripts to newer versions based on the incorrect detection that an older PHP version is running on the server instead of the actual one.