57 } else { |
57 } else { |
58 |
58 |
59 // A config file doesn't exist. |
59 // A config file doesn't exist. |
60 |
60 |
61 define( 'WPINC', 'wp-includes' ); |
61 define( 'WPINC', 'wp-includes' ); |
|
62 require_once ABSPATH . WPINC . '/version.php'; |
|
63 require_once ABSPATH . WPINC . '/compat.php'; |
62 require_once ABSPATH . WPINC . '/load.php'; |
64 require_once ABSPATH . WPINC . '/load.php'; |
|
65 |
|
66 // Check for the required PHP version and for the MySQL extension or a database drop-in. |
|
67 wp_check_php_mysql_versions(); |
63 |
68 |
64 // Standardize $_SERVER variables across setups. |
69 // Standardize $_SERVER variables across setups. |
65 wp_fix_server_vars(); |
70 wp_fix_server_vars(); |
66 |
71 |
|
72 define( 'WP_CONTENT_DIR', ABSPATH . 'wp-content' ); |
67 require_once ABSPATH . WPINC . '/functions.php'; |
73 require_once ABSPATH . WPINC . '/functions.php'; |
68 |
74 |
69 $path = wp_guess_url() . '/wp-admin/setup-config.php'; |
75 $path = wp_guess_url() . '/wp-admin/setup-config.php'; |
70 |
76 |
71 /* |
77 // Redirect to setup-config.php. |
72 * We're going to redirect to setup-config.php. While this shouldn't result |
78 if ( ! str_contains( $_SERVER['REQUEST_URI'], 'setup-config' ) ) { |
73 * in an infinite loop, that's a silly thing to assume, don't you think? If |
|
74 * we're traveling in circles, our last-ditch effort is "Need more help?" |
|
75 */ |
|
76 if ( false === strpos( $_SERVER['REQUEST_URI'], 'setup-config' ) ) { |
|
77 header( 'Location: ' . $path ); |
79 header( 'Location: ' . $path ); |
78 exit; |
80 exit; |
79 } |
81 } |
80 |
82 |
81 define( 'WP_CONTENT_DIR', ABSPATH . 'wp-content' ); |
|
82 require_once ABSPATH . WPINC . '/version.php'; |
|
83 |
|
84 wp_check_php_mysql_versions(); |
|
85 wp_load_translations_early(); |
83 wp_load_translations_early(); |
86 |
84 |
87 // Die with an error message. |
85 // Die with an error message. |
88 $die = '<p>' . sprintf( |
86 $die = '<p>' . sprintf( |
89 /* translators: %s: wp-config.php */ |
87 /* translators: %s: wp-config.php */ |
90 __( "There doesn't seem to be a %s file. I need this before we can get started." ), |
88 __( "There doesn't seem to be a %s file. It is needed before the installation can continue." ), |
91 '<code>wp-config.php</code>' |
89 '<code>wp-config.php</code>' |
92 ) . '</p>'; |
90 ) . '</p>'; |
93 $die .= '<p>' . sprintf( |
91 $die .= '<p>' . sprintf( |
94 /* translators: 1: Documentation URL, 2: wp-config.php */ |
92 /* translators: 1: Documentation URL, 2: wp-config.php */ |
95 __( 'Need more help? <a href="%1$s">Read the support article on %2$s</a>.' ), |
93 __( 'Need more help? <a href="%1$s">Read the support article on %2$s</a>.' ), |
96 __( 'https://wordpress.org/support/article/editing-wp-config-php/' ), |
94 __( 'https://developer.wordpress.org/advanced-administration/wordpress/wp-config/' ), |
97 '<code>wp-config.php</code>' |
95 '<code>wp-config.php</code>' |
98 ) . '</p>'; |
96 ) . '</p>'; |
99 $die .= '<p>' . sprintf( |
97 $die .= '<p>' . sprintf( |
100 /* translators: %s: wp-config.php */ |
98 /* translators: %s: wp-config.php */ |
101 __( "You can create a %s file through a web interface, but this doesn't work for all server setups. The safest way is to manually create the file." ), |
99 __( "You can create a %s file through a web interface, but this doesn't work for all server setups. The safest way is to manually create the file." ), |