You can add php56 with a software collection. there is a thread here https://www.virtualmin.com/node/38648 with some info. it was pretty easy to do even for a noob like me, i put some notes on how to in the thread.
Then select PHP 5.6 in the virtual server PHP Configuration.
I don’t know Magento, but maybe you’ll need to install some additional modules. Please kindly refer to their official documentation.
Please note that Virtualmin is unable to manage MySQL/MariaDB SCLs, but you should just have to enable to service. AFAIK the SCLs run on Port 3307 or similar instead of the default MySQL/MariaDB-Port 3306, but you should probably check that via netstat. You should also run mysql_secure_installation in a shell with the respective SCL enabled to properly do the initial database setup. For example:
Virtualmin just uses the software versions that come with the distro you’re using. Also, we don’t recommend using software from third parties, as that can introduce a lot of complications.
PHP is a bit simpler, as you can install a second PHP version alongside your existing PHP version using the CentOS SCL repository.
But that’s not so simple with MySQL.
Our recommendation is generally to use a Linux distribution that provides the software you are interested in.
However, as described above, there are ways to use newer MySQL/MariaDB versions, such as using the SCL repo, or directly from the MySQL/MariaDB websites. If you wish to go that route though, I’d highly recommend testing the process on a test server, rather than trying it for the first time on your live/production server.