#54883 closed defect (bug) (duplicate)
"Table 'wp_options' doesn't exist" error thrown when installing WordPress on PHP 8.1.
| Reported by: | maythamalsudany | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | Upgrade/Install | Version: | 5.8.3 |
| Severity: | normal | Keywords: | php81 |
| Cc: | Focuses: |
Description
When using PHP 8.1, the following error is thrown after configuring the database credentials (editing wp-config.php, or using the installer):
PHP Fatal error: Uncaught mysqli_sql_exception: Table 'mysite.wp_options' doesn't exist in .../wp-includes/wp-db.php:2056
Stack trace:
#0 .../wp-includes/wp-db.php(2056): mysqli_query(Object(mysqli), 'SELECT option_n...')
#1 .../wp-includes/wp-db.php(1945): wpdb->_do_query('SELECT option_n...')
#2 .../wp-includes/wp-db.php(2695): wpdb->query('SELECT option_n...')
#3 .../wp-includes/option.php(284): wpdb->get_results('SELECT option_n...')
#4 .../wp-includes/functions.php(1730): wp_load_alloptions()
#5 .../wp-includes/load.php(752): is_blog_installed()
#6 .../wp-settings.php(159): wp_not_installed()
#7 .../wp-config.php(78): require_once('/Users/maythama...')
#8 .../wp-load.php(50): require_once('/Users/maythama...')
#9 .../wp-blog-header.php(13): require_once('/Users/maythama...')
#10 .../index.php(17): require('/Users/maythama...')
#11 {main}
thrown in .../wp-includes/wp-db.php on line 2056
Reverting to PHP 8.0 fixes the problem though.
Change History (4)
#3
@
4 years ago
Hello @maythamalsudany,
Welcome to WordPress Core's Trac! Thank you for this ticket.
As @costdev noted, this issue is fixed in WordPress 5.9 release (releasing on 25 Jan 2022). See #52825.
In PHP 8.1, the default error handling of MySQLi extension changed from silent to fatal error. This is fixed in 5.9 by turning off error reporting as Core has its own error reporting and graceful handling of database errors.
For more information:
- PHP 8.1 MySQLi default error mode changed in the WordPress 5.9 and PHP 8.0-8.1 dev note.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Duplicate of #52825.
Fixed in [51582].