A PC running Debian 9 (Stretch)
An internet connection
Root access using sudo or su

Step 1:

Install the latest version of apt-transport-https, lsb-release, and ca-certificates using
$~: sudo apt install apt-transport-https lsb-release ca-certifiactes

Step 2:

Fetch the repository key using
$~: sudo wget -O /etc/apt/trusted.gpg.d/php.gpg

Step 3:

Option 1: using Su:

Add to your sources list using
#: echo "deb stretch main" > /etc/apt/sources.list.d/php.list

Option 2: using Sudo:

Add to your sources list by entering the following command
$~: sudo apt edit-sources
then add the following line to the end of the file that opens
deb stretch main

Step 4:

Update your packages list to include the new packages using
$~: sudo apt update