Joomla! logo

Joomla! logo

Recently, I've experienced a whole load of problems related to Joomla.

To vent some frustration, I'm gonna post some general info and experiences, useful to troubleshoot possible joomla problems, especially when it comes to issues affecting your ability to login to your administrator's backend (I know how it feels, just free your mind: computers are just numbers and circuits).

This post wouldn't exist without the suggestions and feedback received from the official joomla! forum and the official joomla! italian community (thanks - you know who you are).

See http://forum.joomla.it/index.php/topic,56790.0.html and http://forum.joomla.org/viewtopic.php?f=431&t=262426 for my sources of inspiration.

PLEASE TELL ME HOW TO FIX IT!

The first thing I feel to suggest you is to open and check the content of your configuration.php and .htaccess files on your site's root.

  • It is important for configuration.php not to contain any blank lines.
  • Also - Check configuration.php in respect to the Linux/UNIX text file conventions.

On Windows, text file "lines" are terminated with a "CRLF" while on Linux/UNIX, those text file lines are terminated with just a "LF" (for a tutorial on what that means, check here: http://usertools.plus.net/tutorials/id/22).

  • The .htaccess file may contain blank lines.
    Just make sure that, if any blank lines are found within the .htaccess file, they follow the 'foretold Linux/UNIX text file conventions (as said, Linux lines have to be ended by LFs), so please ensure there are no hidden CRLF (ie. after the rules declarations).
  • (Once you're on the .htaccess file): check and make sure the .htaccess file rules are correct (re-read them and search until they "start making sense").
    In case of doubt, you may restore the original htaccess.txt from a vanilla (original, untouched) Joomla! build.

From my personal experience, those checks helped me solve my "admin loop, cannot login problem".

An obvious way to avoid this messy "CRLF vs LF" kind of problems is to become a "Linux power user" - If you were working on your Joomla! site while on Ubuntu, the above problems wouldn't have occurred in the first place (admittedly, I was mucking around my Joomla! site with my "powerful" Vista64(!) gaming rig).

But I am digressing - you might as well just use a nerdy text editor such as gVIM on your Windows PC.

Uhm..not fixed yet?!

Another useful thing to check is to make sure you have the right PHP version, so:

  • Ensure your host is serving you at least PHP 5 (since Joomla! was created with PHP 5).

How do you find out if you have PHP5 (if you can't even access the admin backend)?

Well:

  1. One way could be to upload to your site's root the uncompressed file JTSPOST (obtainable from: http://joomlacode.org/gf/project/jts/frs/), [UPDATE-2017] "fpa-en.php" (aka "Forum Post Assistant" - get it from https://forum.joomla.org/viewtopic.php?f=432&t=586336).
    1. Download, uncompress & upload "fpa-en.php" to your site's root.
    2. Browse to the corresponding address of the uploaded file's name (ie. www.yoursite.com/fpa-en.php).
      Once you browse to "fpa-en.php", you'll get some useful info about Joomla! and your hosting web server features, including what PHP version your web server is running.
    3. If you happen to fix your issue, please remember to remove JTSPOST "fpa-en.php" (the Forum Post Assistant) from your www server's root - if you forget it there, you may disclose potential security information.
  2. Another way to find out what PHP version your host is running is through cPanel or some other web hosting console - just login to your hosting console and I guess you'll be able to find your PHP version there.
  3. Ultimately, you may ask to your hosting provider - find a way to get in touch with them and ask!

Once you've clarified what stuff is running on your web server, you may then check the Joomla! official forums, and possibly refer to them for other specific problems and related suggestions.

A personal experience.

For the sake of completeness, I will now report my forum experiences below (note that I edited some parts for additional clarity):

Suggestion n.1)

  1. edited the file administrator/components/com_login/admin.login.php to comment out line 69 (//LoginController::display() )
  2. browsed to the login page.
  3. [tried to login] and got an 'Invalid token' message.
  4. Reedited the [administrator/components/com_login/]admin.login.php file to remove my comment at line 69.
  5. Refreshed the login page in my browser and got the normal login form.
  6. Logged in [successfully].

Try this and if it doesn't work, then:

Suggestion n.2) [user inoxfire]

  1. edit file administrator/components/com_login/admin.login.php [to comment out line 57, // JRequest::checkToken('request') or jexit( 'Invalid Token' );]
  2. browsed to the login page.
  3. [tried to login] and got an 'Invalid token' message.
  4. Reedited the [administrator/components/com_login/]admin.login.php file to remove my comment at line 57.
  5. Refreshed the login page in my browser and got the normal login form.

Try this and if it doesn't work, then:

Suggestion n.3)

  1. Log into phpMyAdmin and navigate to the jos_plugins table.
  2. Look for the "User - Joomla!".
  3. Ensure that it is published as mine was not (set published to 1 just in case).
  4. [Look for] in row "Authentication - Joomla"
  5. Ensure that it is published as mine was not (set published to 1 just in case).

Try this and if it doesn't work, then:

Suggestion n.4)
  1. first check your Super Admin status:
    [Open PHPmyAdmin] in the "jos_users" table set SuperAdmin to:
    - field "id" - value "62"
    - field "gid" - value "25" or "26".
  2. in the "jos_core_acl_aro" table find row for "62":
    - field "id" - write this down (should be 10 normally) - this is the "aro_id".
  3. in the "jos_core_acl_groups_aro_map" table find row for "aro_id" = 10
    - "group_id" should be "25" or "26".
[UPDATE-2016] Above Suggestions applicable to 1.5.X releases of Joomla, untested on Newer 2.5.X+ or 3.X releases of Joomla.

BONUS:

If for some reason you now need to reset your Joomla! admin password straight from the database, you may do so by proceeding as follows:

  1. Open PHPmyAdmin.
  2. Access your joomla DB and goto table jos_users (or "_users" more recently).
  3. Modify the "admin"-row and set its password code to this string of numbers: 21232f297a57a5a743894a0e4a801fc3 (copy-paste as-is, this string of numbers is the equivalent "hashed" version of password = 'admin').
    (On Newer 2.5.X+ or 3.X Joomla, the new "password = admin" string is 433903e0a9d6a712e00251e44d29bf87:UJ0b9J5fufL3FKfCc0TLsYJBh2PFULvT).
  4. After successfully logging-in, make sure you change (update) your "admin" password (otherwise if you leave your password as "admin", your site might get hacked!).

(for further explanations of the above hack, please also refer to this post over here: http://forum.joomla.org/viewtopic.php?t=10985 and, more recently, also here: https://docs.joomla.org/How_do_you_recover_or_reset_your_admin_password%3F).

Hope above info is useful to everyone, and wish you enjoy your "adrenaline kick" after fixing this issue.

[UPDATE 2012] Now that comments are closed, if the above info helped you in any way, please support this website's hosting costs by clicking on the ads.

4/5 - (3 votes)

123 comments on “[SOLVED]Cannot login to Joomla backend as admin

  • hello, thx alot for your usefull information, i got trouble with my joomla. cannot access administrator backend, after i read your article. i have finish my problem.

    thx b4

  • @nikola66: Try to reupload the configuration.php and .htaccess from ubuntu with gftp (download a new joomla from official, uncompress, then upload 'foretold files from there or from another linux-like os).
    Also remember to never delete anything and always use rename, in such a way that you can jump back!
    Pay for quality hosting and make sure they provide you phpmyadmin access.
    Pay attention with gmail and openid auth; I have them disabled and I use only standard joomla auth (it can also be done from phpmyadmin).

    Look, when I experienced those problems, I thought none was working and that I was really screwed.
    Only my stubborness kept me trying and I finally succeeded, so I suggest you try all and everything, then, eventually, post your config somewhere for help.
    Be detailed, check and do things methodically and always start from the beginning, with fresh mind.
    Don't worry, you're gonna fix it up!

  • I did everything here and still nothing. Our server administrator recompiled PHP on the server and this issue started. Is there something else that could be the problem?

  • i finally figured it out!
    i really appreciate all the help everyone offered, i finall \y solved it on my own.
    Problem was:
    didn't set the right database collation BEFORE importing (migrating) my database. Even though the website perfomed correctly but i had the infamous admin loop problem.

    The only sollution is to delete the database, recreate it, SET THE CORRECT COLLATION, and then import it again.

    😉 hope this would help...
    NEO

  • Editing the sql does the trick. I had enabled the ldap plugin which disabled the default login. Setting the plugin "Published value" to 0 (zero), disables it. Just don't forget to re-enable the joomla one.

    Thanx guys!!!

  • I am having a problem logging in to the admin section. I didn;t change anything I know of and all the tips above don't work.

    The problem is that I get no login prompt at all - just get a blank screen and "view source" also shows nothing. I am not getting a login prompt when I go to "administrator/index.php

    Can anyone please help?!

    Marisa

  • Hello!

    I what i managed to do was that i deleted the User - Joomla plugin!

    i don't know what to do, now i am locked out from my joomlasite!

    when i look in the jos_plugins table there is no User - Joomla row, so why not create it? can anyone please help me and tell me what i have to write in my insertion query

    thank you!

  • Actually you could all save yourselves heaps of time if you just go into php.ini and make sure

    session.auto_start = 0

    This function must be disabled or you won't be able to login. If you can't edit php.ini, use a flag in your .htaccess file like this.

    ## disable automatic session start
    ## before autoload was initialized

    php_flag session.auto_start off

    SSH into your server and find your error log and watch it live by doing this command bash# tail -f error_log
    Hit login and you'll see the error is that is generated.

    Check your session folder to see if anything is getting written to it by the web server.

    Guys over at Digital Spyders (http://www.digitalspyders.com) helped me figure this out in a jiffy. I actually moved hosting over to them shortly after. Rock solid, and they don't really advertise they host, so they don't have packed servers like godaddy and they keep current with php which is awesome.

  • while my specific problem was not addressed the information provided on alerted me to enable a (accidentally) disabled login/authentication module via the database. thanks.

  • Thank you very much for your article! Suggestion 3 works for me. I was about to get profession help for my website. But I have yet to find any help for my VirtueMart, have posted my problem there but no one reply. My product detail page is not showing. It has the error like - The requested URL is not found on the server. Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

    If you do know of how to resolve it, hope you can help me.

  • Hi. Thanks so much.
    For some reason after never logon to the web for several months, I cannot logon as admin anymore. Resetting the password works.
    Thanks again.

  • Hi, great article!

    After trying A LOT of things, thanks to your Suggestion n.4 I saw that the data in my jos_core_acl_aro and jos_core_acl_groups_aro_map wasn't matching. I simply used a working site's tables to correct this and voila! Everything's back to normal!

    Thank you very much!

  • Thank you, Thank you, Thank you

    Solution 3 worked for me and have no idea how the setting changed. I had been working in the site for about an hour, left for a bit and could no longer get in when I got back. It is possible that I changed something in the module manager, but I am now not sure.

    I searched for several hours before finding this page with much frustration setting in.

    Thanks to you, I am once again (reasonably) sane.

  • In my case: setting "Session Lifetime" to a huge number like "999999999999" caused login loop immediatly. The solution is to open configuration.php and edit $lifetime back to a smaller number like "60".

    IMHO, Joomla should have document the maximum number allowed, or put in a limit there.

  • OK, I found what fixes my problem:

    Site / Global Configuration / Force SSL / Entire Site

    It causes problems with the HTML function in TinyMCE. It may have other strange side effects. But at least I can Save, Apply, and Cancel now without getting thrown out of the back end.

    Joomla 1.5.15
    linux server (Fedora 9)

    No problems with 1.5.14 that I noticed. As explained in the article linked to in my first comment, we've had to change security settings on httpd and SSL; that may be a contributing factor in this case.

    Thanks again for a great article!

  • Bloody brilliant. Suggestion #3 worked for me. Still not sure why there was a problem in the first place but at least I am in business once again. Again many thanks for sharing.

  • Thank you very much!  Suggestion no.3 worked for me.
    P.S. This Joomla thing becomes to drive me crazy! I'm working with it from ten  days by now, seems to be pretty easy,  but I spend a lot of time with a lot of undocumented minor things that take a time to solve them.I am a programmer, but I have no intention to learn php, I only want to make use of joomla to build my own site. I have read the documentation and a book about Joomla before, so everything seems to be pretty clear). Yesterday morning I've found aIl my HTML code stripped out from articles, so I had to install "sourcerer" to prevent this (after I decimated completely another 3 pages from all other formatting,made with JCE by setting some filters in the Article manager);  yesterday I found that every page has the category written on it , so I've uninstalled all the plug-ins that seemed to me as being unnecessary; in the meantime I've  made a "yum upgrade" to the system. In this morning I could not log in, and it has taken 3 hours to fix this (thank you again) . What will be happen tomorrow ?
    Thank you again.

  • no. 3 (almost) worked for me.  The access field was set to "1" so I ran the following to flip it back to a "0" and was able to login.
     
    UPDATE `jos_plugins` SET `access` =  '0' WHERE `name` = "User - Joomla!";

  • None of these worked for me. Seemingly all of my table settings are correct for login except that when you try to log in as anything it registers a guest session in the jos_sessions table rather than an admin or registered user session. Also on the front page of my site I had a button which would bring up the login fields but after this problem showed up the login fields will not appear when clicked.

  • None of these worked for me but I tried on a different browser, it was working.
     
    When I was using google chrome, I couldn't login. When I used firefox, it was ok.

  • if you can't log in and it only gets refreshed only then use the suggestion no 3.
    it works
     
    Suggestion n.3)

    Log into phpMyAdmin and navigate to the <strong>jos_plugins</strong> table.
    Look for the &quot;<em>User &ndash; Joomla!</em>&quot;.
    Ensure that it is published as mine was not (set published to&nbsp;1 just in case).
    [Look for] in row &quot;Authentication &ndash; Joomla&quot;
    Ensure that it is published as mine was not (set published to 1&nbsp;just in case).
    

     
    how to publish it is like this
    change the number '0' to '1'

  • Thanks Mine is solved now.
    Suggestion n.3)

    Look for the "User – Joomla!".

    I remember that I was disable this before my last logout from administrator

  • After searching numerous days, I found this page.

    Nothing mentioned was enough to fix my problem, but the hint to upload configuration.php and .htaccess helped me.

    I'm not sure but maybe I saved my configuration.php under Windows.

    So I found an SPECIAL HIDDEN CHARACTER at the beginning of my configuration by comparing my file with an original configuration.php.

    I could solve it by creating a new file in vi and copying the content of my old configuration.

    After uploading the login to my restored site on the new server was possible again.

  • i have installed the joomla on localhost.
    im unable to login to admin area. it refreshes with out any error. 🙁
     
    i applied above solutions. did not work me :(.
    please help me.
    regards,
     

  • Thank you!!!!!!!! step 3 worked for me, i was terrified that i broke my site and would have to reinstall everything. Thank you soooo much.!!

Comments are closed.