Upgrading my server to PHP7 broke wordpress admin interface (cloudflare)

wp-cli, a command line interface for WordPress, just saved me a big headache.

It all began when I updated my server to the latest ubuntu LTS. That removed PHP5 support and replaced it with PHP7. That meant several of my sites stopped working as the nginx configuration had to change. With that done I thought the blog as the pages were still displaying OK but for some reason I could no longer access the admin interface to make new posts or moderate comments. Instead, when I logged in I would see a message: Sorry, you are not allowed to access this page

I decided the most likely cause of this would be a plugin. However, I couldn’t use the admin interface to disable all the plugins so I needed to find another way. I read that I could start editing the database directly but then I stumbled upon wp-cli. Installing that allowed me to use an SSH shell to check, disable, enable and update the plugins. I quickly discovered that there was an update to cloudflare that hadn’t been applied. I applied it and it failed. I’m not entirely sure if it failed due to the background change of PHP5 to PHP7, or if my earlier fault finding had changed a file owner (I tried removing the plugins by moving the directory to a new name), but once I used wp-cli to update cloudflare everything started working perfectly, including the ability to preview theme changes which had stopped working a long time ago.

If I didn’t find wp-cli I would have been checking my backups, creating a test server in my office to install and test backups and assuming they worked removing and reinstalling wordpress.

Hot topic – our backup server (overheating!)

Ahh, computer backups. I’ve said before and learn’t first hand how important they are over the years.

My business backup routine is to copy the files from the server in another building. I used to have a ReadyNAS NV+ (image on wikipedia) and for many years it served us well. Actually, 8 years, which is long enough for any piece of hardware you rely on. Last Christmas (yeah… 6 months working on this between other tasks) I spent some time reading up on hardware and software solutions to replace our ReadyNAS. I did consider getting the latest ReadyNAS or equivalent but in the end decided to build my own solution. An excellent blog post by Brian Moses about FreeNAS set me on the right track and pretty much I followed the suggestions there along with reading the FreeNAS forums. Brian chose the the Silverstone DS380 case and so did I. I was really tempted by the 8 hot swap trays.

I’ll not repeat all the logic of Brian’s post but the one thing that didn’t work for me was the case. The airflow was so poor the disks were overheating. Reading forum posts, it seems the biggest difference between users is how many disks people were using. 4 disks 5 disks with space between each one and things are fine. Using all 8 slots for disks and they all get a touch on the hot side.

2pm Wed 11th May – with Stock Fan

Using the fans that came with the case, all 8 bays populated with disks, and an additional piece of cardboard to help guide the flowing air over the disks (which did help a little) these were the temperatures:

(nb: I wasn’t worried about the CPU temperatures, but I’ll share them anyway)

CPU 0: 47 C
CPU 1: 48 C
CPU 2: 48 C
CPU 3: 50 C
CPU 4: 49 C
CPU 5: 49 C
CPU 6: 48 C
CPU 7: 48 C

ada0 WD-WMC300111734: 37 C
ada1 WD-WMC300109616: 35 C
ada2 WD-WCC4N3KK2FF4: 43 C
ada3 W6A0JJ85 : 42 C
ada4 PK2234P9J6RM5Y : 45 C
ada5 WD-WCC4N4VA3V61: 40 C
ada6 W6A0FZ8V : 36 C
ada7 PK2234P9J95JKY : 43 C

Monday 17th May 17:30 – with PWM Fan

The stock fans were 3 pin but the motherboard supported 4 pin ‘PWM’ fans. This allows it to control the fan speed so if the system heats up it will speed up the fans. I thought maybe all I need to do is change the fans.

CPU 0: 51 C
CPU 1: 51 C
CPU 2: 52 C
CPU 3: 52 C
CPU 4: 51 C
CPU 5: 50 C
CPU 6: 53 C
CPU 7: 53 C

ada0 WD-WMC300111734: 41 C
ada1 WD-WMC300109616: 39 C
ada2 WD-WCC4N3KK2FF4: 47 C
ada3 W6A0JJ85 : 48 C
ada4 PK2234P9J6RM5Y : 52 C
ada5 WD-WCC4N4VA3V61: 44 C
ada6 W6A0FZ8V : 40 C
ada7 PK2234P9J95JKY : 46 C

So, £50 of fans later (I didn’t scrimp) and…. oh, it’s hotter. I guess the orignal fans were always running at full speed.

Wed 1st June, in the Fractal case – with fans that Fractal included.

I settled for buying a new case, a “Fractal Design ARC Midi R2 Black Mid Tower Quiet Performance Case with Side Window USB 3.0 w/o PSU”. The window wasn’t important but that’s what the supplier had in stock. It’s a much bigger case and reading reviews and looking at pictures cooling seemed better and there’s more air gap between each drive. The one thing I’ve given up by choosing this case is having a hot-swap facility for the drives. In truth, I’ve only ever swapped hard drives out about once a year or less so I decided I really don’t need hot swap.

So, what difference did it make?

CPU 0: 30 C
CPU 1: 31 C
CPU 2: 31 C
CPU 3: 31 C
CPU 4: 32 C
CPU 5: 31 C
CPU 6: 32 C
CPU 7: 31 C

ada0 WD-WMC300111734: 28 C
ada1 WD-WMC300109616: 28 C
ada2 WD-WCC4N3KK2FF4: 26 C
ada3 W6A0JJ85 : 26 C
ada4 PK2234P9J6RM5Y : 31 C
ada5 WD-WCC4N4VA3V61: 25 C
ada6 W6A0FZ8V : 27 C
ada7 PK2234P9J95JKY : 30 C

It made a lot of difference!

Royalty free music and a time lapse video for work

Here’s a great way to start 2016, Win an award for “Best Domestic Bathroom Installer 2015“.
My brother David entered the Geberit Awards, Geberit being a large multinational manufacturer of bathroom products and out of all the entries from all of the UK, he won. We’re very proud 🙂

That prompted us to finish editing a timelapse video of the winning bathroom. Rather than a silent movie sound I went searching for suitable music to accompany the movie and found the track “Pamgaea” by Kevin McCleod. Best of all, the licence to use this sound track was ‘Royalty Free‘ as well as being free of cost on condition it was clearly attributed to the author. That’s very much like the software code I’ve written and shared, although Kevin is a master of his craft, whereas I’m just an amateur coding for fun.

As well as free when attributed, the music can also be licensed for a fee when an attribution is not possible or wanted. Example: Background music when you’re on hold. In my mind I always thought licensing that type of music was expensive, turns out to be a lot less than I expected.