-
Jones posted an update
How to Update WordPress and PHP in a Docker Setup
Docker image
I have installed WordPress with Docker guided by this tutorial:
https://www.digitalocean.com/community/tutorials/how-to-install-wordpress-with-docker-compose
The tutorial is using this
docker-compose.yml
file that is usingwordpress:5.1.1-fpm-alpine
image:version: '3' services: db: image: mysql:8.0 container_name: db ... wordpress: depends_on: - db image: wordpress:5.1.1-fpm-alpine # <-- Note the WordPress version here container_name: wordpress ...
Outdated WordPress version
Now, I have to install some plugins, but they are requiring some newer versions of the WordPress. Like the WP phpMyAdmin plugin:
This plugin doesn’t work with your version of WordPress. Please update WordPress.
The WordPress dashboard is displaying update notifications too:
WordPress 6.7.1 is available! Please update now.
Try to update
But when I click on the
Please update now.
link, I receive this error:You cannot update because WordPress 6.7.1 requires PHP version 7.2.24 or higher. You are running version 7.2.18.
Question
How can I reliably update the WordPress along with PHP? I don’t want to mess up the whole Docker setup.
digitalocean.com
How To Install WordPress With Docker Compose | DigitalOcean
WordPress is a free and open-source Content Management System (CMS) that is widely used to launch new websites. Running WordPress typically involves installi…
Banner-
First and foremost, wordpress:5.1.1-fpm-alpine doesn’t seem to be an official WordPress image. These are always kind of hard to maintain, easy to set up, but a whole lot of headache to maintain. Anyway, to do such an upgrade, you will have to upgrade wordpress and php inside the container as well as their dependencies, goodluck with that! A better approach would be to create a backup of everthing (do a snapshot of the entire server if possible). Then run a new version of wordpress locally using a restored copy of the db, once everything works, you can use a newer image with that data.
-
@banner I backed up the Docker named volumes. Then I updated the Docker image version, but the website threw 500 error. Then I restored the backup volumes. But website throws Error establishing a database connection error. Looks like updating WordPress & PHP by Docker might be a hassle even with backup/restore of Docker volumes
-
-