登录后得到“403禁止”

时间:2020-12-23 作者:Chris

我已经在我的计算机上安装了WordPress,安装在/var/www/localhost/htdocs中,并最终获得了管理页面,输入了用户名和密码。

这是我的wp配置。php(我去掉了MySQL密码和较长的注释):

/** The name of the database for WordPress */
define( \'DB_NAME\', \'wordpress\' );

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

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

/** 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\', \'\' );

/** MySQL socket */
define( \'DB_HOST\', \'localhost:/var/run/mysqld/mysqld.sock\' );

/**#@+
 * 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_\';

define( \'WP_DEBUG\', true );
define(\'WP_DEBUG_LOG\',true);

/* 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\';
我可以使用登录http://localhost/wp-login.php但在那之后,我得到了;403禁止我已启用调试,希望获得更多信息,但找不到日志文件。

我希望你能帮助我。。。(抱歉,找不到合适的标记)

2 个回复
SO网友:karl

403错误通常由插件或损坏的插件引起。htaccess文件(不是这样,因为安装是本地的)或对关键文件的错误权限。如果您正在运行Linux,请尝试在本地shell中运行此命令:

find . -type d -exec chmod 755 {} \\;
find . -type f -exec chmod 644 {} \\;

SO网友:Mohammed Khalil

尝试将本地主机中wordpress文件夹的权限更改为755,这会有所帮助。

相关推荐

在已发布的页面上拒绝访问,但不在wordpress/wp-admin/上拒绝访问

我有一个网站,在那里,我的请求url的状态突然变为“403禁止”,HTML页面中的访问被拒绝。这个问题只发生在已发布页面的链接上/wp admin/很好,我可以编辑和发布页面。但是当点击页面链接时,我的访问被拒绝了。以下是我的网站的环境详细信息。共享托管</Wordpress框架5.4.2版</我可以通过ftp连接</访问html文件</我试过了禁用所有插件(包括更改插件文件夹名称)。htaccess文件很好,请告诉我要检查哪些权限以及在哪里检查。