Debian 9 allows installing PHP 7.0 using apt, as I explained in this link (in Spanish).
In this post, I will go to explain how to install PHP 7.3, whose publication date (GA: General Availability) is December 6, 2018.
Thus I will use the DPA (Debian Package Archive) available at https://deb.sury.org/ , since the official version is not so updated.
$ sudo apt update $ sudo apt install apt-transport-https lsb-release ca-certificates $ sudo wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg $ sudo sh -c 'echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/php.list' $ sudo apt update
Below I check the packages available in this DPA
$ sudo apt search php7.3
To finish the work, I install the packages I need, including the nginx server
$ sudo apt install -y nginx php7.3 php7.3-common php7.3-cli php7.3-fpm php7.3-mysql php7.3-xml php7.3-curl php7.3-mbstring php7.3-zip
To verify that PHP 7.3 is installed
$ php -v PHP 7.3.0RC4