First method:
You can install it manually by:
wget http://ftp.us.debian.org/debian/pool/main/p/php7.4/php7.4_7.4.1-1_all.deb
And then:
dpkg -i php7.4_7.4.1-1_all.deb
It gives you a lot of dependencies which you must install before this package. It's the hardest method. Look at the second method which is much easier.
Second method:
Ensure your system is updated:
sudo apt update
Download and store the PPA repository in a file but first, download the GPG key:
sudo apt -y install lsb-release apt-transport-https ca-certificates
sudo wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg
Then add the repository:
echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" | sudo tee /etc/apt/sources.list.d/php.list
The last step is to install PHP 7.4 on your Raspbian Buster. Before installation, update the system package list on added repositories:
sudo apt update
Then install PHP 7.4:
sudo apt -y install php7.4
I just tested it and worked. I got the exact version by php -v
:
PHP 7.4.2 (cli) (built: Feb 2 2020 07:53:49) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
with Zend OPcache v7.4.2, Copyright (c), by Zend Technologies