Debian 12 Bookworm - Install PHP 7.4

Debian Bookworm ships PHP version 8.2. Unfortunately there is still software which requires PHP 7.4. One prominent example would be Owncloud.

If you need to install PHP 7.4 on Debian 12 there is a pretty easy way to do so. Use the official package maintainers repository for PHP. Using the repository of him directly allows you to install several versions of PHP as described here.

With the FPM integration you can differentiate on e.g. per VirtualHost or Directory level which version of PHP to use for the application.

# install sury repository
curl -sSL | bash -x
apt update

# run upgrade; if already installed this will upgrade the default PHP 8.2 packages
apt upgrade

# show available PHP 7.4 packages
apt-cache search php7.4

# install PHP 7.4 fpm or apache2 mod as needed
# apt install php7.4-fpm
# apt install libapache2-mod-php7.4

Schreibe einen Kommentar