I need to have PHP 5 and 7 working concurrently because of the need to use two PHP extensions that are only built for exclusively versions 5 and 7.
I've got this working with Nginx by naming the pages that call on the PHP 5 extension to e.g. page.php5, and having location blocks as follows:
location ~ \.php5$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/var/run/php5-fpm.sock;
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
}
Works fine. But how to do the same with Apache? I've read about having different virtual hosts, one using a PHP module and one using fast-cgi, but ideally I'd rather have something much closer to the location method above and have just the one host.
Can this be done?
Thanks.