Multiple PHP Versions with Apache2 in Ubuntu 20

Опубликовано: 13 Октябрь 2024
на канале: WebDev Cloud
5,594
61

How to install multiple PHP versions in Linux Ubuntu 20.04 and switch between them in both cli and apache web server.

#php #apache #multiplephp #ubuntu20

commands used

to check php version
php -v

to list out all available php version
sudo update-alternatives --config php

to enable php version mode in apache with version number
sudo a2enmod php7.4

to disable php version mode in apache with version number
sudo a2dismod php7.4

to restart apache
sudo service apache2 restart