How to upgrade to PHP 7.4+/8+ (Debian 10)?

Hi people,

I've installed Pi-Hole years ago on a Raspi4 from the official image. This comes with Debian 10 and PHP 7.3.

My Pi-Hole setup is up to date : Pi-hole v5.9, FTL v5.14, Web Interface v5.11.

I'm wondering if there is any interest (it seems to) to upgrade to PHP 7.4 (or maybe 8, if compatible?)? And, if applicable, how to proceed safely (using official repos)?

Thanks in advance for your help, :slightly_smiling_face:
Regards.

If you want to use official repos, you need to upgrade to Raspbian Bullseye. Search for this on your favourite search machine. Basically it's updating to APT entries in /etc/apt/sources.list and /etc/apt/sources.list.d/raspi.conf, then upgrading all packages. But you may need to update some configs as well, depending on what other software than Pi-hole is installed on your system. This will ship PHP7.4.

PHP8.0 and PHP8.1 are available via Ondrej's PHP repository (who is the official Debian PHP maintainer): https://deb.sury.org/

This is however not ARMv6 compatible, hence doesn't work an RPi 1 and Zero (1) models.

Thanks for your answer. I will have a look on Raspbian Bullseye.

Think I'm headless. So, I far as I understand your comment, I need to upgrade the OS before.

Thank you again. Will update here if needed. :slight_smile:

After a little reading, and as I suspected, the best and cleaner option would be to do a new install of the OS on a different SSD then reinstall Pi-Hole and restore a backup.

Not sure about getting into this as long as Debian Buster is maintained.

Thank you for the help. I will consider it when Buster reaches its EOL. :wink:

Yes, starting over with a fresh image is the cleanest way, a distro upgrade always implies the risk of manual post-fixes, and old/obsolete configs can remain, which may cause subtile unexpected behaviours here and there.

You can use Ondrej's repository for PHP7.4/8.0/8.1 as well on Buster, but I'm not sure if it is so much smaller/less risky than upgrading to Bullseye, given that it pulls not only the PHP packages, but a bunch of other libraries from that repository as dependencies.

1 Like

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.