diff --git a/src/wp-includes/load.php b/src/wp-includes/load.php index 34f30bcb03..7f4a878241 100644 --- a/src/wp-includes/load.php +++ b/src/wp-includes/load.php @@ -153,7 +153,11 @@ function wp_check_php_mysql_versions() { exit( 1 ); } - if ( ! extension_loaded( 'mysql' ) && ! extension_loaded( 'mysqli' ) && ! extension_loaded( 'mysqlnd' ) && ! file_exists( WP_CONTENT_DIR . '/db.php' ) ) { + if ( ! extension_loaded( 'mysql' ) && ! extension_loaded( 'mysqli' ) && ! extension_loaded( 'mysqlnd' ) + // This runs before default constants are defined, so we can't assume WP_CONTENT_DIR is set yet. + && ( defined( 'WP_CONTENT_DIR' ) && ! file_exists( WP_CONTENT_DIR . '/db.php' ) + || ! file_exists( ABSPATH . 'wp-content/db.php' ) ) + ) { require_once ABSPATH . WPINC . '/functions.php'; wp_load_translations_early(); $args = array(