PHP 7.3 is the latest stable release available for the installation. This tutorial will help you with the installation of PHP latest version on your Debian system. Now follow this tutorial to Install PHP on Debian 10, Buster.
Debian 10 is still under development. So this tutorial is tested with Debian 10 daily build version.
Login to your Debian 10 system using shell access. For remote systems connect with SSH. Windows users can use Putty or other alternatives applications for SSH connection.
Run below commands to upgrade the current packages to the latest version.
sudo apt update sudo apt upgrade
Setup PPA on Debian 10
Let’s execute the following commands to install the required packages first on your system. Then import packages signing key. After that configure PPA for the PHP packages on your system.
sudo apt install ca-certificates apt-transport-https wget -q https://packages.sury.org/php/apt.gpg -O- | sudo apt-key add - sudo echo "deb https://packages.sury.org/php/ buster main" | tee /etc/apt/sources.list.d/php.list
You Debian 10 system is ready for the PHP installation.
Install PHP on Debian 10
You can also install the Latest PHP version on your system. Run the following commands to install PHP 7.3 on Debian 10. To install other PHP version change php7.3 with your versions like “php7.2”, “php7.1” or “php5.6” etc.
sudo apt update sudo apt install php7.3
Also, install the required PHP modules.
sudo apt install php7.3-cli php7.3-common php7.3-curl php7.3-gd php7.3-json php7.3-mbstring php7.3-mysql php7.3-xml
Check Active PHP Version
After installation verify the installed and active PHP version using the following command.
php -v PHP 7.3.6-1+0~20190531112640.39+buster~1.gbp6131b7 (cli) (built: May 31 2019 11:26:40) ( NTS ) Copyright (c) 1997-2018 The PHP Group Zend Engine v3.3.6, Copyright (c) 1998-2018 Zend Technologies with Zend OPcache v7.3.6-1+0~20190531112640.39+buster~1.gbp6131b7, Copyright (c) 1999-2018, by Zend Technologies
Congratulation! Enjoy the development with PHP on Debian 10 Buster system.