Install PHP 7.3 on debian 9

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 repositry key using
$~: sudo wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg

Step 3:

Option 1: using su:

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

Option 2: using sudo:

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

Step 4:

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

Copyright © 2019, Alex V.

This site is licenced under the Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License
Problems? Contact the Webmaster