sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
apt install php7.4-common php7.4-cli php7.4-zip php7.4-opcache php7.4-mysql php7.4-mbstring php7.4-json php7.4-intl php7.4-gd php7.4-fpm php7.4-curl php7.4-bz2 php7.4-bcmath php7.4-imap php7.4-recode php7.4-soap php7.4-xml php7.4-imagick php7.4-memcache php7.4-memcached php7.4-igbinary php7.4-msgpack php7.4-redis
Copy the php7.4-fpm pool configuration from php7.0-fpm
cp -f /etc/php/7.0/fpm/pool.d/www.conf /etc/php/7.4/fpm/pool.d/www.conf
Edit the listening port of php7.4-fpm (for example 9074 instead of 9070)
nano /etc/php/7.4/fpm/pool.d/www.conf
Replace the line listen = 127.0.0.1:9070
by listen = 127.0.0.1:9074
Restart the service
service php7.4-fpm restart
Then to use php7.4-fpm, you have the choice between
In this case just edit the file /etc/nginx/conf.d/upstream.conf and replace the line server 127.0.0.1:9070;
by server 127.0.0.1:9074;
nano /etc/nginx/conf.d/upstream.conf
Then reload nginx
service nginx restart
Add the following lines in /etc/nginx/conf.d/upstream.conf
upstream php74 {
server 127.0.0.1:9074;
}
then copy the files /etc/nginx/common/php7.conf into /etc/nginx/common/php74.conf
And into this copy replace the line fastcgi_pass php7;
by fastcgi_pass php74;
Reload nginx and you can replace the line include common/php7.conf;
by include common/php74.conf;
in the vhosts of your choice