This post will show you how to install PHP 7.2 on Debian 8 (jessie) or Debian 9 (stretch).
Adding the repository to apt
First off, install the required packages.
Then we need to add the sury.org GPG key.
Now we can add the repository.
Update apt cache.
Installing PHP 7.2
Now when we have the repository added, we can use apt to install php7.2
Install php7.2 using apt.
If you would like to, you can also install additional PHP packages which may be required.
Verify the installation
Verify the installation by running php in your terminal.
This should print the PHP version if installed correctly.