Multiple php versions with 8.1 on Apache
Install multiple versions and switch between them
There are a number of posts on the web that will helpfully tell you how to install multiple versions of php that you can switch between when running on apache2. This was all very simple until I installed php8.1. Once installed, I was no longer able to switch between 8.1 and any other installed version.
It's all down to php-fpm. It's just another thing that you need to take into consideration when switching between them. Here's what you do. Say you have php 5.6, 7.4 and 8.1 installed on your apache server and you want to swap to 7.4:
or you want to swap to 8.1:
Linux Tips and Tricks
80% of webservers run Linux as of June 2022