I'm encountering a bug on my test server and it appears to be 100% related to PHP 8.1. I've attempted to use the latest WP-CLI alpha build as of this evening and it still results in the same failure. The test server is Ubuntu 20.04 running Nginx 1.21.4, PHP 8.1, and MariaDB 10.6.
Attempting to do site creation using wp core download, wp core config, and wp core install on PHP 8.0 works perfectly. On PHP 8.1, running wp core download and wp core config work correctly. Running the same exact wp core install command on the same exact server with the only difference being PHP 8.1 results in the following error:
PHP Fatal error: Uncaught mysqli_sql_exception: Table 'ES34WHXCqt.wp_options' doesn't exist in /var/www/sites/redacted/html/wp-includes/wp-db.php:2056
Stack trace:
#0 /var/www/sites/redacted/html/wp-includes/wp-db.php(2056): mysqli_query()
#1 /var/www/sites/redacted/html/wp-includes/wp-db.php(1945): wpdb->_do_query()
#2 /var/www/sites/redacted/html/wp-includes/wp-db.php(2581): wpdb->query()
#3 /var/www/sites/redacted/html/wp-includes/functions.php(1734): wpdb->get_var()
#4 /var/www/sites/redacted/html/wp-includes/load.php(752): is_blog_installed()
#5 /var/www/sites/redacted/html/wp-settings.php(159): wp_not_installed()
#6 phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Runner.php(1281): require('...')
#7 phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Runner.php(1199): WP_CLI\Runner->load_wordpress()
#8 phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Bootstrap/LaunchRunner.php(28): WP_CLI\Runner->start()
#9 phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/bootstrap.php(78): WP_CLI\Bootstrap\LaunchRunner->process()
#10 phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/wp-cli.php(27): WP_CLI\bootstrap()
#11 phar:///usr/local/bin/wp/php/boot-phar.php(11): include('...')
#12 /usr/local/bin/wp(4): include('...')
I'm able to roll back the server to PHP 8.0 and the same command works as expected.
I'm encountering a bug on my test server and it appears to be 100% related to PHP 8.1. I've attempted to use the latest WP-CLI alpha build as of this evening and it still results in the same failure. The test server is Ubuntu 20.04 running Nginx 1.21.4, PHP 8.1, and MariaDB 10.6.
Attempting to do site creation using wp core download, wp core config, and wp core install on PHP 8.0 works perfectly. On PHP 8.1, running wp core download and wp core config work correctly. Running the same exact wp core install command on the same exact server with the only difference being PHP 8.1 results in the following error:
PHP Fatal error: Uncaught mysqli_sql_exception: Table 'ES34WHXCqt.wp_options' doesn't exist in /var/www/sites/redacted/html/wp-includes/wp-db.php:2056
Stack trace:
#0 /var/www/sites/redacted/html/wp-includes/wp-db.php(2056): mysqli_query()
#1 /var/www/sites/redacted/html/wp-includes/wp-db.php(1945): wpdb->_do_query()
#2 /var/www/sites/redacted/html/wp-includes/wp-db.php(2581): wpdb->query()
#3 /var/www/sites/redacted/html/wp-includes/functions.php(1734): wpdb->get_var()
#4 /var/www/sites/redacted/html/wp-includes/load.php(752): is_blog_installed()
#5 /var/www/sites/redacted/html/wp-settings.php(159): wp_not_installed()
#6 phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Runner.php(1281): require('...')
#7 phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Runner.php(1199): WP_CLI\Runner->load_wordpress()
#8 phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Bootstrap/LaunchRunner.php(28): WP_CLI\Runner->start()
#9 phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/bootstrap.php(78): WP_CLI\Bootstrap\LaunchRunner->process()
#10 phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/wp-cli.php(27): WP_CLI\bootstrap()
#11 phar:///usr/local/bin/wp/php/boot-phar.php(11): include('...')
#12 /usr/local/bin/wp(4): include('...')
I'm able to roll back the server to PHP 8.0 and the same command works as expected.