Updating WordPress PHP version in Docker

Currently reading
Updating WordPress PHP version in Docker

47
5
NAS
DS920+
Operating system
  1. Windows
Mobile operating system
  1. Android
Hello to everyone!

I am trying to update the PHP version of a WordPress website built with Docker on a Synology NAS.
The WordPress/Docker settings of the website are the ones described in my old thread here: Hosting a WordPress website

The current PHP version of the website is the one of the "latest" official WordPress Docker image, i.e. 7.4.19.
I would like to update to version 8.1.6.

I read on the web that for updating PHP version in Docker it is advisible to reinstall the WordPress image, but I am not able to download an official Wordpress image different from the one with "latest" tag from the "Registry" in the Docker ui. The "latest" WordPress official image has PHP version 7.4.19, as visible here Docker Hub.
I tried updating the PHP version by manually changing the settings of WordPress and phpmyadmin containers, but with no results.

Could you please suggest me how to proceed for updating the PHP version without losing the data of the website?

Thank you in advance,

Giacomo
 
The idea would be to wait for the "latest" image tag to be pushed out as php8.1 tag, or to switch your container to the php8.1 image that is already up there.

Considering that this was pushed 3 days ago, I guess WP docker team is just waiting before they proclaim the latest tag as 8.1. Just give it a few more days, or as I said, switch to the image with php8.1 tag.
 
Thank you for the reply, @Rusty.

If I want to switch to the image with php8.1 tag, how should I do that?
I got the WordPress container from Docker ui, and I am not able to choose between tags from the ui, the latest image is downloaded automatically.
 
I succeeded in downloading the Wordpress image with PHP 8.1 version, it was actually much easier than expected!
I then manually copied all the settings of the previous image into the new one (i.e. environment and links in advanced settings, port settings and volume settings), I connected the image to the network where the old image was contained, launched the new image and stopped the old one.

Unfortunately the website is not reachable with the new wordpress image (HTTP ERROR 500), while it is still reachable by launching the old wordpress image.

What should I do for making the new image work? Maybe I need to update the phpmyadmin image too?

Thank you,

Giacomo
 
Last edited:
Maybe I need to update the phpmyadmin image too?
Why would it? phpMyAdmin is neither related to, nor required for Wordpress. The only thing both have in common is that they access the same database :)
-- post merged: --

Since your whole process is intransparent for us, it's hard to tell where things went wrong or something needs to be done different.

Personaly, I would have made a copy of the host folders that are mapped as volumes into the container, made a backup of the wordpress database and would have pulled the new image, and "resseted" the container to make it use the new container. If this leads to problems, I would take a look at the dockerhub description (or a page it links to) if migration is mentioned and if so follow whatever it suggests.

update: the striked though part will not work in this case because the tag is different. The easiest way would be to export the configuration of the old container, edit the tag in the json file that was created by the export, then delete the container and import the modified json again to create the new container based on the new tag.
 

Create an account or login to comment

You must be a member in order to leave a comment

Create account

Create an account on our community. It's easy!

Log in

Already have an account? Log in here.

Similar threads

Root of this issue found;) For unknown reason, the docker package on the first, failing DS, uses the...
Replies
3
Views
1,159
One note to the approach: copying the files from inside the container might cause inconsitent copies if...
Replies
20
Views
4,739
@one-eyed-king yes, homebridge maps to a folder like the typical "/config" and also includes...
Replies
5
Views
1,459
  • Question
Welcome to the forum! To where? What's going on? How are CF records set as well as NPM RP record for that...
Replies
1
Views
935

Welcome to SynoForum.com!

SynoForum.com is an unofficial Synology forum for NAS owners and enthusiasts.

Registration is free, easy and fast!

Back
Top