This tutorial describes the installation and configuration of two VirtualHost on Apache with separate PHP versions. First VirtualHost will work with PHP 5.6 and another VirtualHost will run with PHP 7.2. So just go through this tutorial.
This LAMP tutorial explains how to use Ansible to automate the process of installing and setting up a LAMP (Linux, Apache, MySQL and PHP) environment on Ubuntu 18.04. How to use Ansible to automate the steps contained in guide on How To Install Linux, Apache, MySQL and PHP (LAMP) on Ubuntu 18.04.