I download Wordpress version 5.8.3 (PHP version 8.1.1 & MySql version 8.0.27). When I want to install Wordpress, when input database data (databasename, username, password and ...) and click submit button, go to page step2 (http://localhost/wordpress/wp-admin/setup-config.php?step=2) but show this error:

There has been a critical error on this website.

Learn more about troubleshooting WordPress.

And when I want adding database data manually on wp-config.php file:

 * The base configuration for WordPress
 * The wp-config.php creation script uses this file during the installation.
 * You don't have to use the web site, you can copy this file to "wp-config.php"
 * and fill in the values.
 * This file contains the following configurations:
 * * MySQL settings
 * * Secret keys
 * * Database table prefix
 * @link https://wordpress.org/support/article/editing-wp-config-php/
 * @package WordPress

// ** MySQL settings - You can get this info from your web host ** //
/** The name of the database for WordPress */
define( 'DB_NAME', 'wordpress' );

/** MySQL database username */
define( 'DB_USER', 'root' );

/** MySQL database password */
define( 'DB_PASSWORD', '' );

/** MySQL hostname */
define( 'DB_HOST', 'localhost' );

/** Database charset to use in creating database tables. */
define( 'DB_CHARSET', 'utf8' );

/** The database collate type. Don't change this if in doubt. */
define( 'DB_COLLATE', '' );

 * Authentication unique keys and salts.
 * Change these to different unique phrases! You can generate these using
 * the {@link https://api.wordpress.org/secret-key/1.1/salt/ WordPress.org secret-key service}.
 * You can change these at any point in time to invalidate all existing cookies.
 * This will force all users to have to log in again.
 * @since 2.6.0
define( 'AUTH_KEY',         'put your unique phrase here' );
define( 'SECURE_AUTH_KEY',  'put your unique phrase here' );
define( 'LOGGED_IN_KEY',    'put your unique phrase here' );
define( 'NONCE_KEY',        'put your unique phrase here' );
define( 'AUTH_SALT',        'put your unique phrase here' );
define( 'SECURE_AUTH_SALT', 'put your unique phrase here' );
define( 'LOGGED_IN_SALT',   'put your unique phrase here' );
define( 'NONCE_SALT',       'put your unique phrase here' );


 * WordPress database table prefix.
 * You can have multiple installations in one database if you give each
 * a unique prefix. Only numbers, letters, and underscores please!
$table_prefix = 'wp_';

 * For developers: WordPress debugging mode.
 * Change this to true to enable the display of notices during development.
 * It is strongly recommended that plugin and theme developers use WP_DEBUG
 * in their development environments.
 * For information on other constants that can be used for debugging,
 * visit the documentation.
 * @link https://wordpress.org/support/article/debugging-in-wordpress/
define( 'WP_DEBUG', false );

/* Add any custom values between this line and the "stop editing" line. */

/* That's all, stop editing! Happy publishing. */

/** Absolute path to the WordPress directory. */
if ( ! defined( 'ABSPATH' ) ) {
    define( 'ABSPATH', __DIR__ . '/' );

/** Sets up WordPress vars and included files. */
require_once ABSPATH . 'wp-settings.php';

display this errors:

Fatal error: Uncaught mysqli_sql_exception: Table 'wordpress.wp_options' doesn't exist in C:\Apache24\htdocs\wordpress\wp-includes\wp-db.php:2056 Stack trace: #0 C:\Apache24\htdocs\wordpress\wp-includes\wp-db.php(2056): mysqli_query(Object(mysqli), 'SELECT option_n...') #1 C:\Apache24\htdocs\wordpress\wp-includes\wp-db.php(1945): wpdb->_do_query('SELECT option_n...') #2 C:\Apache24\htdocs\wordpress\wp-includes\wp-db.php(2695): wpdb->query('SELECT option_n...') #3 C:\Apache24\htdocs\wordpress\wp-includes\option.php(284): wpdb->get_results('SELECT option_n...') #4 C:\Apache24\htdocs\wordpress\wp-includes\functions.php(1730): wp_load_alloptions() #5 C:\Apache24\htdocs\wordpress\wp-includes\load.php(752): is_blog_installed() #6 C:\Apache24\htdocs\wordpress\wp-settings.php(159): wp_not_installed() #7 C:\Apache24\htdocs\wordpress\wp-config.php(96): require_once('C:\Apache24\htd...') #8 C:\Apache24\htdocs\wordpress\wp-load.php(50): require_once('C:\Apache24\htd...') #9 C:\Apache24\htdocs\wordpress\wp-blog-header.php(13): require_once('C:\Apache24\htd...') #10 C:\Apache24\htdocs\wordpress\index.php(17): require('C:\Apache24\htd...') #11 {main} thrown in C:\Apache24\htdocs\wordpress\wp-includes\wp-db.php on line 2056

How can I fix this problem?

  • Since this is a new WordPress installation, then you could just try to re-install it from the beginning, or delete the database that you've created and wp-config.php (both at your own risks) and run the install setup again. If the same issue persists, see this for help with debugging and troubleshooting.
    – Sally CJ
    Jan 9, 2022 at 6:47


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.