WordPress.org

Support

Support » Installation » Upgrade to 2.7; Login reloads login page

Upgrade to 2.7; Login reloads login page

  • Hi,

    @wp Administration folks! Please help!

    The following two posts are very similar to the issue I’m experiencing but there seems to be no resolve, so I figured I’d open a new post with more details, to get the attention of someone who could possibly fix the problem, as I’m without a very important blog 4 days counting;

    http://wordpress.org/support/topic/226559 (post by: Digg50)
    http://wordpress.org/support/topic/224318 (post by: guioconnor)

    My setup:

    Hosted by 1and1.co.uk, using MySQL5.0, upgrading from 2.6.5 ==> 2.7

    Problem:

    After upgrading from 2.6.5 ==> 2.7 successfully which is what it WP told me, I’m left with a login page that reloads each time I enter the correct username and password. And gives me error messages when enter incorrect username or password.

    I go to http://www.xxx.com/wp-admin (or wp-login), enter my login credentials and the page reloads with the following url now:

    http://www.xxx.com/wp-login.php?redirect_to=http%3A%2F%2Fwww.xxx.com%2Fwp-admin%2F

    And as I mentioned I get the same login page, no errors, nothing.

    What I have tried before this post:

    I’ve almost reached the end of going through every single post related to the similar issues with no luck and kind of lost as to where I go from here. In summary I’ve done the following;

    Clearing cache, cookies, disabling firewall, different computers, different browsers, removing my plugins folder and replacing it with just a empty plugins folder, and updating and making sure my config files are correct and checking my DB urls as this site explains http://www.tamba2.org.uk/wordpress/site-url/ all with no luck.

    I don’t know to much about cookies but guessing that its related to this, but don’t know how to fix it; using the Firefox Web Developer Toolbar, I found the following results if these are any use to anyone who may be able to resolve this problem;

    The authentication cookie is being set in the response after sending the initial login request which appears to work, but is not being sent back in the subsequent request.

    I tried setting the cookies manually (the ones provided in the response header) using web developer toolbar and reloading the admin page. Doing this gave me the ‘Please log in again.’ message which we had not been previously seeing, but had been posted about in the WP forum.

    Can anyone help knowing this information? WP folks, please chime in as I have been through a lot of forum posts and not had much luck.

    Thanks all.

Viewing 15 replies - 1 through 15 (of 34 total)
  • Do some tests and see if the variable ABSPATH is being defined correctly.

    echo ABSPATH;

    In particular, add that in /wp-admin/admin.php before the call to /wp-admin/includes/admin.php . If ABSPATH is NOT defined before the call to /wp-admin/includes/admin.php, your dashboard will not load.

    Here is the code from admin.php:

    define(‘WP_ADMIN’, TRUE);

    if ( defined(‘ABSPATH’) )
    require_once(ABSPATH . ‘wp-load.php’);
    else
    require_once(‘../wp-load.php’);

    if ( get_option(‘db_version’) != $wp_db_version ) {
    wp_redirect(admin_url(‘upgrade.php?_wp_http_referer=’ . urlencode(stripslashes($_SERVER[‘REQUEST_URI’]))));
    exit;
    }

    require_once(ABSPATH . ‘wp-admin/includes/admin.php’);

    I’m not a programmer and don’t understand any of the code. I tried adding “echo ABSPATH;” before the last line of code and my login still failed. Any other ideas?

    Niteblade – Digg50 here I tried adding echo ABSPATH I think as you suggested, like this:

    In WordPress Administration Panels
    *
    * @since unknown
    */
    define(‘WP_ADMIN’, TRUE);

    if ( defined(‘ABSPATH’) )
    require_once(ABSPATH . ‘wp-load.php’);
    else
    require_once(‘../wp-load.php’);

    if ( get_option(‘db_version’) != $wp_db_version ) {
    wp_redirect(admin_url(‘upgrade.php?_wp_http_referer=’ . urlencode(stripslashes($_SERVER[‘REQUEST_URI’]))));
    exit;
    }
    echo ABSPATH;
    require_once(ABSPATH . ‘wp-admin/includes/admin.php’);

    auth_redirect();

    But it didn’t do it.
    Did i get this in the right spot? Of course another noncoder here 🙁

    I also cleared out my cookies but no avail.

    The command echo ABSPATH; returns the value of the variable ABSPATH if it has been specified.

    if ( defined('ABSPATH') )
    require_once(ABSPATH . 'wp-load.php');
    else
    require_once('../wp-load.php');

    Look at this code here. What it’s saying is, “If the variable ABSPATH is defined, then load the file wp-load.php using the information in ABSPATH. Else, if ABSPATH is NOT defined, then we can’t rely on the information in the variable and must load wp-load.php — which must be one directly level below our current location.

    if ( defined('ABSPATH') )
    	require_once(ABSPATH . 'wp-load.php');
    else
    	require_once('../wp-load.php');
    
    if ( get_option('db_version') != $wp_db_version ) {
    	wp_redirect(admin_url('upgrade.php?_wp_http_referer=' . urlencode(stripslashes($_SERVER['REQUEST_URI']))));
    	exit;
    }
    
    require_once(ABSPATH . 'wp-admin/includes/admin.php');

    In other words, if ABSPATH still has no value AFTER the file wp-load.php has been required, then the dashboard will not load because require_once(ABSPATH . 'wp-admin/includes/admin.php'); begins the dashboard loading process.

    Niteblade,

    I tried what you’re doing, In /wp-admin/admin.php I put;

    if ( defined(‘ABSPATH’) )
    require_once(ABSPATH . ‘wp-load.php’);
    else
    require_once(‘../wp-load.php’);

    if ( get_option(‘db_version’) != $wp_db_version ) {
    wp_redirect(admin_url(‘upgrade.php?_wp_http_referer=’ . urlencode(stripslashes($_SERVER[‘REQUEST_URI’]))));
    exit;
    }

    before the call to /wp-admin/includes/admin.php

    but it didn’t do it.

    Is it working for you after doing that?

    This isn’t so much a “fix” to get it working, it is to identify a possible reason why it is not working. I’m hypothesizing that the variable ABSPATH is not getting defined.

    Take a look at the following code in /wp-admin/admin.php:

    if ( defined('ABSPATH') )
    	require_once(ABSPATH . 'wp-load.php');
    else
    	require_once('../wp-load.php');
    
    if ( get_option('db_version') != $wp_db_version ) {
    	wp_redirect(admin_url('upgrade.php?_wp_http_referer=' . urlencode(stripslashes($_SERVER['REQUEST_URI']))));
    	exit;
    }
    
    Then add the following for diagnostic reasons:

    if ( defined(‘ABSPATH’) )
    require_once(ABSPATH . ‘wp-load.php’);
    else
    require_once(‘../wp-load.php’);

    if ( get_option(‘db_version’) != $wp_db_version ) {
    wp_redirect(admin_url(‘upgrade.php?_wp_http_referer=’ . urlencode(stripslashes($_SERVER[‘REQUEST_URI’]))));
    exit;
    }

    if (defined(‘ABSPATH’)) {
    echo ‘The ABSPATH variable is defined in /wp-admin/admin.php.
    ‘;
    echo ABSPATH;
    }
    else {
    echo ‘The ABSPATH variable is NOT defined in /wp-admin/admin.php
    ‘;
    }

    require_once(ABSPATH . ‘wp-admin/includes/admin.php’);`

    Since the value of ABSPATH is critical to load /wp-admin/includes/admin.php, if the ABSPATH variable has not been defined at this point, then by necessity, /wp-admin/includes/admin.php will fail to load.

    Basically, put the following code at the top of the important files that reference the ABSPATH variable to determine whether or not ABSPATH has been defined:

    if (defined('ABSPATH')) {
    echo 'The ABSPATH variable is defined in /wp-admin/xxxx.php. It is --> ';
    echo ABSPATH;
    echo '<br />';
    }
    else {
    echo 'The ABSPATH variable is <strong>NOT</strong> defined in /wp-admin/xxxx.php<br />';

    }`

    In the above code, you’ll notice that I have 4 x’s … xxxx.php. If you’re testing out index.php, then change “xxxx” to “index”. If you’re testing out “dashboard.php”, change “xxxx” to dashboard. In this manner, you’ll see some type of screen output that will let you know which file is failing to get the value of ABSPATH.

    Sorry. I wish I had the ability to edit my posts, or at least preview them before I “post” them.

    The most important part to take away from my last post is the following code:

    if (defined('ABSPATH')) {
    echo 'The ABSPATH variable is defined in /wp-admin/xxxx.php. It is --> ';
    echo ABSPATH;
    echo '<br />';
    }
    
    else {
    echo 'The ABSPATH variable is <strong>NOT</strong> defined in /wp-admin/xxxx.php<br />';
    }

    I am having the same trouble as the original poster. This is quite frustrating to not be able to login to the admin panel. Any word from WP support on this problem yet?

    I finally got a fix on my problem.

    Mine was a new install into a sub-directory and then I couldn’t log-in the same as everybody above.

    What i did, I got the new URL pointed at the right sub-directory without any redirects in place.

    Then I went into cPanel/file manager to the functions.php file located at here wp-content/themes/default/functions.php

    Then Edit this file at the very top of the functions.php file on the next line after the <?php
    add these two pieces of code:

    update_option(‘siteurl’,’http://your-new-domain.com/’);
    update_option(‘home’,’http://your-new-domain.com/’);

    Then go and log-in to the blog admin a couple times.
    like at the new address: /wp-login.php

    Then go and remove the two pieces of code listed above from the functions.php file .

    This was just for a new wp-install but I’ve done this on a couple that i was having the same trouble as above and that fixed it.

    Cheers

    @digg50 – Then I’m guessing you could accomplish the same thing by these two additions to wp-config.php:

    define('WP_SITEURL', 'http://example.com/wordpress');
    define('WP_HOME', 'http://example.com/wordpress');

    or if WordPress has its own directory:

    define('WP_SITEURL', 'http://example.com/wordpress');
    define('WP_HOME', 'http://example.com');

    Interesting. That sounds like a simple fix. I’ll try it when I get home.

    @digg50: How did you reason through this process to discover your solution?

    Oh! Thank you Digg that bit of code seemed to fix the problem. A million thank yous!

    MichaelH Ya, you could be right. Niteblade, Actually I came across this fix from a link to the Doc area in another post string that about redirecting the sub-directory your wp blog is on so it shows as its own domain. I tried to retrace my steps back there but I couldn’t find that post or the information from Documents.

    I’m glad this helped you retta.

    Cheers

    mine is still not working login just keeps reloading HELLLLPPPPPP

    Hi all,

    Thank you for the reply, nice to see a lot of WP Moderators trying to help ***sarcasm***

    Digg, thanks for your input buddy, I’m trying to follow what you did but either its too late, or I’m so frustrated with this that I’m not thinking properly, either way I need your help as you and rettta719 seem to be the only folks who have this issue fixed.

    You wrote:

    What i did, I got the new URL pointed at the right sub-directory without any redirects in place.

    Q: What new URL?
    Q: What sub-dirctory?
    Q: Where did you do this?
    Q: Did you have to remove the redirects manually?
    Q: You edited the ‘default’ themes function.php file, do edit the function.php file of the theme I’m using?

    I thank you advance for your help!

    Thanks!

Viewing 15 replies - 1 through 15 (of 34 total)
  • The topic ‘Upgrade to 2.7; Login reloads login page’ is closed to new replies.
Skip to toolbar