The error occurs because WordPress is trying to get MySQL server information, but the database connection is failing (returning false instead of a valid MySQL connection object).
[14-Sep-2025 21:15:24 UTC] PHP Fatal error: Uncaught TypeError: mysqli_get_server_info(): Argument #1 ($mysql) must be of type mysqli, bool given in /home1/aurrukwj/public_html/wp-includes/class-wpdb.php:4136
Stack trace:
#0 /home1/aurrukwj/public_html/wp-includes/class-wpdb.php(4136): mysqli_get_server_info(false)
#1 /home1/aurrukwj/public_html/wp-content/plugins/woocommerce/packages/action-scheduler/classes/data-stores/ActionScheduler_DBStore.php(455): wpdb->db_server_info()
#2 /home1/aurrukwj/public_html/wp-content/plugins/woocommerce/packages/action-scheduler/classes/data-stores/ActionScheduler_DBStore.php(644): ActionScheduler_DBStore->get_query_actions_sql(Array, 'select')
#3 /home1/aurrukwj/public_html/wp-content/plugins/woocommerce/packages/action-scheduler/classes/abstracts/ActionScheduler_Store.php(131): ActionScheduler_DBStore->query_actions(Array)
#4 /home1/aurrukwj/public_html/wp-content/plugins/woocommerce/packages/action-scheduler/functions.php(415): ActionScheduler_Store->query_action(Array)
#5 [internal function]: as_has_scheduled_action('wc_schedule_pen...')
#6 /home1/aurrukwj/public_html/wp-content/plugins/woocommerce/src/Internal/BatchProcessing/BatchProcessingController.php(554): call_user_func('as_has_schedule...', 'wc_schedule_pen...')
#7 /home1/aurrukwj/public_html/wp-content/plugins/woocommerce/src/Internal/BatchProcessing/BatchProcessingController.php(86): Automattic\WooCommerce\Internal\BatchProcessing\BatchProcessingController->remove_or_retry_failed_processors()
#8 /home1/aurrukwj/public_html/wp-includes/class-wp-hook.php(324): Automattic\WooCommerce\Internal\BatchProcessing\BatchProcessingController->Automattic\WooCommerce\Internal\BatchProcessing\{closure}('')
#9 /home1/aurrukwj/public_html/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters(NULL, Array)
#10 /home1/aurrukwj/public_html/wp-includes/plugin.php(517): WP_Hook->do_action(Array)
#11 /home1/aurrukwj/public_html/wp-includes/load.php(1304): do_action('shutdown')
#12 [internal function]: shutdown_action_hook()
#13 {main}
thrown in /home1/aurrukwj/public_html/wp-includes/class-wpdb.php on line 4136
Root Cause
The error happens during WordPress shutdown process when WooCommerce's Action Scheduler tries to check for scheduled actions, but the database connection has been lost or failed to initialize properly.
Database Server Optimization
If the issue persists, consider these server-level optimizations:
| Setting |
Recommended Value |
Purpose |
| max_connections |
100-200 |
Increase MySQL connection limit |
| wait_timeout |
60 |
Reduce connection idle time |
| max_allowed_packet |
64M |
Handle larger database operations |
WordPress Optimization
Optimize WordPress to reduce database load:
- Install a caching plugin (WP Rocket, W3 Total Cache)
- Optimize database tables regularly
- Limit post revisions in wp-config.php:
define('WP_POST_REVISIONS', 5);
- Enable persistent database connections (if supported by your host)
WooCommerce Specific Fix
Since the error originates from WooCommerce's Action Scheduler, you can try disabling action scheduler processing during shutdown:
add_action('shutdown', 'disable_woocommerce_shutdown_actions', 1);
function disable_woocommerce_shutdown_actions() {
if (class_exists('ActionScheduler_DBStore')) {
remove_all_actions('shutdown');
}
}
Enable WordPress Debugging
Add these settings to your wp-config.php to get more information:
define('WP_DEBUG', true);
define('WP_DEBUG_LOG', true);
define('WP_DEBUG_DISPLAY', false);
@ini_set('display_errors', 0);
Check Error Log
Examine your PHP error log for additional clues:
- Check /home1/aurrukwj/public_html/error_log
- Check your hosting provider's error log section
- Look for earlier errors that might have caused the connection issue
Test Database Connection Independently
Create a simple PHP script to test database connectivity:
<?php
// Test database connection
$mysqli = new mysqli("localhost", "DB_USER", "DB_PASSWORD", "DB_NAME");
// Check connection
if ($mysqli->connect_error) {
die("Connection failed: " . $mysqli->connect_error);
}
echo "Connected successfully";
// Check server version
echo "Server version: " . $mysqli->server_info;
$mysqli->close();
?>
Important
After implementing any fixes, monitor your error logs to ensure the issue is resolved. If the problem persists, contact your hosting provider as it might be a server-level database issue.