Add PHP via sury apt

Install PHP as per Add apt signing keys to debian, the right way.

PHP is not kept up to date on distros but it can be done by using the "Sury" repo.

NB: If running Devuan, you're going to need to install a work-around package to get rid of the need for a full systemd install due to the dependency added by the sury site author to need the systemd-tmpfiles package which is used to delete temporary files. Really.

apt-get install systemd-standalone-tmpfiles

Grab the sury key:

wget -qO - https://packages.sury.org/php/apt.gpg |\
  gpg --dearmor |\
  sudo dd of=/usr/share/keyrings/sury-php.gpg

Normally the release name would be via lsb_release -sc but in the case where you're using something Devuan, this will be wrong. eg Chimaera instead of Bullseye.

echo "deb [signed-by=/usr/share/keyrings/sury-php.gpg] https://packages.sury.org/php/ $(lsb_release -sc) main" |\
  sudo tee /etc/apt/sources.list.d/sury-php.list

echo "deb [signed-by=/usr/share/keyrings/sury-php.gpg] https://packages.sury.org/php/ bullseye main" |\
  sudo tee /etc/apt/sources.list.d/sury-php.list

Actually, that probably won't work since sury's PHP requires systemd. You'll need systemd-dummy which I created ages ago, but now can't find it.

https://dev1galaxy.org/viewtopic.php?id=3331

The alternative to that is to use