RaspISteve
Posts: 189
Joined: Wed Oct 24, 2012 9:15 pm
Location: Cheltenham, UK

Need to Get PHP/Web Server on a Very Early PiB [SOLVED sort-of]

Thu Nov 24, 2022 3:04 pm

Guys,
BACKGROUND:
I have simple little project to explore which involves installing a web server, Lighttpd and PHP support. All installs without issue until I test the PHP install and I get "Illegal instruction". Well that's the old processor I guess.

No problem I thought and found a site outlining installing PHP 7 from source code so I followed that. The first thing is to get the souce code using "wget" Opps! I get "Illegal instruction" again. Seems the current legacy BUSTER image does not fully support the older PiB boards using the older processors which is a pity.

Also on my list of ToDos is to get a Lighttpd/PHP Pi Zero going, because I have a spare one and need low power, and I think I read somewhere that the current Raspberry Distros of PHP aren't runnable on a Zero. This points me again to installing PHP7 from source.

Using my laptop to get the latest PHP8 and I transfer to and untar it on my rapidly approaching Obsolete Status old PiB and proceed with the instuctions from https://www.linuxbabe.com/php/compile- ... ian-jessie

The next show stopper when trying to install the libraries is "E: Unable to locate package libkrb5-devlibc-client2007e". Clearly that is a very unique version but a further searches get me all sorts of variants mostly looking like X86 stuff and complaints. It's also likely that any latest library version for the Pi is going to get me "Illegal instruction" again on my old PiB.

QUESTION(s):
1. Should I simply bin my aging PiB(s) as it seems, like my aging Smart mobile phone, I cannot get current software to run on it?

2. Subject to Question 1. : Can anyone suggest a way forward using this much loved but aging PiB and possibly my Zero with getting PHP running?

3. Perhaps the BIG question: Are the early first itteration Pi's effectively obsolete now?

I do have a number of newer Pi's but they are busy and I was looking to get this old one doing something to earn its keep.

While I accept the enevitablity of obsolescence can I suggest current and future OS Distro's include a processor check so folk like me get a "Don't Even Bother" message on trying a new download on a Pi. Not forgetting that in the future our current Pi's may well suffer the same fate as my PiBs.
Last edited by RaspISteve on Thu Nov 24, 2022 4:21 pm, edited 1 time in total.
Share and Enjoy.

RaspISteve
Posts: 189
Joined: Wed Oct 24, 2012 9:15 pm
Location: Cheltenham, UK

Re: Need to Get PHP/Web Server on a Very Early PiB

Thu Nov 24, 2022 4:18 pm

Guys,
Its just got more interesting ...

Thought I'd do the update/upgrade the my old PiB like you when you run out of things to do waiting for an answer to a question posted here. All good until I came to properly shut the thing down.

Code: Select all

pi@pibbuster:~ $ sudo shutdown -h now
Illegal instruction
and ...

Code: Select all

pi@pibbuster:~ $ poweroff
Illegal instruction
and ...

Code: Select all

pi@pibbuster:~ $ sudo
Illegal instruction
Per usual here I end up answering my own questions.

Seems I missed the memo. The PiB and I guess the PiA are now Obsolete or more precisely have been rendered obsolete by progress. So, more HI-Tech landfill.
Last edited by RaspISteve on Thu Nov 24, 2022 4:23 pm, edited 3 times in total.
Share and Enjoy.

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 31814
Joined: Sat Jul 30, 2011 7:41 pm

Re: Need to Get PHP/Web Server on a Very Early PiB

Thu Nov 24, 2022 4:22 pm

We still sell the Pi1 and more importantly, the Zero which uses the same processor, so I would not expect to see the issues you are seeing on the latest OS release.

Can you try a new SD card with a fresh install, and see if that has any problems?
Principal Software Engineer at Raspberry Pi Ltd.
Working in the Applications Team.

cleverca22
Posts: 6809
Joined: Sat Aug 18, 2012 2:33 pm

Re: Need to Get PHP/Web Server on a Very Early PiB [SOLVED sort-of]

Thu Nov 24, 2022 4:22 pm

the official raspi-os should still support the original pi1, and that error can also be caused by disk corruption

have you tried a fresh install of the OS?

RaspISteve
Posts: 189
Joined: Wed Oct 24, 2012 9:15 pm
Location: Cheltenham, UK

Re: Need to Get PHP/Web Server on a Very Early PiB [SOLVED sort-of]

Thu Nov 24, 2022 4:38 pm

Guys,
It was a fresh download/install of the Legacy BUSTER the other day and was all working yesterday. I have Lighttpd still running and serving web pages as advertised and had transferred my application which generates the HTTP media. My App (C source code) was complied on there so should be for the right CPU. My original problem was I also needed PHP to provide the web interface smarts but hit the stops as outlined above.

While waiting having posted my question I updated it as per my second post and now cannot shut it down like I could last night and earlier today.

To compound my problem it uses the full size SD card and there was a lot of work getting to where I was and, being an old SD card won't go in my other Pi's.

Best I simply re-image the SD card and try it then do an upgrade and try it again but it'll take me time, getting taken out soon.

Watch this space ... Will report back. (could just be me and finger problems)
Share and Enjoy.

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 31814
Joined: Sat Jul 30, 2011 7:41 pm

Re: Need to Get PHP/Web Server on a Very Early PiB [SOLVED sort-of]

Thu Nov 24, 2022 5:28 pm

I suspect the SD card may be failing.....
Principal Software Engineer at Raspberry Pi Ltd.
Working in the Applications Team.

RaspISteve
Posts: 189
Joined: Wed Oct 24, 2012 9:15 pm
Location: Cheltenham, UK

Re: Need to Get PHP/Web Server on a Very Early PiB [SOLVED sort-of]

Thu Nov 24, 2022 5:45 pm

Guys,
Just re-imaged my SD card and its all working as advertised. Note I am SSH into my PiB.

What I did:
Booted new download of legacy BUSTER image
Used "sudo shutdown -h now" and it shut down
Power cycled ...
Ran "sudo apt update/upgrade" ...
Used "sudo reboot"
When it all came up again
Used "sudo shutdown -h now" .... AND IT WORKED !!!

Even "wget" now works!

The only thing that may have happened was when I was attempting to install PHP from source and loaded the suggested libraries it might have poisoned my system. I might give this a go later but clearly something to watch.

What I do get and I've had this with other legacy BUSTER images the command line previous commands list don't survive a reboot which it a total PAIN! Last time I hit this I just beamed in a new PI profile and it sorted it out.

Its essential for me at least to have comand history voer a reboot cycle.
Share and Enjoy.

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

Re: Need to Get PHP/Web Server on a Very Early PiB [SOLVED sort-of]

Thu Nov 24, 2022 6:18 pm

RaspISteve wrote:
Thu Nov 24, 2022 5:45 pm
The only thing that may have happened was when I was attempting to install PHP from source and loaded the suggested libraries it might have poisoned my system. I might give this a go later but clearly something to watch.
If it suggested you download armhf .deb files from Debian or many other places, then that would do it. Only packages from raspbian.raspberrypi.org or archive.raspberrypi.org will work on a Pi 1 or Zero - unless they specifically say so.

Most armhf packages are built for ARMv7 CPU. The Pi 1 and Zero have an ARMv6 CPU.

[eta]
Skimming through those instructions I can't see anything that would break on a PI 1. Also, installing php and lighttpd using apt should have worked in the first place.
What I do get and I've had this with other legacy BUSTER images the command line previous commands list don't survive a reboot which it a total PAIN! Last time I hit this I just beamed in a new PI profile and it sorted it out.

Its essential for me at least to have comand history voer a reboot cycle.
Are you saying that the contents of history get reset at boot? That sounds like a failed card. A simple test. Create a file in your home directory. Any name you like and the contents don't matter. Reboot. Is the file still there?
Unreadable squiggle

RaspISteve
Posts: 189
Joined: Wed Oct 24, 2012 9:15 pm
Location: Cheltenham, UK

Re: Need to Get PHP/Web Server on a Very Early PiB [SOLVED sort-of]

Thu Nov 24, 2022 8:31 pm

UPDATE: Found it ...
Following on from above I used a script, as before, that installs both Lighttpd and php8.1 (using apt install ..) and sets up a load of "/var/www/html/<directories>" directories for my application to function. All good.

I used "sudo reboot" and when it all came back up followed the "update/upgrade" process.

Seems, and maybe not previously noticed, the "upgrade" this time failes at:

Code: Select all

(Reading database ... 99195 files and directories currently installed.)
Preparing to unpack .../libpcre3_2%3a8.44-2+0~20210301.9+debian10~1.gbpa278ad_armhf.deb ...
Unpacking libpcre3:armhf (2:8.44-2+0~20210301.9+debian10~1.gbpa278ad) over (2:8.39-12) ...
Illegal instruction
E: Sub-process /usr/bin/dpkg exited unexpectedly
When I then tried "wget" I got :

Code: Select all

pi@pibbuster:~ $ wget
Illegal instruction
pi@pibbuster:~ $ sudo
Illegal instruction
and ...

Code: Select all

pi@pibbuster:~ $ sudo shutdown -h now
Illegal instruction
So, all good until I loaded Lighttpd and php8.1, rebooted and then complete the "update/upgrade" again which seems to have dragged in something that's stuffed it all.

Now, If I understand it "IofT" is the way we should be going and an old PiB and more usefully the Pi Zero (which from above uses the same processor) are the weapons for choice for something small and low powered. Seems Lighttpd runs happily on my PiB but to be of any real use it needs PHP to do all the smart real time clever interactive things.

Loading the lastest "php8.1" will stuff a PiB and I guess a Pi Zero. Damn! I hope someone out there can close this gap and soon please.
Q.E.D.
Share and Enjoy.

pidd
Posts: 4153
Joined: Fri May 29, 2020 8:29 pm
Location: Wirral, UK

Re: Need to Get PHP/Web Server on a Very Early PiB [SOLVED sort-of]

Thu Nov 24, 2022 8:42 pm

Why not just use the standard raspberry repos for lighttpd and php? Or have they gone from RPiOS-legacy?

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

Re: Need to Get PHP/Web Server on a Very Early PiB [SOLVED sort-of]

Thu Nov 24, 2022 8:48 pm

RaspISteve wrote:
Thu Nov 24, 2022 8:31 pm
UPDATE: Found it ...
Following on from above I used a script, as before, that installs both Lighttpd and php8.1 (using apt install ..) and sets up a load of "/var/www/html/<directories>" directories for my application to function. All good.

I used "sudo reboot" and when it all came back up followed the "update/upgrade" process.

Seems, and maybe not previously noticed, the "upgrade" this time failes at:
Whatever went wrong happened before this point. Some program or library that the unpack routine is using is bad by this point.

Have you changed your sources.list files? That version of libpcre3 is newer that the version in Bullseye and you say you are running Buster?
Unreadable squiggle

RaspISteve
Posts: 189
Joined: Wed Oct 24, 2012 9:15 pm
Location: Cheltenham, UK

Re: Need to Get PHP/Web Server on a Very Early PiB [SOLVED sort-of]

Thu Nov 24, 2022 8:51 pm

Also, ...
I was using SSH to setup my PiB and having completed above I "exit" back to my laptop.

While accessing my target PiB with my browser I'm guessing something is there but as I haven't yet set up a default web page I get a "403 Forbidden" , I cannot now SSH into the PiB. Its stuffed.
Share and Enjoy.

RaspISteve
Posts: 189
Joined: Wed Oct 24, 2012 9:15 pm
Location: Cheltenham, UK

Re: Need to Get PHP/Web Server on a Very Early PiB [SOLVED sort-of]

Thu Nov 24, 2022 9:03 pm

pidd wrote:
Thu Nov 24, 2022 8:42 pm
Why not just use the standard raspberry repos for lighttpd and php? Or have they gone from RPiOS-legacy?
I'm not clever enough to use anything other than the usual updating tools. Was certainly not aware of or indeed how to envoke legacy libraries. Who does?
rpdom wrote:
Thu Nov 24, 2022 8:48 pm
RaspISteve wrote:
Thu Nov 24, 2022 8:31 pm
UPDATE: Found it ...
<snip> ...
Have you changed your sources.list files? That version of libpcre3 is newer that the version in Bullseye and you say you are running Buster?
Note and for a lot of reasons I'm using the legacy BUSTER down. My application still uses WiringPi and I've not yet got around to the new way of doing stuff.

This is my script (below), I've removed the mkdir/chmods for clarity:

Code: Select all

#!/bin/bash
echo "From https://pimylifeup.com/raspberry-pi-latest-php/"
echo "sudo apt-get remove apache2"
sudo apt remove apache2

echo "Installing stuff necessay for PHP8.1"
sudo apt install lsb-release
curl https://packages.sury.org/php/apt.gpg | sudo tee /usr/share/keyrings/suryphp-archive-keyring.gpg >/dev/null
echo "deb [signed-by=/usr/share/keyrings/suryphp-archive-keyring.gpg] https://packages.sury.org/php/ $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.>
sudo apt update

echo "sudo apt install lighttpd"
sudo apt install lighttpd

echo "Installing PHP8.1"
sudo apt install php8.1-cli

echo "End."
Share and Enjoy.

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

Re: Need to Get PHP/Web Server on a Very Early PiB [SOLVED sort-of]

Thu Nov 24, 2022 9:24 pm

RaspISteve wrote:
Thu Nov 24, 2022 9:03 pm
pidd wrote:
Thu Nov 24, 2022 8:42 pm
Why not just use the standard raspberry repos for lighttpd and php? Or have they gone from RPiOS-legacy?
I'm not clever enough to use anything other than the usual updating tools. Was certainly not aware of or indeed how to envoke legacy libraries. Who does?
rpdom wrote:
Thu Nov 24, 2022 8:48 pm
RaspISteve wrote:
Thu Nov 24, 2022 8:31 pm
UPDATE: Found it ...
<snip> ...
Have you changed your sources.list files? That version of libpcre3 is newer that the version in Bullseye and you say you are running Buster?
Note and for a lot of reasons I'm using the legacy BUSTER down. My application still uses WiringPi and I've not yet got around to the new way of doing stuff.

This is my script (below), I've removed the mkdir/chmods for clarity:

Code: Select all

#!/bin/bash
echo "From https://pimylifeup.com/raspberry-pi-latest-php/"
echo "sudo apt-get remove apache2"
sudo apt remove apache2

echo "Installing stuff necessay for PHP8.1"
sudo apt install lsb-release
curl https://packages.sury.org/php/apt.gpg | sudo tee /usr/share/keyrings/suryphp-archive-keyring.gpg >/dev/null
echo "deb [signed-by=/usr/share/keyrings/suryphp-archive-keyring.gpg] https://packages.sury.org/php/ $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.>
sudo apt update

echo "sudo apt install lighttpd"
sudo apt install lighttpd

echo "Installing PHP8.1"
sudo apt install php8.1-cli

echo "End."
Ok, yes. That will break your Pi 1.
Unreadable squiggle

RaspISteve
Posts: 189
Joined: Wed Oct 24, 2012 9:15 pm
Location: Cheltenham, UK

Re: Need to Get PHP/Web Server on a Very Early PiB [SOLVED sort-of]

Thu Nov 24, 2022 10:41 pm

rpdom wrote:
Thu Nov 24, 2022 9:24 pm
<snipped all my stuff for clarity>
Ok, yes. That will break your Pi 1.
Yep I now know that what I installed broke my PiB but exactly how? Is there no check made?

If I simply forget that at the far end of my SSH wire there's an old PiB or perhaps a Pi Zero and I type in "sudo apt install php8.1" it all seems to work on the face of it but destroys the guts of the thing. I would certainly like to have php8.1 going on a Pi Zero which gets me back to the original post of "Need to Get PHP/Web Server on a Very Early PiB ".

How would I know not to do this?
Share and Enjoy.

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

Re: Need to Get PHP/Web Server on a Very Early PiB [SOLVED sort-of]

Thu Nov 24, 2022 11:28 pm

RaspISteve wrote:
Thu Nov 24, 2022 10:41 pm
Yep I now know that what I installed broke my PiB but exactly how? Is there no check made?
If you stick to the supplied repos everything will just work. Ok, so they don't have PHP 8 yet*, but 7.4 is good enough for most people.

There are checks for correct architecture. It's just that the Raspbian repository extends armhf to include the specific ARMv6 CPU that the original Pi uses. It was either that or use armel which didn't support hardware floating point and was considerably slower.

*PHP 8.1 will be in the Bookworm release, which will replace Bullseye at some point.
Unreadable squiggle

Return to “Advanced users”