Error with admin/index.php after upgrading... please help me.

Error with admin/index.php after upgrading... please help me.

by Juan Manuel Fraga Sastrías -
Number of replies: 7

After running an upgrade (that stalled), by mistake I re-runned admin/index.php beyond the warning message...

Although the site is working, I can't access admin/index.php even by installing the week's latest version of moodle 9.2

The hosting people tell me it can be one of the following:

Three reasons that the server might be giving you a 500 error:
1. The php script is exceeding the limit of 30 seconds clear CPU time
2. The script is executing more than 2 simultaneous php processes, which is forbidden on our servers
3. There could be a codding issue in the script, which is causing the exception.

I think the problem is number two, but I am not sure. Can someone help me solving this problem?

Thanks in advance.

Average of ratings: -
In reply to Juan Manuel Fraga Sastrías

Re: Error with admin/index.php after upgrading... please help me.

by Richard Castorani -
I am having the same problem as described and am hoping that someone has been able to successfully diagnose and repair this problem.

The site seems to be up and running fine but I get a 500 error when I go to mysite/moodle/admin/index.php

My bluehost log shows two errors:
FATAL: emalloc(): Unable to allocate 71 bytes
Premature end of script headers: index.php

I have tried adding more memory to the php.ini file and renaming the htaccess file with no success. My last option after researching this all day is to try switching to php5 and hoping that miraculously fixes the problem.

On a sidenote, my attendance is showing that it is september 2007 and I cannot find anywhere to change it to 2008. I am not sure if this is in the admin section or not.

Thanks for any and all help.
In reply to Richard Castorani

Re: Error with admin/index.php after upgrading... please help me.

by Richard Castorani -
Anyone?
In reply to Richard Castorani

Re: Error with admin/index.php after upgrading... please help me.

by Richard Enison -
RC,

I didn't post to this thread before because
  1. I don't know the definitive answer to the 500 error. I have posted before when I had the wrong answer, and ended up drawn and quartered and run out of town on a rail!
  2. You asked for someone who had this problem and fixed it. I am in neither category.
But since no one else has replied and you are asking again (even though you waited less than 24 hours), I'll say what little I do know.
  1. I disagree with JMFS's host about the only three possible causes of a 500 error. As it says in http://docs.moodle.org/en/Installation_FAQ#I_receive_this_error_.22500:Internal_Server_Error.22, the most likely cause is an error in a configuration file (such as .htaccess or httpd.conf).
  2. You haven't said if you have switched to PHP5 yet.
  3. As for the attendance module, it is not one of the standard modules, and according to http://docs.moodle.org/en/Attendance, there are two alternative attendance modules available from two different sources. I could answer your question by staring at the PHP code in the module, but first I need to know which one you are using. At this point my best guess is that it either gets the date from the system (does your server think it is 2007?), or from the course setup. What are the start and end dates for the course in which you tried to take attendance?
RLE
In reply to Richard Enison

Re: Error with admin/index.php after upgrading... please help me.

by Richard Castorani -
Rich, thank you for your reply and I promise I won't go medieval smile. I apologize for bumping so soon - I was panicking a little as today was the first day of school and I needed to make sure I had moodle up and running. It didn't help that the utility company knocked out my internet connection!

1. I have tried removing (temp renaming) all htaccess files. The result being a blank page instead of the 500 server error when requesting admin/index.php. I can try (haven't yet) changing the moodle folder permissions incl. contents to 755 (wasn't sure if this was supposed to be a step or not as I haven't touched the any permissions after upgrading)

2. I have not switched to php5 yet and am curious if I should...should I?

3. My apologies again about panicking and posting about the attendance here. I do know better when it comes to forum ethics black eye. I was able to figure out the how to change the settings for the attendance dates.

So with that being said, the only things I can think of to try are
1. Change the entire moodle directory to 755
and/or
2. Turn on php5
Am I missing anything? Thanks again.approve
In reply to Richard Castorani

Re: Error with admin/index.php after upgrading... please help me.

by Richard Enison -
RC,

Maybe.
  1. You removed, by renaming, the .htaccess files and the 500 error went away. That tells us that at least one of the .htaccess files was responsible for the error. Which means one (or more) of three things:
    1. Your host does not support .htaccess files at all. So the very existence of such a file, even if it is empty, might cause a 500 error.
    2. Your host supports .htaccess, but one or more of the directives you put in one or more of those files is not supported for use in .htaccess by that host.
    3. There was an out and out error in one or more of the .htaccess files.
  2. If the .htaccess files were generated by Moodle, and neither you nor one of your colleagues modified them, then we can probably eliminate #3. You need to ask your host's tech support what their rules are on .htaccess files, including what directives you are allowed to use in them.
  3. However, that's not all. Even without the .htaccess files, you got a blank page. This could be because some of the directives in those .htaccess files were no longer there. If they were of the php_flag and/or php_value variety, you might be able to make do (assuming your host does not allow .htaccess files at all, or at least does not allow those two directives in them) by using custom php.ini files. Again, you need to ask your host's tech support if they support custom php.ini files, and how to create them (this procedure varies from host to host). But that only applies to PHP5. If you use PHP4, you need to have a php.ini file in every folder that has php script files in it.
  4. The only reason I mentioned PHP5 is because you said you were going to try switching to it to see if that helped. Then you posted again without saying whether you had done that. Not knowing the exact cause of your problem, it would be difficult to say whether it might help or not. But it certainly shouldn't hurt, so why not give it a try? Bear in mind, when you upgrade to Moodle 2.0, PHP4 will no longer be supported. Also, don't forget that the minimum version of PHP5 supported by Moodle is 5.1.0 (with Moodle 2.0, it is 5.2.4). BTW you haven't said what version of Moodle you are running (or PHP either, or anything else. See http://docs.moodle.org/en/Installation_FAQ#System_information_needed_for_Installation_Forum).
  5. Since you have the blank page syndrome, you might profit from http://docs.moodle.org/en/Installation_FAQ#Why_are_all_my_pages_blank.3F or http://docs.moodle.org/en/Installation_FAQ#Why_is_a_particular_page_blank_or_incomplete.3F.
  6. If you upgraded using the recommended method of renaming the old Moodle folder and extracting to a new folder of the same name as the old one used to have, then the new folder might not have the same permissions as the old one. Have you checked to see what they are? Doing an "ls -l" command on the parent folder should tell you. If you have enough access to run the chmod command, you should be able to do that.
  7. Just curious. How did you change the date for the Attendance Module?
RLE
In reply to Richard Castorani

Re: Error with admin/index.php after upgrading... please help me.

by Where's Wally -
Richard

Have you tried re-installing moodle? I know its a standard question but i thought i should ask. Did your install stop (stall) during the process if so at which point if you can remember?

Mitch