Ive usually installed PHP via:-
sudo apt install php libapache2-mod-php php-mysql
Which works great and installs the latest version of PHP and configures everything fine :-)
Problem is I want some of my sites to run on PHP 5 (for historical purposes), some to run on the current version of PHP 7 and some to run on a future version of PHP 7 for testing.
On my hosting website, I can add a line into the vhost configuration to tell it what version of PHP to run, for example to run PHP7 I just add this into the htaccess file and it runs the site with PHP 7:-
AddType application/x-httpd-php70 .php
This is exactly what I want to do, however all the guides Ive found online talk about running everything under the same version, but not individual sites.
Anyone got any ideas on this?
Ideally I want to download different versions of PHP into a folder \PHP\PHP7.3\ and then inside htaccess point to use \PHP\PHP7.3\ or something different.
Im using Ubuntu server with Apache if that helps, and this is only for development purposes, not production.