PHP 7.4 on Debian for Servers

PHP

For Debian servers already stripped of sudo.

apt install -y apt-transport-https lsb-release ca-certificates wget
wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg
echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" | tee /etc/apt/sources.list.d/php.list
apt update  && apt install php7.4
apt install php7.4-cli php7.4-fpm php7.4-bcmath php7.4-curl php7.4-gd php7.4-intl php7.4-json php7.4-mbstring php7.4-mysql php7.4-opcache php7.4-sqlite3 php7.4-xml php7.4-zip php7.4-cgi php7.4-imagick

or

apt-get install php7.4-{cli,pdo,fpm,zip,gd,xml,mysql,cgi}

References:

https://www.colinodell.com/blog/201911/how-to-install-php-74