Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Has anyone set this up with PHP 8.1? #677

Zegnat started this conversation in General
Jan 13, 2022 · 1 comments · 3 replies
Discussion options

When I try to run with wordpress:5.8.3-php8.1 as my image, instead of being redirected to /wp-admin/install.php on first navigation, it throws a fatal error:

Fatal error: Uncaught mysqli_sql_exception: Table 'wordpress.wp_options' doesn't exist in /var/www/html/wp-includes/wp-db.php:2056

This seems to be isolated to PHP 8.1, as dropping my image down to wordpress:5.8.3-php8.0 gets me passed the error and onto the installation screen.

Any ideas what might be causing that? I am new to running WordPress in Docker so I do not want to exclude user error...

If you want to reproduce the error, you can use docker-compose:

version: '3'
services:
 database:
 image: mariadb:10.6.5
 restart: unless-stopped
 volumes:
 - database-volume:/var/lib/mysql
 environment:
 MYSQL_ROOT_PASSWORD: "root"
 MYSQL_DATABASE: "wordpress"
 MYSQL_USER: "wordpress"
 MYSQL_PASSWORD: "wordpress"
 networks:
 - wordpress
 web:
 image: wordpress:5.8.3-php8.1
 restart: unless-stopped
 environment:
 WORDPRESS_DB_HOST: database
 WORDPRESS_DB_NAME: "wordpress"
 WORDPRESS_TABLE_PREFIX: "wp_"
 WORDPRESS_DB_USER: "wordpress"
 WORDPRESS_DB_PASSWORD: "wordpress"
 WORDPRESS_DEBUG: 1
 ports:
 - 80:80
 depends_on:
 - database
 networks:
 - wordpress
networks:
 wordpress:
volumes:
 database-volume:
You must be logged in to vote

Replies: 1 comment 3 replies

Comment options

Turns out starting a discussion thread here was a form of rubber ducking.

The problem is something discussed with regards to the upcoming WordPress 5.9 release, described on the blog: PHP 8.1 MySQLi default error mode changed. I am a little surprised that the fix for this (which landed back in august!) was not back-ported to WP 5.8.

Have people just not been running on PHP 8.1? Or is it only a really breaking problem during installation, so people with existing blogs that are upgrading to PHP 8.1 after installation are never hit by it?

You must be logged in to vote
3 replies
Comment options

You beat me to it by about 20 seconds. 😂 ❤️

In the relevant bits of WordPress code, there's a suppress_errors bit of functionality which doesn't cope with this new exception default, but yeah, it appears it's probably only really used seriously on the initialization of a new site? 😅

There are 5.9 RCs available, so probably worth testing one of those to validate the fix? 😄

Comment options

Yep, I just ran with wordpress:beta-5.9-RC2-php8.1 and it worked without issue. Again, I am surprised WordPress did not backport this.

It does make me wonder if offering a PHP 8.1 image at all is a good idea, if it is known installation cannot even run in it...

Comment options

That type of issue is part of why it's not the default (yet) until WordPress says it's stable and recommended for use 😄

Once 5.9 leaves RCs, we won't be updating the 5.8 images any more, so I think it'll be a moot point either way "soon"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants

AltStyle によって変換されたページ (->オリジナル) /