
Update repository pacakge index sudo apt update
Lets start by adding the repository PGP key: wget -q -O- | sudo apt-key add -Īnd add the PHP repository to your apt sources (adjust for the Raspberry OS version you are running, stretch/ buster or bullseye) echo "deb buster main" | sudo tee /etc/apt//php7.list
How to install sqlite on raspberry pi how to#
So how to get a fresh version of PHP then ? Luckily the Debian PHP maintainer hosts a repository with fresh version of PHP and it includes armhf (armv7 only!) versions too.
Optional: Parallel install other PHP versions. In this guide we will start with installation of version 7.3 Add apt source repository for uptodate PHP packages. It is not as a Apache module, libapache2-mod-php, anymore! And there is also the issues of the recommended way to run PHP these days. This tutorial will show installation instructions for PHP 7.3 but in case you need to use something else like 7.4, 8.0 or 8.1, just adjust the versions in the package and commands. Note: The packages are not compatible with the ARMv6 based Raspberry Pis, you need to be using a ARMv7 or ARMv8 based Raspberry Pi 2, 3 or 4. And with PHP that is especially a big issues as upstream PHP support is time limited, the only properly supported branch from PHP 7 is version 7.4 and even that will soon be EOL ( with security updates until ).ĭebian Buster comes with version 7.2.9 that is already EOL:ed upstream and 7.3 is on security fixes only. Pretty straight forward operation ? Sure, it is just an apt-get away, but once again we have the issue of old version in Buster (and Stretch if you are still on that).