Moodle2.0.3 (build 20110505) I think I found a BUG in Moodle 2.0.3

Moodle2.0.3 (build 20110505) I think I found a BUG in Moodle 2.0.3

by Mary Evans -
Number of replies: 21
Picture of Core developers Picture of Documentation writers Picture of Peer reviewers Picture of Plugin developers Picture of Testers

I hope someone can help me sort this problem out.

A recent install of Moodle has now turned into a nightmare, as second Admin I cannot login successfully. Each time I login the returning page turns into a blank.

Tonight, after a reinstall, I thought I was winning, when this happened...see image below...

 

Strangly enough the caption above the the image "making it work" is a bit of a laugh really as this site has not worked properly for a good few weeks now. It all seemd to go wrong when the owner wanted the site to point to a www address rather then the websitename.co.uk address. So now coupled with the blank Home page , an index.php which invites you to open it or download it, and a tacky redirect message...I'm sick of it all...I really am - I have never, ever been so disappointed in all my life as I have with managing this site. It's a nightmare.

Am I the only one having theme problems?  sad

Mary

ake lazydaisy

Average of ratings: -
In reply to Mary Evans

Re: Moodle2.0.3 (build 20110505) I think I found a BUG in Moodle 2.0.3

by Guillermo Madero -

All those problems sure seem to be server related and not having anything to do with Moodle.

How was the redirection from non-www to www done?

Just ideas, but maybe there's a problem with the php handler mapping, with the MIME Type setting, or with the setting to define index.php as the default document.

Which environment are you working under? Linux or Windows?

In reply to Guillermo Madero

Re: Moodle2.0.3 (build 20110505) I think I found a BUG in Moodle 2.0.3

by Olumuyiwa Taiwo -
Picture of Plugin developers

This behaviour is also sometimes caused by your PHP script timing out. Try putting

set_time_limit(0);

at the top of index.php and see if that fixes the issue. If it does, you'll either have to set

max_execution_time in php.ini to a large value, or / and set TimeOut in Apache configuration file (assuming you're using Apache) to something large.

-- Muyi

In reply to Olumuyiwa Taiwo

Re: Moodle2.0.3 (build 20110505) I think I found a BUG in Moodle 2.0.3

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
I've never seen that...... it wouldn't be my first assumption especially in the face of the evidence.
In reply to Howard Miller

Re: Moodle2.0.3 (build 20110505) I think I found a BUG in Moodle 2.0.3

by Colin Fraser -
Picture of Documentation writers Picture of Testers

And it assumes that the Server is accessible to Mary...  Personally, I suspect Howard has it right... I think that Moodle 2 needs a little more precision in its structure than previous versions, so it spits the dummy when faced with something that can be vague... like this answer. Just go with Howard first, he is right far more often than not.

In reply to Colin Fraser

Re: Moodle2.0.3 (build 20110505) I think I found a BUG in Moodle 2.0.3

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
Your blind faith is always appreciated big grin
In reply to Howard Miller

Re: Moodle2.0.3 (build 20110505) I think I found a BUG in Moodle 2.0.3

by Colin Fraser -
Picture of Documentation writers Picture of Testers

mmm Haven't been blind for 30 years and I have no faith..smile As someone else used to say, "Just the facts, ma'm, just the facts."

In reply to Colin Fraser

Re: Moodle2.0.3 (build 20110505) I think I found a BUG in Moodle 2.0.3

by Mary Evans -
Picture of Core developers Picture of Documentation writers Picture of Peer reviewers Picture of Plugin developers Picture of Testers

Hi Colin,

I think Howard is right too. smile

Cheers

In reply to Guillermo Madero

Re: Moodle2.0.3 (build 20110505) I think I found a BUG in Moodle 2.0.3

by Mary Evans -
Picture of Core developers Picture of Documentation writers Picture of Peer reviewers Picture of Plugin developers Picture of Testers

Thanks for this Guillermo:

I'm not 100% sure, but I think Linux, but I do know definitely Apache/ PHP 2.3.17/MySQL. I was concerned that PHP was not high enough, but I am assuming it was acceptable at install, as I did not set it up. All the settings for redirect, from non-www to www, were done by host company, who maintain they run lots of Moodle hosting packages for various clients with no problems to report. I took that comment with a pinch of salt, as we all know Moodle can throw a wobbler every now and again, so to say no problems is whitewash.

I also maintain another Moodle site for the same owner as this one. That site is Moodle 1.9.12 and runs ever so smoothly, so perhaps all the other larger sites, which the hosting company hosts, are Moodle 1.9.x - enough said.

What makes this worse is that I have no control over how things are set up...most frustrating.

Cheers

Mary

In reply to Mary Evans

Re: Moodle2.0.3 (build 20110505) I think I found a BUG in Moodle 2.0.3

by Guillermo Madero -

Ok, given the apps, sure sounds like Linux smile

Assuming you have FTP access to your home server directories, I would start by looking if there is an ".htaccess" file at your root or public_home directory; if so, then I'd check the code in it. At minimum there should be a couple of lines, one with a RewriteCond and another with a RewriteRule.

To simplify... if you have access to your server and the .htaccess file is there, I would start by renaming it to see what happens.

---
Do you have FTP or cPanel access to your server?

In reply to Guillermo Madero

Re: Moodle2.0.3 (build 20110505) I think I found a BUG in Moodle 2.0.3

by Mary Evans -
Picture of Core developers Picture of Documentation writers Picture of Peer reviewers Picture of Plugin developers Picture of Testers

Hi,

I have FTP access to the server, and have already  been looking for .htaccess, but could not find a thing. This is what is so annoying I feel so helpless. The server set up is so different than my own website, and that is Linux too.

Mary

In reply to Mary Evans

Re: Moodle2.0.3 (build 20110505) I think I found a BUG in Moodle 2.0.3

by Guillermo Madero -

Mh, so they must have changed the Apache httpd.conf file.

Maybe you could try to revert their change.

1. Create a "test" (or whatever you want to name it) directory.

2. Create a .htaccess file with the following two lines:
Options +FollowSymLinks
RewriteEngine On

3. Upload this file into your test directory.

4. Open your browser and navigate to that directory.

What happens if you do this?

//--- Just another check:

What's the address in the $CFG->wwwroot directive of your Moodle config.php file?

In reply to Guillermo Madero

Re: Moodle2.0.3 (build 20110505) I think I found a BUG in Moodle 2.0.3

by Mary Evans -
Picture of Core developers Picture of Documentation writers Picture of Peer reviewers Picture of Plugin developers Picture of Testers

Oh this is Interestingly...surprise surprise

Not Found
The requested URL /test/ was not found on this server.
Apache/2.2.3 (CentOS) Server at www.managementcpd.co.uk Port 80

$CFG->wwwroot is the same as the URL in the message above

Are we getting any nearer?

Mary

 


In reply to Mary Evans

Re: Moodle2.0.3 (build 20110505) I think I found a BUG in Moodle 2.0.3

by Guillermo Madero -

Well, you got an http 404 error, which is good because that means that mod_rewrite is enabled.

However, now that you've put your site address, I just went to the www-less address of your site smile It displayed an "Incorrect access detected..." message for a few seconds and then the main page loaded fine (with the www address at the address box).

So... as the php files are loading Ok... I guess the problem has somehow solved itself (that never happens, I know). Are you still having your original problems? If you create an index.php file at your test directory, with the following line:

<?php echo "Hello World"; ?>

Does it display Ok?

Anyway, looking at the source code from the initial error page, I see that near the end there is a line with the following code:

YUI(M.yui.loader)...
setTimeout(function() { document.location.replace("http:\/\/www.yoursite"); }, 6000);

That 6000 is where were getting the delay before the page redirection occurs. I guess that code must come from a script from your theme.

From this it is clear to me that the server is not doing any redirection handling, instead, it seems that Moodle is actually handling the redirection (with a standard http redirect).

In order to take away this load from Moodle, I'd try the following:

1. Create an .htaccess file with the following lines:

Options FollowSymlinks
RewriteEngine on
rewritecond %{http_host} ^yourdomain$ [NC]
rewriterule ^(.*)$ http://www.yourdomain/$1 [R=301,L]

2. Upload it to your root (home) directory.

If everything works as expected, navigating to the www-less address should take you immediately to the main page.

Fingers crossed!

In reply to Guillermo Madero

Re: Moodle2.0.3 (build 20110505) I think I found a BUG in Moodle 2.0.3

by Mary Evans -
Picture of Core developers Picture of Documentation writers Picture of Peer reviewers Picture of Plugin developers Picture of Testers

Hi Guillermo,

Sorry I didn't reply to this sooner. I tried your suggestion, but nothing happened. However, I have noticed the redirect message is the same on all websites which have the same set up...so this is a Moodle thing and nothing to do with the theme. Although I should in theory be able to style the redirect page to look part of the site...but easier said than done! LOL

In the mean time, since I first opened this dicussion thread, the ISP has fixed the problem internally, they probably got the idea what to do by reading this forum...

Special thanks to you and Howard.

Mary

In reply to Mary Evans

Re: Moodle2.0.3 (build 20110505) I think I found a BUG in Moodle 2.0.3

by Guillermo Madero -

Strange it didn't work. I think I must have misunderstood something because if I go to managementcpd.co.uk I still see the "incorrect address" message, just as before, so the "fix" must have fixed something else tongueout

You're welcome!

In reply to Guillermo Madero

Re: Moodle2.0.3 (build 20110505) I think I found a BUG in Moodle 2.0.3

by Mary Evans -
Picture of Core developers Picture of Documentation writers Picture of Peer reviewers Picture of Plugin developers Picture of Testers

Hi,

Something I forgot to tell you, was that when I added the .htaccess file first in the test page and later as with the last script you suggested, in the root directory, when I refreshed the directory folders using FTP, the .htaccess file vanished, so it hard to tell if they are there or not.

Mary

 

 

In reply to Mary Evans

Re: Moodle2.0.3 (build 20110505) I think I found a BUG in Moodle 2.0.3

by Guillermo Madero -

Your FTP program is probably configured to hide special files, like those starting with a dot.

In reply to Guillermo Madero

Re: Moodle2.0.3 (build 20110505) I think I found a BUG in Moodle 2.0.3

by Mary Evans -
Picture of Core developers Picture of Documentation writers Picture of Peer reviewers Picture of Plugin developers Picture of Testers

Hi Guillermo,

I never thought of that...mind you I try not to tamper with settings...so I was not aware things like that can be done!!!

Thanks for your help always.

Mary

In reply to Mary Evans

Re: Moodle2.0.3 (build 20110505) I think I found a BUG in Moodle 2.0.3

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
+1

The web server is delivering the php file to your browser rather than running the code. This can (pretty much) only be a configuration problem on the server and more specifically the web server configuration.

Also, I have a hunch that they might be (effectively) trying to run Moodle from two different addresses (with the www. and without) which you just can't do with Moodle 2. You need to pick one and stick with it.
In reply to Howard Miller

Re: Moodle2.0.3 (build 20110505) I think I found a BUG in Moodle 2.0.3

by Mary Evans -
Picture of Core developers Picture of Documentation writers Picture of Peer reviewers Picture of Plugin developers Picture of Testers

Howard wrote:

"...Also, I have a hunch that they might be (effectively) trying to run Moodle from two different addresses (with the www. and without) which you just can't do with Moodle 2. You need to pick one and stick with it..."

My thoughts too Howard, as this only started after the redirect setup a few weeks back. Would this be set up in php.ini by any chance? Seems the likely place...but never having had to do this I don't have a clue.

Any thoughts? I just need something concrete to hit the host company with.

Cheers

Mary

In reply to Mary Evans

Re: Moodle2.0.3 (build 20110505) I think I found a BUG in Moodle 2.0.3

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
No, it's definitely nothing to do with php.ini

This is down to a redirect / rewrite or the like in Apache's http.conf.

On top of this, Moodle 2 checks that the URL you type on the address line matches the one you specified in config.php (wwwroot) regardless of what the web server does to feed them all to the same place.