Can't login to Front Page

Can't login to Front Page

by Steve H. -
Number of replies: 14

Hello,

Every time I try to login to the front page to edit it I still get the text need to login. For some reason it will only let me administer the site is I go to /admin/ if I try to login from the / of the site it just drops me back at the front page. 

 

Thanks.

I am using Moodle 2.3.1

Average of ratings: -
In reply to Steve H.

Re: Can't login to Front Page

by Steve H. -

I tried upgrading to the latest release and it still didn't fix this issue. 

Every single time I login to the /admin/ URL it works and yet every time I login to the front page it always redirects back to the front page and the login display area in the top right of the theme still says to login.

I have included a screen shot. The URL is http://www.ilearnalot.net/ 

I have been all over the roles and settings and everything trying to get this worked out. Everything seems fine other than I can't login via the front page and I can't turn on editing obviously because I am not logged in. 

 

I even tried switching from using the databasea for sessions to the file method and even so much as switching themes no luck no matter what I tried. 

 

Attachment FireShot Screen Capture #008 - I Learn A Lot - www_ilearnalot_net.png
In reply to Steve H.

Re: Can't login to Front Page

by Mary Cooch -
Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Testers Picture of Translators

Hi Steve. I noticed in the Lounge you were saying you weren't happy with the response from Using Moodle so I'm just "upping" your post in an attempt to make it more visible to other contributors. I don't know much about the technical side myself so I can't help but there are plenty of people who can. 

In reply to Steve H.

Re: Can't login to Front Page

by Helen Foster -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators

Hi Steve,

Just wondering whether your problem could be the same as the FAQ "I log in but the login link doesn't change" in Installation FAQ.

Average of ratings: Useful (1)
In reply to Helen Foster

Re: Can't login to Front Page

by Steve H. -

I did a test as mentioned in the FAQ to run http://www.ilearnalot.net/lib/session-test.php

 

and got these results:

session test not reimplemented yet

More information about this error

Debug info: error() is a deprecated function, please call print_error() instead of error()
Error code: notlocalisederrormessage
Stack trace:
  • line 831 of /lib/deprecatedlib.php: moodle_exception thrown
  • line 37 of /lib/session-test.php: call to error()
 Not quite sure what this means. It looks like this test is deprecated.
In reply to Steve H.

Re: Can't login to Front Page

by Helen Foster -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators

Thanks Steve for pointing that out. I don't know why the session test has been removed but I've updated the FAQ so that it no longer mentions it.

In reply to Helen Foster

Re: Can't login to Front Page

by Steve H. -

Hello,

 

I want to say thank you a whole bunch to all that gave me your time and efforts to squash this issue. 

Sad to say none of the advice helped solve the issue, but it did feel nice that someone cared enough to help me come up with ideas to fix this.

I have some extra servers and set one up and ran a test install. After that the test install worked fine as I remember Moodle being in the past. 

So that let me know real quick it was something different in the PHP/Apache setup. Yeah I know really narrows that down doesn't it. 

I kept examining settings and finally I found it. 

The magic bullet for me was to disable php open_basedir protection. Once I did that and tested it things ran fine. 

Now don't get me wrong I could login to the administrator area and change all the settings in the back end and yet when I went to the root directory poof the link that displays name said "login". I just don't get why it would only happen on the front page though. Looks like it would have done that on any part of the site. 

So to recapp for anyone having an issue like this make sure to check that you have php open_basedir protection disabled.

 

Kind regards,

Steve

Average of ratings: Useful (1)
In reply to Steve H.

Re: Can't login to Front Page

by Guillermo Madero -

Hi Steve,

What OS, etc. are you using? I think I would start by checking that you don't have an .htaccess file where you installed Moodle; this could be a redirection (rewrite) issue.

In reply to Guillermo Madero

Re: Can't login to Front Page

by Steve H. -

I checked and there is no .htaccess file there. Should there be?

 

I am using CENTOS 5.8 x86_64

PHP 5.3.15 (cli) (built: Jul 31 2012 08:31:51)
Copyright (c) 1997-2012 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2012 Zend Technologies
with the ionCube PHP Loader v4.2.2, Copyright (c) 2002-2012, by ionCube Ltd., and
with Zend Guard Loader v3.3, Copyright (c) 1998-2010, by Zend Technologies
with Suhosin v0.9.33, Copyright (c) 2007-2012, by SektionEins GmbH

I sure do thank you all for taking the time to help me. 

I have been going bonkers trying to find out the issue. 

In reply to Guillermo Madero

Re: Can't login to Front Page

by Steve H. -

I did notice that I should have posted the config file and PHP.ini as well according to the forum.

Missed that part. 

I will try to fill in the blanks now.

It won't allow me to add the PHP.ini file to this but I have it ready as well.

The only things I can think of that are not quite standard with my PHP install is that I use Suhosin and Xcache. 

The MySQL verion I am using is MySQL version5.1.63-cll

 

Again I can't thank you enough for the help everyone has given thus far.

In reply to Steve H.

Re: Can't login to Front Page

by AL Rachels -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers

Steve,

Your config.php file looks okay to me but I do have a couple of questions about it. It appears you have the passwordsalt snipped out, good idea, but where did it come from? Since you say you have "tried upgrading to the latest release" that implies that you may have ran the install more than once and may actually be trying to log in with the wrong passwordsalt.

I have had the "wrong salt" a couple of times when keeping an old copy of Moodle while migrating to a new one and the log in would always dump me right back to the login page even though I KNEW I was using the correct user name and password. I was locked out until I copied the old salt into the new config.php.

Go here to read more about it: http://docs.moodle.org/23/en/Password_salting

Warning: If you change the salt and do not retain the old one in config.php you will no longer be able to login to your site!

Hope this helps,

AL

 

In reply to AL Rachels

Re: Can't login to Front Page

by Steve H. -

Thank you for your reply.

I actually used Softaculous to install the Moodle to the 2.3.1 version.

Then I downloaded the latest weekly version then I moved all the old files except the config file to the temp folder. After that I went and extracted the latest version in the root folder and did the upgrade steps from the administration area. 

 

I tried changing the session handling from the MySQL server to the file based system. Then when that didn't work I moved back to the MySQL version same results either way. 

 

The odd thing is that I can login to the administrator area and configure the site all day long and add course categories and post blog comments, and yet when I hit the front page it is as if it wipes out the login variable that says I am logged in already. 

So that is the thing that really confouds me as it works to login to the adminstration area and adjust the system settings, but when I go to the front page and try to add blocks and such it won't work as it always shows me as not logged into the system.

I never had this problem every with the 1.9x or prior versions. 

 

Once again thank you all for your kind efforts in helping me with this puzzling issue. 

In reply to Steve H.

Re: Can't login to Front Page

by AL Rachels -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers

Steve,

When I was writing the reply down below, I re-read your last reply and it gave me a better idea to ask you about first.  Since you had a version of 2.3.1 already installed and went to update it, did you load the NEW files over the OLD ones? If you did, that could be your problem. It is always recommended to make a totally new web folder (you can keep the data one) and put the new upgrade there. The only OLD file to go in there is your config.php.

Hope this helps. If it doesn't apply then check the other ideas below.

AL

Steve,

I have two suggestions.

1. Are you able to check the permissions on your site files and folders. I have had a couple of problems in the past where just ONE file was set wrong because of placing it there after setting all the others and then forgetting to check the last addition.

2. When you are able to get in and change things, are you also able to do a backup? If you can, I would do so. Theeeen, I went and looked at your site, and at the moment it does not appear that you have too much there, thoughtful sooooo, I would remove the config.php file and then trigger a new install manually by going to http://www.ilearnalot.net/ .

I have had to do that on a couple of installations. Only one of them also required me to empty the database before it worked, but I don't think you would need to do that.

You will be able to use the same database name, db user, dbpassword, admin, and admin password as the install will overwrite anything already in the db.

HTH,

AL

In reply to AL Rachels

Re: Can't login to Front Page

by Steve H. -

I did actually follow the method of moving old files to a new folder then extracting the new ones to the root and only keeping the config file in place. 

I did a reinstall using the old database as suggested and forgot to change the password salt back to the original one. Took me about 7 login tries of nothing working then it popped in my head. SALT I forgot to change the salt back. This has been the only time I was elated since I knew how to fix it and what was wrong. 

I got the same results as before though. Going to the home page and clicking login just brings you back to the home page with a link that does not display a username but does display a link saying login. And none of the controls for editing the main page are present from the main page. 

I then created a new database and new user and then did a reinstall using the new database and user to see what would happen. 

Again same results as before. I even created a new moodledata folder in hopes that might clear things up. 

Sad to say nothing has changed. I have what amounts to a fresh install all from scratch done by me not an installer program like I used before. 

 

The only thing I saw that presented some question was that there is an unset function at the top of the config file and if that is being called each time you go to the front page I would think that would be the culprit that could be erasing the session variable. 

 

Once again thanks for the helpful comments and hints to fixing this issue. 

In reply to Steve H.

Re: Can't login to Front Page

by AL Rachels -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers

Steve,

Sorry to hear that even starting over has not fixed the problem. As far the unset($CFG); it is supposed to be there because the rest of the config file immediately resets everything to be what is needed.

Could you please verify that your /data/sessions folder permissions is set to 777. I had one install a couple years ago in which that was the culprit for not being able to log in like this.

AL