Login doesn't seem to be working

Login doesn't seem to be working

by Bob Caddell -
Number of replies: 39
I went through the processes described in the documentation. I wasn't presented with a page to enter the administrator password. I used other means to set the password. I now added myself as a user and that seem to go well. I got the email notification that I was sucessful in being added and I confirmed by clicking on the link on the email. I then went to try to add courses and it said that I was not logged in. I followed the link for login and attempted to login. After entering my username Admin and the password I was taken to an 404 Not Found
The requested URL /moodle/login/ was not found on this server.
Solaris PHP4 apache mysql
Any help would be nice.
I love the interface on your demo. I want to offer it to our educators here. They will love it as well.
Thanks Bob
Average of ratings: -
In reply to Bob Caddell

Re: Login doesn't seem to be working

by Martin Dougiamas -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
Thanks, Bob.

This is the second report of this now - there must be something different about your setup to my test setups.

Perhaps the URL error is a clue. Do you have index.php defined as a default document in your Apache setup? Check for a line starting with DirectoryIndex in your httpd.conf to see if it includes index.php. For example:

DirectoryIndex index.php index.html index.htm

If it isn't there, add it, restart Apache and try again.

If you did already have it, send me a URL and your config.php - I'd love to take a look and work out what's happening here.
In reply to Martin Dougiamas

Re: Login doesn't seem to be working

by Cary Woods -
Having the same problem....sending over some info now...
In reply to Martin Dougiamas

Re: Login doesn't seem to be working

by Martin Dougiamas -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
BTW, Bob told me in email that this DirectoryIndex setting fixed his problem.
In reply to Martin Dougiamas

Re: Login doesn't seem to be working

by Bob Caddell -
Changing the config file to recognize that php extention fixed the "not found" problem. Still having problems logging on. Cookies are enabled on my browser as well. I can click on the login link, enter admin for the user and the password. I am then taken to the inital page that says no courses have been defined and the text near the bottom of the page says that you are not logged in.
In reply to Bob Caddell

Re: Login doesn't seem to be working

by Nabil Sari -
Same problem here.
Also I can't login (as admin/regular user/guest).
Tried moodle1.0 and the latest build on win2k/apache/mysql - and - freebsd/apache/mysql.

/NZ
In reply to Nabil Sari

Re: Login doesn't seem to be working

by Martin Dougiamas -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
I need more information to solve this...

- do you have cookies turned on in your browser?
- have you checked the DirectoryIndex setting in Apache?

If yes to both, could you please delete your Moodle tables and send me a URL and your config.php so I can go through the setup process myself?

Cheers,
Martin
In reply to Bob Caddell

Re: Login doesn't seem to be working

by Martin Dougiamas -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
Can you guys all check your PHP version?

As I've written in the Install doc (under requirements), you NEED to have 4.1.0 or later. Anything before that does not support the $_SESSION variable, and this will cause the admin login to fail exactly as described.

In reply to Bob Caddell

Re: Login doesn't seem to be working

by Joar Herseth -
I got the same error when first I installed Moodle in a subdirectory under the web-root. When I created a virtual namebased server in Apache and gave it a name in DNS it all worked fine.
In reply to Bob Caddell

Re: Login doesn't seem to be working

by Warren K -
I installed Moodle 1.0.4 for the first time on a Windows 2000 Server running IIS 5. I keep getting the same error as the original poster in this thread. The requested URL is not on this server when I try to log in after I've logged out. I erased all cookies and cleared the cache with no help. I currently have PHP 4.2.3 running on the server with MySQL 3.23.51 . I also have index.php as the default on my server. Have I made an error or is it a bug in the script ?
In reply to Warren K

Re: Login doesn't seem to be working

by Martin Dougiamas -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
This is very unusual. Can you email me the URL of your site (and your config.php) so I can take a look?
In reply to Martin Dougiamas

Re: Login doesn't seem to be working

by Warren K -
Thanks for the fix ! I'm no programmer myself, so I always appreciate it when you guys share your work.
In reply to Warren K

Re: Login doesn't seem to be working

by Martin Dougiamas -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
You're welcome!

For anyone else checking this thread, the problem in this case was IIS not accepting a form submitted to a directory URL (rather than directly to a file).

Apart from the login page there may be a couple more of these around Moodle, which I'll fix now for 1.0.5.
In reply to Martin Dougiamas

Re: Login doesn't seem to be working

by Kevin Knox -
Great application!

I think I am experienecing the same problem in that when I try to log on using admin and password I get file not found error. The URL listing shows: webroot/moodle/login/

The error message:

The page cannot be displayed

The page you are looking for cannot be displayed because the page address is incorrect.
------------------------------------------------------------------------

Please try the following:

* If you typed the page address in the Address bar, check that it is entered correctly.

HTTP 405 - Resource not allowed
Internet Information Services

what needs to be fixed on the server?

Server win2000 sever
IIS : 5.0
index.php/index.htm/index.html all listed
MySQL : 3.23.53-nt
PHP : 4.0.5
moodle 1.04

Thanks
Knoxy
In reply to Bob Caddell

Re: Login doesn't seem to be working

by Rodrigo Meurer -

I´m having the same problem.

I´m using php 4.1.2 in an win NT w/ iis 5.0 and MySQL.

 

 

In reply to Bob Caddell

Re: Login doesn't seem to be working

by Graham Waller -

I have set-up moodle on a virtual server on some shared webspace and I cannot get past the login screen either.  When the details are submitted the scripts do not identify the new session.

The server's OS is NT4 and it is running PHP 4.1.2 as a CGI.

The hosting company has confirmed that the folder in which the session data is stored exists and has the appropriate permissions for PHP to create files in it.

Regards

Graham

maywood@blueyonder.co.uk

In reply to Graham Waller

Re: Login doesn't seem to be working

by Martin Dougiamas -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
Thanks for the good background.

I know several of these cases now and the common factor seems to be IIS and older versions of PHP.

Rodrigo gave me an idea it might be a known bug with sessions in this environment ... could you please try replacing your login/index.php with the attached file?
In reply to Martin Dougiamas

Checking your sessions

by Martin Dougiamas -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
Graham let me have a good thorough look at his server and I found that sessions there are simply not working. It's not his fault (it's a web hosting service) and there is no obvious problem with the PHP settings, however the attached tiny script shows the problem clearly.

So if you are experiencing a login screen that doesn't work, try this tiny script as a diagnostic to make sure sessions are working. I'll include it in future distributions.

To see what it SHOULD do, try: http://moodle.com/lib/session-test.php
In reply to Martin Dougiamas

log-in problems

by Paula de Waal -
Picture of Core developers Picture of Translators

I have similar problems with moodle installed on  lycos. There are 2 problems:

1- When someone log-in, the page refreshes to some lycos page that is not my moodle page. I immagine that is very easy to repair, but i'm not a php programer so i hope somebody will give me a clue. The log-in works, but you have to know how to come back to the site.

2- I had to create the users from the admin interface because the scripts on the user interface are not working. People can not create a new account or log-in as guests.

I have 2 versions of moodle running at my pc, and they do not have the same problem.

The site is:

http://members.lycos.co.uk/learninggroup/moodle/

and i have turned on the additional error messages

thanks

 

 

In reply to Paula de Waal

Re: log-in problems - having too and maybe fixed...

by David Mudrák -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers Picture of Plugins guardians Picture of Testers Picture of Translators

I had similar problem with loggin to virtual host.

I have set $CFG->wwwroot to my virtual host (lets say http://virtual.host.cz, which points to something like http://physical.host.cz/moodle).

When the user came to physical host and logged in, the cookie was sent with virtual.host.cz domain (because login page uses $CFG->wwwooot).

But then user was redirected back to physical.host.cz, where cookie was not valid and the user seemed to be logged out. In fact the user was logged in, but had to view pages at virtual.host.cz

How I have solved this

IMHO the problem is in login/index.php near line 85:

 if (empty($SESSION->wantsurl)) {
    $SESSION->wantsurl = $_SERVER["HTTP_REFERER"];
  }

This is where browser is said to go back to physical.host.cz -- and maybe to Lycos in your case. So I have changed these lines to:

 if (empty($SESSION->wantsurl)) {
    $SESSION->wantsurl = "$CFG->wwwroot/";
  }

Martin, please - could this be problem? Is $_SERVER needed for something?

In reply to David Mudrák

Re: log-in problems - having too and maybe fixed...

by Martin Dougiamas -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
This is not a fix for this ... the original code provides the functionality of "bouncing back" to the original page you wanted before you logged in, which may not be the home page. For example they might have followed a forum link from an email.

The fix is to set $CFG->wwwroot = http://physical.host.cz/moodle

In reply to Martin Dougiamas

Re: log-in problems - having too and maybe fixed...

by Chris Weber -
Very intersting..., To reiterate what I've posted in other forum posts, here's my stats:

Apache 2.0.43, PHP 4.3.0, Windows 2k Pro, running moodle 1.1.

I've confirmed my php.ini complies with the settings I've discovered in these forums. BUT, running my http://localhost/mooodle/lib/session-test.php returns the following result:

No session found - starting a session now.

Reload this page

When I reload the page the result does not change.

This does seem to be a session issue. But I cannot see anything in my php.ini settings that may be causing this. Here is the relevent section of my php.ini:

[Session]
session.save_handler = files
session.save_path = C:\WINNT\Temp
session.use_cookies = 1
session.name = PHPSESSID
session.auto_start = Off
session.cookie_lifetime = 0
session.cookie_path = C:\WINNT\Temp
session.cookie_domain = alton.calc4it.com
session.serialize_handler = php
session.gc_probability = 1
session.gc_dividend = 100
session.gc_maxlifetime = 1440
session.bug_compat_42 = 1
session.bug_compat_warn = off
session.referer_check =
session.entropy_length = 0
session.entropy_file =
session.cache_limiter = nocache
session.cache_expire = 180
session.use_trans_sid = 0

In addition, I am running moodle in a subdirectory of my postnuke-based website. The postnuke site also uses cookies for sessions. The cookies that postnuke creates are named: lang and POSTNUKESID.
My postnuke is at http://localhost and my postnuke is at http://localhost/moodle.

Does shed any light on the problem?
In reply to Chris Weber

Re: log-in problems - having too and maybe fixed...

by Martin Dougiamas -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
Does C:\WINNT\Temp exist? Is it writeable? Are there session files in there?
In reply to Martin Dougiamas

Re: log-in problems - having too and maybe fixed...

by Chris Weber -
Yes it exists, and Yes it is writable. The NTFS permissions allow me full access. I discoved a heck of a lot of sess_ files in there so it is able to create session files in there.

I also checked my httpd.conf file and discovered that all of my webroot references were not the same. I originally had all my web files in M:\siteroot\html and now I have them in M:\siteroot2\html. There are no more references to the first location anymore. I dropped my moodle database and started over. Yet, I am still unable to access the admin section of the installation process, login in as admin, or get a good result from session-test.php.

Do you know of anything else I should report to help track this problem?
In reply to Martin Dougiamas

Re: log-in problems - having too and maybe fixed...

by Chris Weber -
Also, I have notice a lot of people who are having this problem run MySQL 3.*. I run MySQL 3.23.52-nt. Could this problem be MySQL related?
In reply to Martin Dougiamas

Re: Checking your sessions

by Paula de Waal -
Picture of Core developers Picture of Translators

i have tryed the script on lycos and got this error message:

Parse error: parse error, expecting `','' or `';'' in session_test.php on line 20

can i fix it?

In reply to Martin Dougiamas

Re: Checking your sessions

by Arthur Flax -

Martin:

I am having the log-in problem as well.

Running your original session-test.php diagnostic seems to establish a one time session. So my guess is that there is a session problem.

However, being a PHP neophyte, I don't have a clue as to how to establish a permanent session.

Please advise.

Thank you.

Arthur Flax

(P.S. - The session_test.php diagnostic posted in your previous note did not work. The session-test.php in my Moodle 1.09 program worked, as per above.)

 

 

 

In reply to Arthur Flax

Re: Checking your sessions

by Arthur Flax -

Regarding log in problems:

I downloaded and installed Moodle 1.1.1 yesterday (that is either today or tomorrow for you folks in Oz. I can never remember.)

Everything went swimmingly and it fixed my log in problem.......

However, when I added my old cobbled up theme - which notably included a modified header.html file, my log in problem returned. Installing a standard theme repaired the problem. Any ideas on what I might have botched up in the theme files to destroy log-in are appreciated.

Arthur Flax

(Site currently under construction at www.calibracer.com)

In reply to Arthur Flax

Re: Checking your sessions

by Martin Dougiamas -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
Attach your header.html and we can have a look. smile
In reply to Martin Dougiamas

Re: Checking your sessions

by Arthur Flax -

Thank you for your interest Martin.

Per your request, my header.html file (headercalibracer.html) is attached below. Right now, it seems to allow login to work, albeit with a couple of error messages that appear briefly before the login page loads ("Cannot modify header information......"). But, I am not confident that the login page will continue to load.....Again, the problem seems to be related to the session and the time length of the session thereof. (Or maybe it just works some of the time.)

I am afraid that I will have to return to Chapter 1 of my PHP/MySQL text book to learn how to make proper modifications.....

Again thank you.

 

 

In reply to Arthur Flax

Re: Checking your sessions

by Martin Dougiamas -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
That looks fine .. pretty standard Moodle header file ... I don't think it's the problem.

However, styles.php changed in Moodle 1.1 (at the top of the file) ... try copying a new one from a standard theme into your theme and see if that fixes it.
In reply to Martin Dougiamas

Re: Login doesn't seem to be working

by Chris Weber -
I tried the modified index.php file within my login/ directory now when I try to get to the login page I get this error:

Fatal error: Call to undefined function: save_session() in M:\siteroot2\html\moodle\login\index.php on line 88

By running a search on my moodle directory i discovered that this index.php file is the only file that refers to a save_session procedure called. Am I the only one that cannot save their session?

When I comment out line 88 and 43 (both refer to the save_session() procedural call) the code works but does not remember that I have logged in. This leads me to conclude that the problem I am having is due to a missing definition of the save_session() procedure.
In reply to Chris Weber

Re: Login doesn't seem to be working

by Martin Dougiamas -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
save_session is a really old function that I removed from Moodle a long time ago. You must have some old code, or perhaps a mix of old and new code.

I'd advise you to COMPLETELY trash your Moodle directory and install a new copy of Moodle (1.1.1 is due tomorrow).
In reply to Martin Dougiamas

Re: Login doesn't seem to be working

by Chris Weber -
thank you for the heads up. I see the potential of this system and am highly interested in implementing it in my career training center.

Thank you for all of your work and thank you for being so accessible.

The save_session code is from the attacted index.php from one of your posts in this thread. I do not understand why my session cookies are not recognizing my attemps to login, but I do not that they are being generated and I know that they aren't self destructing when I restart the browser.

Where is the code that manipulates the session cookies? How does moodle know that I have logged in?

I can't believe that I'm the only one who is having this problem. I still think there is something wrong with my configuration and will test my system again as soon as the new version arrives.

In reply to Martin Dougiamas

Re: Login doesn't seem to be working

by Chris Weber -
I tested moodle 1.1.1 Beta this afternoon. I am still having the same issues. I do not get access to the admin section of the installation process and after I login with the admin user account and password, moodle tells me I am not logged in.

Should I write up a bug report?
In reply to Chris Weber

Re: Login doesn't seem to be working

by John Gone -
Chris, a couple of questions.
1. Did you start this Moodle with nice new database tables? ie. old moodle used mdl_
new moodle uses ldm_
2. Did you make sure the URL in your $CFG->wwwroot setting is exactly the same as the one you are actually using to access the site.

In reply to John Gone

Re: Login doesn't seem to be working

by Chris Weber -
That's very interesting that you would ask that, I had a sinking suspicion that some think that could be causing my problems.

I am using a brand new (1.1) version of moodle (and at the moment testing 1.1.1. But in my config.php I changed the default (mdl_) table prefix to calc_ to comply with my current naming scheme (even though all tables are in my brand new database named moodle.

As far as your second point, the url of my moodle site is http://alton.calc4it.com/moodle and my $CFG->wwwroot is set to http://alton.calc4it.com/moodle

I just finished testing moodle 1.1.1. First, I left the table prefix set to its default mdl_ setting. Then I tried the suggested ldm_ setting.
I ensured that my $CFG->wwwroot was set correctly. I deleted all of my cookies. And I am still not able to login.

I will review my php.ini file again. If everyone else can get this to work and I can't, I am obviously doing something wrong. Here is some additional observation I found while comparing this site's cookies with the ones my site generates:

(these two cookies are for my site)
The cookies Path
------------ -------------------
MOODLEIDcalc_ /
MoodleSession C:\WINNT\Temp

(these next two are for www.moodle.org)
The cookies Path
------------ -------------------
MOODLEID /
MoodleSession /

From these charts I notice two things.
1. The MOODLEIDs are not similar.
2. The paths from the MoodleSessions are different.

Would that cause this problem?
In reply to John Gone

Solution Found! (well at least for me)

by Chris Weber -
I simply changed my session.cookie_path (a setting for sessions in the php.ini) from it current setting to nothing. To be more clear, here's what my session.cookie_path was:

; The path for which the cookie is valid.
session.cookie_path = C:\WINNT\TEMP

And here's what I changed it to:

; The path for which the cookie is valid.
session.cookie_path =

Now I am able to access the admin section of the installation process.

Has anyone else run into this?