I have two Raspberry Pi's:
- a Raspberry Pi 2 with Raspbian GNU/Linux 8 (jessie)
- a Raspberry Pi 4 with Raspbian GNU/Linux 10 (buster).
I was able to get multiple versions of PHP running on the Raspberry Pi 4 by adding deb http://ppa.launchpad.net/ondrej/php/ubuntu bionic main
to /etc/apt/sources.list.d/ondrej-ubuntu-php.list
and then by doing apt-get update
.
Trying the same thing on the Raspberry Pi 2 is proving fruitless. So first, I'm not doing bionic - I'm doing trusty, per the table at https://askubuntu.com/a/445496/180177. eg. I did deb http://ppa.launchpad.net/ondrej/php/ubuntu trusty main
to /etc/apt/sources.list.d/ondrej-ubuntu-php.list
and then by doing apt-get update
. I also had to do https://superuser.com/a/1674197/172193 to get apt-get update
to work. But then, when I do sudo apt-get install php5.6 -y
I get this error:
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package php5.6
E: Couldn't find any package by regex 'php5.6'
Now, one might wonder
- Why don't I update the OS?
- Why am I not trying to install a newer version of PHP?
That'd be because I'm trying to scope out a bug that I'm only able to reproduce on the Raspberry Pi 2. Right now the Raspberry Pi 2 has PHP 7.2.0, which was released on 30 Nov 2017, which reproduces the issue. However, on the Raspberry Pi 4, not even PHP 5.6.40, released on 10 Jan 2019, reproduces the issue.
If I could get PHP 5.6.40 running on the Raspberry Pi 2 I could see if the issue is still present. If it is that would suggest that the issue is with the Raspberry Pi 2, itself. Or maybe with one of the dependencies that PHP uses. But it wouldn't necessarily be an issue with PHP itself. Alternatively, if it isn't an issue, then that would suggest that the issue was fixed for all PHP versions between Nov 2017 and Jan 2019. I'm not seeing anything about such a change in the changelogs but that assumes that all changes are in the changelogs.
I suppose I could compile a new version of PHP on the Raspberry Pi 2 but I'm a little worried that if I do that I might overwrite my PHP 7.2.0 install (the only install I've been able to reproduce this issue on).