I have installed php 5.6 and and php 7.1 on my Ubuntu 16.04
I know with Apache as my web server, I can do
a2enmod php5.6 #to enable php5
a2enmod php7.1
please follow the steps :
i.e : your current version is : current_version = 7.3 , and you want to change it to : new_version = 7.2
1) sudo a2dismod php(current_version)
2) sudo a2enmod php(new_version)
3) sudo update-alternatives --config php (here you need to select php version number)
4) restart apache through :
sudo /etc/init.d/apache2 restart OR
sudo service apache2 restart