I’ve recently updated my Nextcloud jail to 15.0 and noticed one of the Apps wanted a newer version of PHP. It was running PHP 7.1.17 (which isn’t really that out of date) but I thought it might be time for some PHP updates across a number of jails…
PHP is one of those web tools that’s used for lots of things (I’m sure I read somewhere that over 70% of websites are using it in some way, shape or form) but other than setting up and some basic configuration for specific services, I know very little about. Quite like a lot of things really!
Anyway, when I rebuilt my jails using iocage here the latest stable and workable version of PHP was 7.1. 7.2 had been released, but there were some known issues with Nextcloud, so I decided to stick with something more tried and tested for everything.
7.1 is still supported from a security perspective, although I would need to update it before the end of the year anyway, and I had a little time to try updating.
This timeline from the PHP website probably explains things better than I can!
Given how new 7.3 is (7.3.0) I thought 7.2 (7.2.13) was a better option. It was actually a fairly painless process, that went something like this:
- Snapshot the jails, database and files datasets (just to be on the safe side and
allow me to roll-back if anything went wrong!)
- iocage exec nextcloud pkg update
- iocage exec nextcloud pkg upgrade
- iocage exec nextcloud pkg install php72 php72-bz2 php72-ctype php72-curl php72-dom
php72-exif php72-fileinfo php72-filter php72-gd php72-hash php72-iconv php72-intl
php72-json php72-mbstring php72-opcache php72-openssl php72-pdo php72-pdo_mysql
php72-pecl-APCu php72-pecl-redis php72-posix php72-session php72-simplexml php72-wddx
php72-xml php72-xmlreader php72-xmlwriter php72-xsl php72-zip php72-zlib
- iocage restart nextcloud
I actually prefer to console into the jail (iocage console nextcloud) to run the commands, but it’s easier to show them as the example above and obviously, my jail is called “nextcloud”.
Everything worked perfectly, so I thought I’d updated WordPress too! A few less PHP modules to update with this one:
- php72 php72-ctype php72-curl php72-filter php72-ftp php72-gd php72-hash php72-json
php72-mysqli php72-openssl php72-pear php72-simplexml php72-tokenizer php72-xml
php72-zip php72-zlib
Overall, a fairly painless process which means I’m sitting pretty with Nextcloud and WordPress for some time now.
Not all packages work when using the official freenas nextcloud jail. Lots of errors are thrown (internal server errors)
I haven’t used any of the FreeNAS plugins since 9.3.1 as my experience at the time was never very favourable. They generally we not well maintained, and had a tendency to break whenever updating.
My advice would be to follow some of the excellent manual guides for creating and configuring your own jail, which you should be able to maintain and update as required. iocage now means these can be updated between FreeBSD versions, something you couldn’t do with the old Warden manager.
Alternatively, there are a growing number of community-supported jails with semi-automated scripted installations, although I think the downside of these is maybe a lack of understanding how they work, so you don’t gain the same level of knowledge to maintain yourself.
Pretty sure they are better options than the officially supported plugins though.
My Nextcloud and WordPress jails that I blogged about here are actually running PHP 7.4.2 now that I’m pretty sure followed a very similar method to update!
Thank you for your reply. I ditched the freenas iocage jails and went back to hypervisor level (in proxmox) mounted the nextcloud data share to my ubuntu server VM with 10GBe virtio network interface. Should not result in Performance loss.
Thanks for your really useful article. When I upgraded from php 7.2 to php 7.4 for my NextCloud jail I had to include the following pkg install mod_php74. Without this I had a strange missing PDO message in the http.logs and a resulting server 500 error. Thought adding this might help others.