I began writing this post when PHP moved from version 5 to version 7. I had written most of the post but it has languished incomplete and unpublished. now more recently, i have upgraded from 7.3 to 7.4!
To show the current supported PHP version in the repositories:
apt show php -a Package: php Version: 2:7.3+69 Priority: optional Section: php Source: php-defaults (69) Maintainer: Debian PHP Maintainers Installed-Size: 12.3 kB Depends: php7.3 Download-Size: 5,964 B APT-Manual-Installed: yes APT-Sources: http://mirror.ox.ac.uk/debian testing/main amd64 Packages Description: server-side, HTML-embedded scripting language (default) PHP (recursive acronym for PHP: Hypertext Preprocessor) is a widely-used open source general-purpose scripting language that is especially suited for web development and can be embedded into HTML. . This package is a dependency package, which depends on latest stable PHP version (currently 7.3).
Check the running php version
php -v
PHP 7.3.8-1 (cli) (built: Aug 7 2019 09:50:45) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.8, Copyright (c) 1998-2018 Zend Technologies
with Zend OPcache v7.3.8-1, Copyright (c) 1999-2018, by Zend Technologies
Running versions of PHP can be set using a2enmod to enable and a2dismod to disable. apache is restarted afterwards.
sudo a2dismod php5 sudo a2enmod php7.0 sudo service apache2 restart
In the example above PHP 5 has been turned off and PHP 7 enabled.
Similarly its possible to follow the above upgrading from PHP7.3 to PHP7.4.


