最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

php - How can I fix WordPress installation errors?

programmeradmin3浏览0评论

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:

<?php
/**
 * 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
 * * ABSPATH
 *
 * @link /
 *
 * @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 .1/salt/ WordPress 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 /
 */
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?

发布评论

评论列表(0)

  1. 暂无评论