How To Install PHP (7.4, 7.3 & 5.6) on Debian 9 Stretch

Prerequisites#

Login to your Debian 9 system using shell access. For remote systems connect with SSH. Windows users can use Putty or other alternatives applications for SSH connection.

ssh root@debian9

Run below commands to upgrade the current packages to the latest version.

sudo apt update 
sudo apt upgrade

Let’s execute the following commands to install the required packages first on your system. Then import packages signing key. After that configure PPA for the PHP packages on your system.