[SOLVED]Cannot login to Joomla backend as admin
February 11th, 2009 by amatesiRecently I encountered a whole load of problems related to Joomla and my new business open source web site.
Here I’m gonna post some general info and experiences, useful to troubleshoot possible joomla problems, especially related to when you’re unable to login to the administrator backend (I know how it feels, just free your mind: computers are numbers and circuits).
What I am sharing here is my reaction to frustration, with suggestions and feedback received from the official joomla! forum and the official joomla! italian community (thanks – you know who you are).
please check here: http://forum.joomla.it/index.php/topic,56790.0.html and
and here: http://forum.joomla.org/viewtopic.php?f=431&t=262426
The first thing I feel to suggest you is to check configuration.php and .htaccess files on you site’s root.
It’s important for configuration.php not to contain any blank lines; also, check this file in respect to the Linux/UNIX text file conventions. On Windows, text file lines’ are terminated with a CRLF, on Linux/UNIX instead, the lines of a text file are terminated with just a LF (for a tutorial on what that means, check here: http://usertools.plus.net/tutorials/id/22).
The .htaccess (on the contrary of configuration.php), may contain blank lines, just make sure that, if any, they respect the ‘foretold Linux/UNIX text file conventions (lines have to be ended by LFs); also, check and make sure the rules are correct and there are no hidden CRLF after the rules declarations (in case of doubt, restore the original htaccess.txt from an untouched joomla! build).
From my experience, those checks helped me solve my admin loop, cannot login problems; an obvious way to avoid this kind of problems is to become a power user on the Linux side (aka pwrusr), but that’s a personal choice! If working directly on your joomla! site with, say, Ubuntu, these problems would’nt have ever happened to any of us (I admit it: I was jerking on my site with my powerful Vista64 gaming rig).
Another useful thing to check for, is to make sure you have the right PHP version: make sure your host is serving you with PHP 5 (since joomla was made with it). How to discover if you have PHP5 if you can’t access the admin backend? Well, upload on your site’s root the uncompressed file JTSPOST (here: http://joomlacode.org/gf/project/jts/frs/), and open the address corresponding to the copied file’s name. Once you open it up, it’s gonna give you some useful info about joomla! and your server, included what php version you have.
Please remeber that if you happen to fix your problem, then remove JTSPOST from your server’s root, because if you forgive it there, you may leave a possible information security hole.
OK, so, going on, as I said, I checked the joomla! official forums, and referred to them for other possible problems and related suggestions, wich I will report here for the sake of completeness (note that I edited some parts for some added clarity):
Suggestion n.1)
- edited the file administrator/components/com_login/admin.login.php to comment out line 69 (//LoginController::display() )
- browsed to the login page.
- [tried to login] and got an ‘Invalid token‘ message.
- Reedited the [administrator/components/com_login/]admin.login.php file to remove my comment at line 69.
- Refreshed the login page in my browser and got the normal login form.
- Logged in [successfully].
try this and if it doesn’t work, then:
Suggestion n.2) [user inoxfire]
- edit file administrator/components/com_login/admin.login.php [to comment out line 57, // JRequest::checkToken('request') or jexit( 'Invalid Token' );]
- browsed to the login page.
- [tried to login] and got an ‘Invalid token‘ message.
- Reedited the [administrator/components/com_login/]admin.login.php file to remove my comment at line 57.
- 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)
- Log into phpMyAdmin and navigate to the jos_plugins table.
- Look for the "User – Joomla!".
- Ensure that it is published as mine was not (set published to 1 just in case).
- [Look for] in row "Authentication – Joomla"
- 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:
- 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". - 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". - in the "jos_core_acl_groups_aro_map" table find row for "aro_id" = 10
– "group_id" should be "25" or "26".
BONUS:
If, for some reasons, you need to reset your joomla! admin password, or if you need to offer admin access to somebody else, or for whatever the reason, please change it by doing so:
- Open PHPmyAdmin.
- access your joomla DB and goto table jos_users.
- modify "admin"-row and set it’s password code to this: 21232f297a57a5a743894a0e4a801fc3 (it’s the equivalent of ‘admin‘).
(for more info and explanations, check this post over here: http://forum.joomla.org/viewtopic.php?t=10985).
Hope this info is useful for everyone, and wish you all have a good time.
Posted in Joomla, Web Master | 118 Comments »
Thank mate, finaly some easy to follow advice, your a lifesaver.
hahah man the last part was the sol to my prob. was stucked badly for 2 hours !!!
yep, last part solved the problem. 10x man you are great!
I had unpublished the "User – Joomla" plugin. It took me long time to understand what is wrong :D :D
Thank you for the advice!
Thank you very much ! it was very helpful
thank you very much, it was very helpful
Hi mate,
Tried everything suggested. Nothing worked.
I even did 777 on all files and dirs. Nothing. Still same admin login loop… pls heeeelllp.
I have one last tip that may or may not help those who are stuck with the login problem. For years, I've had to log in twice to one of my Joomla sites. I tried from time to time to figure out why, but failed to do so. I always had two versions of myself logged in to the back end. Other people started having trouble with IE (I use Firefox). While searching about their problems, I came across a post that said something about the config livesite variable in configuration.php. It was set to "www.nsrca.us." But something else in the system or in Joomla was returning URLs without the "www." When I set the livesite variable to "nsrca.us", things started working better.
var $live_site = 'http://nsrca.us';
I no longer have to log in twice. What was happening was that I was getting a cookie for "www.nsrca.us," but then the system was generating URLs for the back end without the "www." When my browser was checked for an "nsrca.us" cookie, it was not found–even though one had been issued for "www.nsrca.us." When I logged in the second time, I got the cookie for "nsrca.us" and it started to work with the shorter URLs.
I don't know why I never noticed the change from the long version to the short version in the address bar. It feels great to have gotten it straightened out.
Youre my hero! suggestion n.3) works for me. Thank you very much!
Nothing works for me. Joomla 1.5.21, PHP 5.2, MySQL 5. Still looping madly after 5 days on the problem. Wonder if Joomla is what i need, now…
a. karelsky,
I have the same problem installing Joomla 1.5.21 over Apache 1.3, PHP 5.0.5, MySQL 5.0.15. I Solved it going back to Joomla 1.5.15, but I’m still analizing why 1.5.21 failed.
million of thanks… i just tried the last solution… it worked..
Regards
The Suggestion n.3 work for me!
Thank you so much, really!
Although you published this in Feb 2009 it still helped me. Thank you for taking the time I really appreciate it.
My solution was found in suggestion 3.
:)
I have try all possible fixes and Still not login in!!!!
could it be because I'm working on a subdomain??
Please somebody help… I can't login!!!!
Regards…… OddO
You saved my life. Solution 3 worked and I am back in business
thanks you very much, it was very helpful… thanks
As suggested, I've added a live site (http://mysite.com) in configuration file like this
var $live_site = 'http://xxxxx.com';
Was like this before
var $live_site = ' ';
And WORKED!!!
Last time I had the same problem and solved changing my admin password in the database bat it worked only for couple days. Hopefully this solution will last.
Thanks a lot
I had a similar problem but mine was resolved when I set the session handler back to database (had it set to memory) in the configuration.php file
var $session_handler = 'database';
@Kevin, yup this one works! Thanks… sharing this…
Thank you very much
That was very helpfull for me. I fixed my login problem successfull
Merci beaucoup
Serge Gagnon
[...] [...]
Thanks. Suggestion n. 3 fixed it.
Hey there, i've tried ALL of the above and MORE i still cannot login to backend…some important data: I've installed VirtueMart component so i was able to add custom registration fields … and i switched login to vm_login_module -> now i cannot login to admin backend and i as admin cannot log into frontend and any other users cann' login also…i've managed to publish OLD-ORIGINAL login module from phpMyAdmin..but still no luck…any suggestions as i really wouldn't wanna do all work from scratch :( …
warm regards,
Jan
Great help from a guy who is a real bomb. Well written for novices and dudes with a small mind. No. 3 worked for me
Your a genius. Easy to follow instructions. Good for a dumby like me. Number 3 fixed it for me. Thankyou.
Hi;
I followed all your 1-4 steps including BONUS but i am still not been able to login on joomla administration panel. I spend many days for this. I wonder if you have any more solution for this.
Looking forward to hear from you.
Thank You
Ujjwal
Thanks a lot. I spent many many hours trying to get back my password again to access back end… unsuccessfully but…. You gave me tha KEY: Just turning the password to ADMIN !!!!!! And I solved it !!!! Thanks very much.. I would like to invite yo to drink and taste these wines I am working on .. T h a n k s
Thanks man, suggestion 4 worked for me
I tried every single solution, but still couldn't get to work. Apparently Joomla logs me in, but after the redirect to index.php it somehow forgets my previous session and creates a new one, sees that i'm not logged in and prompts me for username/password again. You can confirm that by looking into table jos_session (if your session management is set to "Database") and crosscheck the session_id with your browser cookies. After each login you see your previous session logged in as administrator, however there is no matching cookie in your browser anymore.
Here is an ugly hack that fixes the problem:
- open administrator/components/com_login/admin.login.php
- find $mainframe->redirect('index.php'); (around line 69), and replace it with /* $mainframe->redirect('index.php'); */ to comment it out
- insert the following line above the previous $mainframe->redirect():
die('<html><head><meta http-equiv="refresh" content="0;URL=http://www.mydomain.com/administrator/"></head><body></body></html>');
(replace with your domainname)
Save the file and try to login again.
Hope this helps…
Thanks a lot … suggestion 3 works for me
I tried everying and struggling with this for many days now and still not able to login my backend.
The consecuences are the same but seems the cause is different as I can't check any jos_plugins table in my DB! It has been deleted somehow. Thus I can't modify any 'Users – Joomla' nor ' Users – Authentication' entries, or whatsoever.
Modifying the administrator/components/com_login/admin.login.php
Normal
0
21
false
false
false
ES
X-NONE
X-NONE
/* Style Definitions */
table.MsoNormalTable
{mso-style-name:”Tabla normal”;
mso-tstyle-rowband-size:0;
mso-tstyle-colband-size:0;
mso-style-noshow:yes;
mso-style-priority:99;
mso-style-parent:”";
mso-padding-alt:0cm 5.4pt 0cm 5.4pt;
mso-para-margin:0cm;
mso-para-margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:10.0pt;
font-family:”Times New Roman”,”serif”;
mso-fareast-language:EN-US;}
is also not an option this file does not exist in my configuration. Instead I have login.php only. Something to do with version 1.6 maybe???
Please any ideas of how I can restore jos_plugins table? or other workaround that could let me into my backend again.
Any help is welcomed.
Thanks!!
Sorry, something went wrong the my last message. :(
Big Up to Kevin
I had a similar problem but mine was resolved when I set the session handler back to database (had it set to memory) in the configuration.php file
var $session_handler = 'database';
You is the man
New version of the problem today.
Upgraded Joomla 1.15.18 to 1.15.23 using the patch.
I was already logged into the back end at the time. I just refreshed the page and the version number changed. Everything looked good to me.
Couldn't log in today.
Tried all of the fixes above.
Tried many other approaches. Hint: jos_core_acl_aro_map apparently has been replaced by jos_core_acl_groups_aro_map, so the fact that jos_core_acl_aro_map is empty is irrelevant. Don't waste time like I did trying to figure out how to repopulate it!
What seems to have worked is changing var $force_ssl = '1'; to var $force_ssl = '0'; in configuration.php.
I had whole evening to debug the site. I can't login to backend system sometime. If I put incorrect password, an error message will be show. But if I put correct password, nothing show, and the page just postback. After whole evening debug, I found it causes by incorrectly passes user data after logged in. This problem occurs on my hosting, but never on my localhost using xampp, I don't know why.
To make sure if this fixes your case, try open file: /libraries/joomla/plugin/helper.php, insert follow line to line 176 (above the line 177 below if you can't find):
Back to admin login page, try login with correct username and password. If the follow page show that no username or userid, so we have same problem.
Delete the above line (176) then change the line 177:
To following line:
Then save, upload and try login again.
Hope this will help somebody has same problem with me.
This fix is not perfect, it might causes some security problem with plugins.
Btw, in my case, I tried all above solution without luck. And my jos_session table won't have any records contain userid or username… just session time, session id and the last field. So, if you have the same problem, and no solutions works, hope the above post (comment) would bring you luck :P
Suggestion n.3 Solved my problem, Thank you very much
Apart from setting line termination to LF it is also very important to make sure that the configuration.php file is encoded in UTF-8 without BOM
Following steps for tip #4 :
in the "jos_core_acl_groups_aro_map" table find row for "aro_id" = 10
– "group_id" should be "25" or "26".
I have no "aro_id" = 10
and all the group id's that are there are all "18"? Could this be my issue and if so how do I fix this table…? TY
BONUS: is solved my problem
thanks
Solution FOUND! REMOVE JOOMLA
its a hackers best friend, dont use it
your info just saved me a lot of time! my User – Joomla! module had been disabled and just setting it to enabled in the sql works thanks!!!
Excellent, thanks for the help :)
I had this problem and delete and create the table and joomla works… but, i could n’t login on back and front end…
Review a lots of forums and post… and i could n’t login…
Then i check the table jos_session and 2 fields were in UPPERCASE, i mean, TIME and DATA fields from this table must be on lowercase…
i change this two fields to lower (time, data) and i could login on all my joomla…
thats was my solution.
Listen up, after about a week and a half I finally was able to log into my admin page to the back-end. I am so happy that I thought I would let others know what I finally did, that it just might help.
The problem I realized was that Joomla was not authenticating the username and password. Most sites took us through all types of coding, etc.
Here was my method finally:
1. In your browser point your browser to http://www.randobakery.com/arandos.sql.
2. This is a listing of the default structure of Joomla. I used it on my 1.5.23 version.
3. Log into your cpanel and fo to your mysql and select the database having the problem with admin login.
4. Scroll down the beginning of the acl's.
5. Print out the Joomla structure. it will help if you can double-side print.
6. Once the printing is done, find the section that has the core_acl_aro.
7. In your mysql select to show the browse of the core_acl_aro, or to select structure, if you have these capabilities, which you should.
8. Begin comparing the default values on the structure you printed out with the actual structure in your core_acl_aro and make changes where necessary to get the default values.
9. Do this with each of the core_acl_aro_groups, and the core_acl_aro_map.
10. Once you are certain you now have your acl's setup with defaults, close the browser. Assuming you are certain that your admin username and password are correct, open your browser and attempt to login.
I hope this works for you as it worked for me.
Additional information.
I had Joomla generate a new admin password for me by going to the Front-End and logging in as a new user.
Then I went into mysql and selected my database and scrolled down to xxx_users. XXX is whatever precedes your '_users'.
I searched for the new user and copied the newly generated password into my Super Administrator password field, and then deleted the new user.
Now you will have a password you know will work.
What I have found out after doing a lot of searching on the Internet on how to generate the MD5+salt ':' salt, I searched through every file in my database (new to Joomla), and I found that Joomla has a preset $Salt value, and this is why most of these other generators out there won't work. There salted values are different than the preset salted value in your Joomla, so generating the password on in your Joomla through the Front-end will ensure the password will be correct.
I forgot something that is very important.
When you are down to checking the core_acl_aro_map you finally see the values: 25 '' 10. That is: 25 blank 10.
Scroll down the core_acl_aro_map list until you get to the Administrator row. The values that should be there are: 25 blank 10.
Blank stands for skipping a column before inserting the value 10.
Thank you so much for your detailed efforts in solving this problem. I've been reading for 3 hours trying to find a suggestion that worked and finally got one from your page. Suggestion #3 ! Had a 0 instead of 1 on published for user – joomla! Thanks again. :)
total life saver you're a star, many, many thanks :)