English version was created automatically using Drupal module auto_node_translate and free DeepL translator.
Debian 9 and PHP upgrade to PHP 7.3
zveřejněno 2019-02-13
Debian 9 was released in June 2017 with PHP 7.0. As of January 2019, this version is no longer supported, nor are security fixes for it. The solution is to install new PHP from an additional repository.
Introduction
As mentioned, Debian 9 includes the now unsupported PHP 7.0. The new Debian 10 Buster, probably planned for summer 2019, will include version 7.3. For now, we'll have to fend for ourselves. https://wiki.debian.org/PHP

PHP is now releasing its versions on a yearly cycle http://php.net/supported-versions.php

In addition to this, we have Drupal, which also has its own requirements. https://www.drupal.org/docs/7/system-requirements/php-requirements and https://www.drupal.org/docs/8/system-requirements/php-requirements

And this is the table that applies to Drupal itself, but a given version of PHP must also support any additional modules.
New PHP versions in Debian
As mentioned, only PHP 7.0 is included in Debian 9 https://packages.debian.org/stable/php/php. One of the members of the Debian PHP team is Ondrej Sury https://tracker.debian.org/pkg/php-defaults, https://deb.sury.org/. And it is his repository that offers new versions of PHP for Debian (and Ubuntu), and even different versions of PHP and for several versions of Debian
- http://php.net/releases/7_0_0.php
- http://php.net/releases/7_1_0.php
- http://php.net/releases/7_2_0.php
- http://php.net/releases/7_3_0.php
Warning! You need to choose the right PHP version, your application/code may not work correctly with the latest PHP 7.3 for example, and only version 7.2 would do
The following steps I found on this blog https://computingforgeeks.com/how-to-install-php-7-3-on-debian-9-debian… describe how to install version 7.3
apt -y install lsb-release apt-transport-https ca-certificates
wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg
echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" | tee /etc/apt/sources.list.d/php7.3.list
apt-get update
apt-get -y install php7.3
And we're done:

But beware - the system now offers us several versions of PHP, so even when installing additional PHP modules you need to specify the correct version.
root@deb9php:~# apt-cache search php-gd
php7.0-gd - GD module for PHP
php-gd - GD module for PHP [default]
php5.6-gd - GD module for PHP
php7.1-gd - GD module for PHP
php7.2-gd - GD module for PHP
php7.3-gd - GD module for PHP
And if you are used to installing some PHP-dependent application using debian packages, such as phpMyAdmin, it may have a dependency on a particular version of PHP.