Index: wp-load.php
===================================================================
--- wp-load.php	(revision 18373)
+++ wp-load.php	(working copy)
@@ -41,6 +41,11 @@
 	else
 		$path = 'wp-admin/';
 
+	require_once( ABSPATH . '/wp-includes/load.php' );
+	require_once( ABSPATH . '/wp-includes/version.php' );
+	define( 'WP_CONTENT_DIR', ABSPATH . 'wp-content' );
+	wp_check_php_mysql_versions();
+
 	// Die with an error message
 	require_once( ABSPATH . '/wp-includes/class-wp-error.php' );
 	require_once( ABSPATH . '/wp-includes/functions.php' );
Index: wp-includes/load.php
===================================================================
--- wp-includes/load.php	(revision 18373)
+++ wp-includes/load.php	(working copy)
@@ -2,6 +2,8 @@
 /**
  * These functions are needed to load WordPress.
  *
+ * This file must be parsable by PHP4.
+ *
  * @package WordPress
  */
 
@@ -95,6 +97,9 @@
  *
  * Dies if requirements are not met.
  *
+ * This function must be able to work without a complete environment set up. In wp-load.php, for
+ * example, WP_CONTENT_DIR is defined and version.php is included before this function is called.
+ *
  * @access private
  * @since 3.0.0
  */
Index: wp-settings.php
===================================================================
--- wp-settings.php	(revision 18373)
+++ wp-settings.php	(working copy)
@@ -23,6 +23,9 @@
 // Set initial default constants including WP_MEMORY_LIMIT, WP_MAX_MEMORY_LIMIT, WP_DEBUG, WP_CONTENT_DIR and WP_CACHE.
 wp_initial_constants( );
 
+// Check for the required PHP version and for the MySQL extension or a database drop-in.
+wp_check_php_mysql_versions();
+
 // Disable magic quotes at runtime. Magic quotes are added using wpdb later in wp-settings.php.
 set_magic_quotes_runtime( 0 );
 @ini_set( 'magic_quotes_sybase', 0 );
@@ -40,9 +43,6 @@
 // Standardize $_SERVER variables across setups.
 wp_fix_server_vars();
 
-// Check for the required PHP version and for the MySQL extension or a database drop-in.
-wp_check_php_mysql_versions();
-
 // Check if we have received a request due to missing favicon.ico
 wp_favicon_request();
 
Index: wp-admin/setup-config.php
===================================================================
--- wp-admin/setup-config.php	(revision 18373)
+++ wp-admin/setup-config.php	(working copy)
@@ -40,10 +40,12 @@
 /**#@-*/
 
 require_once(ABSPATH . WPINC . '/load.php');
+require_once(ABSPATH . WPINC . '/version.php');
+wp_check_php_mysql_versions();
+
 require_once(ABSPATH . WPINC . '/compat.php');
 require_once(ABSPATH . WPINC . '/functions.php');
 require_once(ABSPATH . WPINC . '/class-wp-error.php');
-require_once(ABSPATH . WPINC . '/version.php');
 
 if (!file_exists(ABSPATH . 'wp-config-sample.php'))
 	wp_die('Sorry, I need a wp-config-sample.php file to work from. Please re-upload this file from your WordPress installation.');
