Andrew Que Sites list Photos
Projects Contact
Main

June 08, 2020

Trying to setting up PHP 5 on Raspberry Pi

Three years ago today.

Three years ago today.

The Sun-Pi has a twin, the Web-Pi, that will be used to do porting from the Sun-Dragon. One of my first tasks is to get a LAMP stack install on the Pi. However as I discovered sometime ago, PHP 7 deprecated all the old PHP functions I seem to use on just about every PHP website I host. Thus I need to run PHP 5 until I can either port or flatten the sites.

I did find a write up of how to run both PHP 5 and PHP 7, but the repositories are not available for ARM so they are of no use. My next option was simply to compile PHP 5 from source. I used to do this for part of the LAMP stack back in the day. I would regularly compile Apache, OpenSSL, and PHP periodically. I never updated the Linux kernel though and usually only ever updated the OS when the hardware changed.

What followed was a couple days of trial and error. Compiling PHP has always taken awhile. One must fetch all the prerequisite packages. The process involves trying to configure PHP, waiting for it to fail, then finding the next missing package, and trying again.

After everything looked correct the first problem I ran into was OpenSSL. Seems that after version 1.1 the API changed enough that PHP 5 would not compile. Since PHP 5 is no longer supported I would not be able to get anything official. My first through was to compile and use the older version of OpenSSL. This did allow PHP to compile, but PHP would segment fault Apache when trying to load. This is because the version of OpenSSL on the system didn’t match the one I compiled against. There may be a way to work around this, however, I don’t think I actually need OpenSSL in PHP and opted to compile PHP without it. That worked and I was able to verify the root site of DrQue.net was functional.

Tomorrow I will detail what it takes to compile PHP 5 on a Raspberry Pi.

Three years ago today

Three years ago today

The Sun-Pi is slated to replace the Sun-Dragon as the web server for DrQue.net. The Sun-Dragon is an Odroid U3 and hasn’t been in production for several years. It is still running Ubuntu 14.04 LTS which, while stable, hasn’t been supported since April of 2019. It is time to migrate.

I selected the Odroid U3 because of its combination of CPU power and low power consumption. At the time it destroyed the Raspberry Pi. While Odroid makes some other great single board computers, I decided to go with a Raspberry Pi 3B. It requires more power than the U3, but I have a new battery pack. In addition, the support for Raspberry Pi is better since none of the Odroid seem to update the distribution after release.

   Although switching the video card out of the Snow-Dragon helped the computer become a little more stable, it still crashing constantly.  Most of the time it crashes without any signs of why—it just freezes.  Today I thought it was about to crash but instead it managed to recover.  I got this message in my logs:

Near-lockup:

[149812.932429] Out of memory: Killed process 28200 (photoqt) total-vm:32465700kB, anon-rss:27386696kB, file-rss:0kB, shmem-rss:0kB
[149813.722757] oom_reaper: reaped process 28200 (photoqt), now anon-rss:0kB, file-rss:0kB, shmem-rss:0kB
[149814.947537] [drm:si_dpm_set_power_state [amdgpu]] *ERROR* si_set_sw_state failed
[149860.592513] [drm:dce_v6_0_encoder_mode_set [amdgpu]] *ERROR* Couldn't read Speaker Allocation Data Block: -2
[149860.592561] [drm:dce_v6_0_encoder_mode_set [amdgpu]] *ERROR* Couldn't read SADs: -2
[149860.645274] [drm:dce_v6_0_encoder_mode_set [amdgpu]] *ERROR* Couldn't read SADs: 0
[149860.921456] [drm:si_dpm_set_power_state [amdgpu]] *ERROR* si_set_sw_state failed
Clearly still an issue with the video card.
   Birthday was rather dull this year.  I wanted to be on my bike in the mountains at Glacier National Park, but it is closed due to the pandemic.  Camp grounds are open, but the weather ruined my chances to do some bike camping.  Coffee shops are closed.  Think I'm just going to take a rain-check for my birthday and try again latter.