Php Wordpress管理员在升级到3.5.1后停止工作
今天我尝试将Wordpress更新到最新版本(3.5.1)。完成此操作后,我无法再打开Php Wordpress管理员在升级到3.5.1后停止工作,php,wordpress,Php,Wordpress,今天我尝试将Wordpress更新到最新版本(3.5.1)。完成此操作后,我无法再打开wp admin/index.php。它给我一个404错误。我查看了index.php文件,当调用函数auth\u redirect()时,该文件会中断。下面是该函数的代码: function auth_redirect() { // Checks if a user is logged in, if not redirects them to the login page $secure =
wp admin/index.php
。它给我一个404错误。我查看了index.php
文件,当调用函数auth\u redirect()
时,该文件会中断。下面是该函数的代码:
function auth_redirect() {
// Checks if a user is logged in, if not redirects them to the login page
$secure = ( is_ssl() || force_ssl_admin() );
$secure = apply_filters('secure_auth_redirect', $secure);
// If https is required and request is http, redirect
if ( $secure && !is_ssl() && false !== strpos($_SERVER['REQUEST_URI'], 'wp-admin') ) {
if ( 0 === strpos( $_SERVER['REQUEST_URI'], 'http' ) ) {
wp_redirect( set_url_scheme( $_SERVER['REQUEST_URI'], 'https' ) );
exit();
} else {
wp_redirect( 'https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] );
exit();
}
}
if ( is_user_admin() )
$scheme = 'logged_in';
else
$scheme = apply_filters( 'auth_redirect_scheme', '' );
if ( $user_id = wp_validate_auth_cookie( '', $scheme) ) {
do_action('auth_redirect', $user_id);
// If the user wants ssl but the session is not ssl, redirect.
if ( !$secure && get_user_option('use_ssl', $user_id) && false !== strpos($_SERVER['REQUEST_URI'], 'wp-admin') ) {
if ( 0 === strpos( $_SERVER['REQUEST_URI'], 'http' ) ) {
wp_redirect( set_url_scheme( $_SERVER['REQUEST_URI'], 'https' ) );
exit();
} else {
wp_redirect( 'https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] );
exit();
}
}
return; // The cookie is good so we're done
}
// The cookie is no good so force login
nocache_headers();
$redirect = ( strpos( $_SERVER['REQUEST_URI'], '/options.php' ) && wp_get_referer() ) ? wp_get_referer() : set_url_scheme( 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] );
$login_url = wp_login_url($redirect, true);
wp_redirect($login_url);
exit();
}
但是,我找不到它出现故障的具体部分,因为它没有给我一条错误消息,它只是显示了一个404页面,在Firefox中它说它没有正确重定向
有人能帮我一下吗
谢谢大家!
一些补充资料:
我发现这条线断了,它是:
wp_redirect( 'https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] );
回显
$\u服务器['HTTP\u HOST']
和$\u服务器['REQUEST\u URI']
会得到预期的结果(www.domain.com/blog)。但是它就是不起作用:(我过去也遇到过类似的问题。但它通常涉及到一个新的插件安装……以下几点:
你已经删除了Cookie?可能是Cookie损坏了。你至少可以在那里尝试一下。我已经清除了所有Cookie,仍然没有管理页面=(这一行正在中断:wp_redirect('https://'。$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']);它在重定向时中断,我甚至尝试通过执行标头手动重定向(“位置:https://”.$\u服务器['HTTP\u主机].$\u服务器['REQUEST\u URI']。”);但是这也会产生同样的问题,RAM不可能是问题所在。我确信这一点,并且现在不能逐个删除插件,我想我现在将其恢复到旧版本:(