sudo apt-get update
sudo apt install php7.4 php7.4-common php7.4-cli
sudo apt install php7.4-curl php7.4-json php7.4-gd php7.4-mbstring php7.4-mysql php7.4-intl php7.4-bcmath php7.4-bz2 php7.4-readline php7.4-zip
sudo apt install php7.4-fpm
You can either switch completely to PHP 7.4 by
sudo a2dismod php8.1
sudo a2enmod php7.4sudo a2enmod php7.4
sudo service apache2 restart
Or, switch one particular folder to PHP 7.4 by adding the following to apache2.conf file. (Tried adding these as a separate site in sites-available
, didn't work)
<Directory /home/my_user/environment/site2>
<FilesMatch ".+\.ph(ar|p|tml)$">
SetHandler "proxy:unix:/run/php/php7.2-fpm.sock|fcgi://localhost"
</FilesMatch>
</Directory>
sudo service apache2 restart
More info: https://stackoverflow.com/a/65974193/3475839
No comments:
Post a Comment