In this guide, we are going to learn how to install PHP 7.4 on Debian 10/Debian 9. PHP 7.4 is a minor release of PHP 7 that that comes with a lot of changes meant to boost performance and improve code readability or maintainability.
The official release of PHP 7.4 is scheduled to happen on November 28, 2019.
To see a complete list of new features and what has been deprecated on PHP 7.4, review the PHP 7.4 changelog.
Install PHP 7.4 on Debian 10/Debian 9
Add SURY PHP Repository
PHP 7.4 is not available on the default Debian 10 APT repositories. As such you need to install the SURY PHP repository.
With SURY repos, you can install PHP 7.4 beta release for testing purposes.
Install the SURY Repository Signing Key
apt install gnupg2 -y wget -qO - https://packages.sury.org/php/apt.gpg | sudo apt-key add -
Install the SURY Repository
echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" | sudo tee /etc/apt/sources.list.d/php7.x.list
Update and upgrade your system packages
apt update apt upgrade
Check the PHP 7.4 is available for installation.
apt-cache policy php7.4
php7.4: Installed: (none) Candidate: 7.4.0~beta4-1+0~20190827.2+debian10~1.gbpd41595 Version table: 7.4.0~beta4-1+0~20190827.2+debian10~1.gbpd41595 500 500 https://packages.sury.org/php buster/main amd64 Packages
php7.4: Installed: (none) Candidate: 7.4.0~beta4-1+0~20190827.2+debian9~1.gbpd41595 Version table: 7.4.0~beta4-1+0~20190827.2+debian9~1.gbpd41595 500 500 https://packages.sury.org/php stretch/main amd64 Packages
Install PHP 7.4
You can now install PHP 7.4 now that you have the repos in place.
apt install php7.4
Verify the version of installed PHP 7.4
PHP 7.4.0beta4 (cli) (built: Aug 27 2019 13:24:38) ( NTS ) Copyright (c) The PHP Group Zend Engine v3.4.0-dev, Copyright (c) Zend Technologies with Zend OPcache v7.4.0beta4, Copyright (c), by Zend Technologies
Install PHP 7.4 Extensions
To install extra PHP 7.4 modules, you can simply run the command;
apt install php7.4-extension
Where the extension is the PHP 7.4 module you want to install.
For example, to install MySQL module for PHP 7.4, simply execute the command;
apt install php7.4-mysql
Well, that is all on how to install PHP 7.4 beta release on Debian 10/9. Enjoy