User avatar
steinmb
Posts: 4
Joined: Tue Jan 12, 2021 10:07 am
Contact: Twitter

How do I upgrade Buster to PHP 8.0 on a ARMv6 Raspberry Pi arch

Tue Jan 12, 2021 10:54 am

Hi
From what I can see on my raspberry pi and by looking at https://packages.debian.org/stable/php/php is latest stable version of PHP 7.3.x - It is getting rather old. My initial idea was to move to version 7.4 though while pondering version 8.0 got released and that is even better for me.

How do I safely do this? I tested this on one my other Raspberry Pi that I had laying around but that broke the entire installation. It then failed booting and I had to re-create the SD card. Tested that two times just be sure. I think I was caused by libc6 version changes due to dependencies. Suggestions like https://janw.me/2019/installing-php7-4-rapsberry-pi/ is not right.

Buster latest version from raspbery.pi org.

Code: Select all

cat /etc/apt/sources.list
deb http://raspbian.raspberrypi.org/raspbian/ buster main contrib non-free rpi
Hardware platform

Code: Select all

dpkg --print-architecture
armhf

cat /proc/cpuinfo

model name	: ARMv6-compatible processor rev 7 (v6l)
Features	: half thumb fastmult vfp edsp java tls
CPU implementer	: 0x41
CPU architecture: 7
CPU variant	: 0x0
CPU part	: 0xb76
CPU revision	: 7

Hardware	: BCM2835
Revision	: 000e
Model		: Raspberry Pi Model B Rev 2
libc6 information

Code: Select all

dpkg -l libc6
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name           Version      Architecture Description
+++-==============-============-============-=================================
ii  libc6:armhf    2.28-10+rpi1 armhf        GNU C Library: Shared libraries

Danrancan
Posts: 41
Joined: Wed Jan 15, 2020 4:28 am
Location: Milwaukee, WI, USA
Contact: Website Twitter

Re: How do I upgrade Buster to PHP 8.0 on a ARMv6 Raspberry Pi arch

Sat Feb 27, 2021 9:40 pm

I'm wondering the same thing. Have you figured out how to upgrade to php7.4 or 8.0 on raspberry pi os yet?
Nerd-Tech - Exploring Technology, Computers, and Techno…
https://github.com/danrancan
dan@nerd-tech.net
https://nerd-tech.net
https://keybase.io/danran/
My Keybase Invite https://keybase.io/inv/5a35010417/

RonR
Posts: 2065
Joined: Tue Apr 12, 2016 10:29 pm
Location: US

Re: How do I upgrade Buster to PHP 8.0 on a ARMv6 Raspberry Pi arch

Sun Feb 28, 2021 7:11 am

Danrancan wrote:
Sat Feb 27, 2021 9:40 pm
Have you figured out how to upgrade to php7.4 or 8.0 on raspberry pi os yet?

php7.4 and php8.0 are available from sury.org. Simply add sury.org to your apt sources:

Code: Select all

wget -q https://packages.sury.org/php/apt.gpg -O- | apt-key add -
echo "deb https://packages.sury.org/php/ buster main" > /etc/apt/sources.list.d/php.list

On Raspberry Pi OS (64-bit):

Code: Select all

root@raspberrypi:~# apt update
...
root@raspberrypi:~# apt install php8.0
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
  libapache2-mod-php8.0 libsodium23 php8.0-cli php8.0-common php8.0-opcache php8.0-readline
The following NEW packages will be installed:
  libapache2-mod-php8.0 libsodium23 php8.0 php8.0-cli php8.0-common php8.0-opcache php8.0-readline
0 upgraded, 7 newly installed, 0 to remove and 0 not upgraded.
Need to get 3,597 kB of archives.
After this operation, 18.8 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 https://packages.sury.org/php buster/main arm64 php8.0-common arm64 8.0.2-7+0~20210227.16+debian10~1.gbp7931ce [630 kB]
Get:2 https://packages.sury.org/php buster/main arm64 php8.0-opcache arm64 8.0.2-7+0~20210227.16+debian10~1.gbp7931ce [187 kB]
Get:3 https://packages.sury.org/php buster/main arm64 php8.0-readline arm64 8.0.2-7+0~20210227.16+debian10~1.gbp7931ce [11.8 kB]
Get:4 https://packages.sury.org/php buster/main arm64 libsodium23 arm64 1.0.18-1+0~20191009.1+debian10~1.gbpb6823f [119 kB]
Get:5 https://packages.sury.org/php buster/main arm64 php8.0-cli arm64 8.0.2-7+0~20210227.16+debian10~1.gbp7931ce [1,342 kB]
Get:6 https://packages.sury.org/php buster/main arm64 libapache2-mod-php8.0 arm64 8.0.2-7+0~20210227.16+debian10~1.gbp7931ce [1,285 kB]
Get:7 https://packages.sury.org/php buster/main arm64 php8.0 all 8.0.2-7+0~20210227.16+debian10~1.gbp7931ce [23.7 kB]
...
root@raspberrypi:~# php --version
PHP 8.0.2 (cli) (built: Feb 27 2021 15:52:21) ( NTS )
Copyright (c) The PHP Group
Zend Engine v4.0.2, Copyright (c) Zend Technologies
    with Zend OPcache v8.0.2, Copyright (c), by Zend Technologies

fruitoftheloom
Posts: 26470
Joined: Tue Mar 25, 2014 12:40 pm
Location: Delightful Dorset

Re: How do I upgrade Buster to PHP 8.0 on a ARMv6 Raspberry Pi arch

Sun Feb 28, 2021 7:23 am

RonR wrote:
Sun Feb 28, 2021 7:11 am
Danrancan wrote:
Sat Feb 27, 2021 9:40 pm
Have you figured out how to upgrade to php7.4 or 8.0 on raspberry pi os yet?

php7.4 and php8.0 are available from sury.org. Simply add sury.org to your apt sources:

Code: Select all

wget -q https://packages.sury.org/php/apt.gpg -O- | apt-key add -
echo "deb https://packages.sury.org/php/ buster main" > /etc/apt/sources.list.d/php.list

On Raspberry Pi OS (64-bit):

Code: Select all

root@raspberrypi:~# apt update
...
root@raspberrypi:~# apt install php8.0
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
  libapache2-mod-php8.0 libsodium23 php8.0-cli php8.0-common php8.0-opcache php8.0-readline
The following NEW packages will be installed:
  libapache2-mod-php8.0 libsodium23 php8.0 php8.0-cli php8.0-common php8.0-opcache php8.0-readline
0 upgraded, 7 newly installed, 0 to remove and 0 not upgraded.
Need to get 3,597 kB of archives.
After this operation, 18.8 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 https://packages.sury.org/php buster/main arm64 php8.0-common arm64 8.0.2-7+0~20210227.16+debian10~1.gbp7931ce [630 kB]
Get:2 https://packages.sury.org/php buster/main arm64 php8.0-opcache arm64 8.0.2-7+0~20210227.16+debian10~1.gbp7931ce [187 kB]
Get:3 https://packages.sury.org/php buster/main arm64 php8.0-readline arm64 8.0.2-7+0~20210227.16+debian10~1.gbp7931ce [11.8 kB]
Get:4 https://packages.sury.org/php buster/main arm64 libsodium23 arm64 1.0.18-1+0~20191009.1+debian10~1.gbpb6823f [119 kB]
Get:5 https://packages.sury.org/php buster/main arm64 php8.0-cli arm64 8.0.2-7+0~20210227.16+debian10~1.gbp7931ce [1,342 kB]
Get:6 https://packages.sury.org/php buster/main arm64 libapache2-mod-php8.0 arm64 8.0.2-7+0~20210227.16+debian10~1.gbp7931ce [1,285 kB]
Get:7 https://packages.sury.org/php buster/main arm64 php8.0 all 8.0.2-7+0~20210227.16+debian10~1.gbp7931ce [23.7 kB]
...
root@raspberrypi:~# php --version
PHP 8.0.2 (cli) (built: Feb 27 2021 15:52:21) ( NTS )
Copyright (c) The PHP Group
Zend Engine v4.0.2, Copyright (c) Zend Technologies
    with Zend OPcache v8.0.2, Copyright (c), by Zend Technologies

The OP has an ARMv6 BCM2835 Raspberry Pi, therefore are sury.org packages compatible ?
The information is out there....you just have to let it in.

My other Linux machines: ChromeBox
https://www.aliexpress.com/item/32966393971.html
& Stone Desktop Intel CoreDuo circa 2010

RonR
Posts: 2065
Joined: Tue Apr 12, 2016 10:29 pm
Location: US

Re: How do I upgrade Buster to PHP 8.0 on a ARMv6 Raspberry Pi arch

Sun Feb 28, 2021 7:31 am

fruitoftheloom wrote:
Sun Feb 28, 2021 7:23 am
The OP has an ARMv6 BCM2835 Raspberry Pi, therefore are sury.org packages compatible ?

Go have a look.

fruitoftheloom
Posts: 26470
Joined: Tue Mar 25, 2014 12:40 pm
Location: Delightful Dorset

Re: How do I upgrade Buster to PHP 8.0 on a ARMv6 Raspberry Pi arch

Sun Feb 28, 2021 7:37 am

RonR wrote:
Sun Feb 28, 2021 7:31 am
fruitoftheloom wrote:
Sun Feb 28, 2021 7:23 am
The OP has an ARMv6 BCM2835 Raspberry Pi, therefore are sury.org packages compatible ?

Go have a look.

I do not have a BCM2835 Raspberry Pi and on the web site it does not state ARMv6 supported or not supported.
The information is out there....you just have to let it in.

My other Linux machines: ChromeBox
https://www.aliexpress.com/item/32966393971.html
& Stone Desktop Intel CoreDuo circa 2010

RonR
Posts: 2065
Joined: Tue Apr 12, 2016 10:29 pm
Location: US

Re: How do I upgrade Buster to PHP 8.0 on a ARMv6 Raspberry Pi arch

Sun Feb 28, 2021 8:00 am

fruitoftheloom wrote:
Sun Feb 28, 2021 7:37 am
I do not have a BCM2835 Raspberry Pi and on the web site it does not state ARMv6 supported or not supported.

It's pretty obvious:

Code: Select all

Index of /php/dists/buster/main/

../
binary-amd64/                                      27-Feb-2021 17:12                   -
binary-arm64/                                      28-Feb-2021 02:48                   -
binary-armhf/                                      28-Feb-2021 04:16                   -
binary-i386/                                       27-Feb-2021 18:09                   -
debian-installer/                                  14-Nov-2018 17:49                   -
source/                                            27-Feb-2021 17:12                   -

User avatar
rpdom
Posts: 18502
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: How do I upgrade Buster to PHP 8.0 on a ARMv6 Raspberry Pi arch

Sun Feb 28, 2021 8:03 am

It's not obvious at all.

Debian armhf is for ARMv7 and above only. It is not compatible with ARMv6. Only Raspbian armhf and other software that has been compiled specially to run on the Raspberry Pi 0 and 1 can run on ARMv6.

The general rule is "If it doesn't state ARMv6/BCM2835 compatibility - don't use it."
Unreadable squiggle

fruitoftheloom
Posts: 26470
Joined: Tue Mar 25, 2014 12:40 pm
Location: Delightful Dorset

Re: How do I upgrade Buster to PHP 8.0 on a ARMv6 Raspberry Pi arch

Sun Feb 28, 2021 8:13 am

RonR wrote:
Sun Feb 28, 2021 8:00 am
fruitoftheloom wrote:
Sun Feb 28, 2021 7:37 am
I do not have a BCM2835 Raspberry Pi and on the web site it does not state ARMv6 supported or not supported.

It's pretty obvious:

Code: Select all

Index of /php/dists/buster/main/

../
binary-amd64/                                      27-Feb-2021 17:12                   -
binary-arm64/                                      28-Feb-2021 02:48                   -
binary-armhf/                                      28-Feb-2021 04:16                   -
binary-i386/                                       27-Feb-2021 18:09                   -
debian-installer/                                  14-Nov-2018 17:49                   -
source/                                            27-Feb-2021 17:12                   -


No not helpful whatsoever, nothing relating to ARMv6:

https://www.debian.org/ports/#:~:text=T ... 20a%20port.
The information is out there....you just have to let it in.

My other Linux machines: ChromeBox
https://www.aliexpress.com/item/32966393971.html
& Stone Desktop Intel CoreDuo circa 2010

plugwash
Forum Moderator
Forum Moderator
Posts: 3747
Joined: Wed Dec 28, 2011 11:45 pm

Re: How do I upgrade Buster to PHP 8.0 on a ARMv6 Raspberry Pi arch

Thu Mar 04, 2021 8:14 pm

You should be able to download the source packages and rebuild them on raspbian.

User avatar
steinmb
Posts: 4
Joined: Tue Jan 12, 2021 10:07 am
Contact: Twitter

Re: How do I upgrade Buster to PHP 8.0 on a ARMv6 Raspberry Pi arch

Wed Apr 14, 2021 8:29 am

plugwash wrote:
Thu Mar 04, 2021 8:14 pm
You should be able to download the source packages and rebuild them on raspbian.
Do we have to rebuild it on a ARMv6 RPI or is a virtual machine normally used for this? I tried directly on the RPI during compilation I kept running out of memory and I gave up.

User avatar
steinmb
Posts: 4
Joined: Tue Jan 12, 2021 10:07 am
Contact: Twitter

Re: How do I upgrade Buster to PHP 8.0 on a ARMv6 Raspberry Pi arch

Wed Apr 14, 2021 9:11 am

Perhaps one way could be moving away from RPI OS - https://archlinuxarm.org/packages seem to have modern PHP versions though I have not yet tested arch on ARM machines.

fruitoftheloom
Posts: 26470
Joined: Tue Mar 25, 2014 12:40 pm
Location: Delightful Dorset

Re: How do I upgrade Buster to PHP 8.0 on a ARMv6 Raspberry Pi arch

Wed Apr 14, 2021 9:33 am

steinmb wrote:
Wed Apr 14, 2021 9:11 am
Perhaps one way could be moving away from RPI OS - https://archlinuxarm.org/packages seem to have modern PHP versions though I have not yet tested arch on ARM machines.

ArchLinuxArm is command line only though a rolling release so always has latest and greatest packages so *maybe* not as stable as Debian based OSes,:

https://archlinuxarm.org/packages/armv6h/php

https://archlinuxarm.org/platforms/armv6/raspberry-pi
The information is out there....you just have to let it in.

My other Linux machines: ChromeBox
https://www.aliexpress.com/item/32966393971.html
& Stone Desktop Intel CoreDuo circa 2010

plugwash
Forum Moderator
Forum Moderator
Posts: 3747
Joined: Wed Dec 28, 2011 11:45 pm

Re: How do I upgrade Buster to PHP 8.0 on a ARMv6 Raspberry Pi arch

Wed Apr 14, 2021 4:51 pm

steinmb wrote:
Wed Apr 14, 2021 8:29 am
plugwash wrote:
Thu Mar 04, 2021 8:14 pm
You should be able to download the source packages and rebuild them on raspbian.
Do we have to rebuild it on a ARMv6 RPI or is a virtual machine normally used for this?
As long as you build it in a raspbian environment you should be ok, even if the hardware is a newer version of arm (or even an x86 box with user mode qemu).

Return to “Raspberry Pi OS”