500 error for pretty much everything.

500 error for pretty much everything.

by brian avery -
Number of replies: 11
Having returned home I tried to see if my site was working. On the surface it appeared to be, so I then went to look at my files, to see if there was anything odd.

I added a cronjob, which I hadn't bothered to do yet because the site hasn't been used since the new install. The cronjob was copied from the install instructions here in docs. (with a changed domain name, obviously).

I then went to my site to check the cronphp file and got an error message. i went to the site itself and got a message. No access at all.

I deleted the cronjob, access returned after a few minutes.
I added another cronjob, this time checking character by character that it was correct. After a few 500 errors I was aloowed onto my site, but the theme that had been installed had vanished and I just had a white page with words and a log-in place.

I logged on, changed the theme. Looked fine. Refreshed the screen and got a 500 error. Changed the theme, all looked okay again.

Did refresh and got away with it.

Went into admin to copy the various bits of info from there and turn debugging on. Tried to open one page (I forget which one) and got a 500 error. Back to previous page, all okay again. Press refresh, 500 error.

So, here are some details:
This, I believe, was the php.ini file

<?php /// Moodle Configuration File

unset($CFG);

$CFG = new stdClass();
$CFG->dbtype = 'mysql';
$CFG->dbhost = 'localhost';
$CFG->dbname = 'deleted by me here';
$CFG->dbuser = 'deleted by me here';
$CFG->dbpass = 'deleted by me here';
$CFG->dbpersist = false;
$CFG->prefix = 'mdl_';

$CFG->wwwroot = 'http://www.insegnanti-inglese.com/moodle';
$CFG->dirroot = '/home/bca19560/public_html/insegnanti-inglese.com/moodle';
$CFG->dataroot = '/home/bca19560/public_html/moodledata';
$CFG->admin = 'admin';

$CFG->directorypermissions = 00777; // try 02777 on a server in Safe Mode

$CFG->passwordsaltmain = 'deleted by me here...';

require_once("$CFG->dirroot/lib/setup.php");



These are errors that showed up for the 500 errors this morning in the error log in /moodle/
[24-Aug-2010 10:49:22] PHP Warning: require_once(config.php) [<a href='function.require-once'>function.require-once</a>]: failed to open stream: No such file or directory in /home/bca19560/public_html/insegnanti-inglese.com/moodle/help.php on line 14
[24-Aug-2010 10:49:22] PHP Fatal error: require_once() [<a href='function.require'>function.require</a>]: Failed opening required 'config.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/bca19560/public_html/insegnanti-inglese.com/moodle/help.php on line 14
[24-Aug-2010 11:01:52] PHP Warning: require_once(config.php) [<a href='function.require-once'>function.require-once</a>]: failed to open stream: No such file or directory in /home/bca19560/public_html/insegnanti-inglese.com/moodle/help.php on line 14
[24-Aug-2010 11:01:52] PHP Fatal error: require_once() [<a href='function.require'>function.require</a>]: Failed opening required 'config.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/bca19560/public_html/insegnanti-inglese.com/moodle/help.php on line 14


These were from the reports inside moodle - as it crashed I can't tell you which pages these are...

moodle version 1.0 is required and you are running 1.9.9 OK
unicode must be installed and enabled OK
database mysql version 4.1.16 is required and you are running 5.1.48 OK
php version 4.3.0 is required and you are running 5.2.14 OK
php_extension iconv should be installed and enabled for best results OK
php_extension mbstring should be installed and enabled for best results OK
php_extension curl should be installed and enabled for best results OK
php_extension openssl should be installed and enabled for best results OK
php_extension tokenizer should be installed and enabled for best results OK
php_extension xmlrpc should be installed and enabled for best results OK
php_extension ctype should be installed and enabled for best results OK


This, I know, is the php info shown by moodle:

System Linux gator1099.hostgator.com 2.6.34.6 #1 SMP Fri Aug 27 18:43:47 CDT 2010 i686
Build Date Aug 20 2010 14:46:04
Configure Command './configure' '--enable-bcmath' '--enable-calendar' '--enable-dbase' '--enable-exif' '--enable-fastcgi' '--enable-ftp' '--enable-gd-native-ttf' '--enable-libxml' '--enable-magic-quotes' '--enable-mbstring' '--enable-pdo=shared' '--enable-soap' '--enable-sockets' '--enable-sqlite-utf8' '--enable-wddx' '--enable-zip' '--prefix=/usr' '--with-bz2' '--with-curl=/opt/curlssl/' '--with-freetype-dir=/usr' '--with-gd' '--with-gettext' '--with-imap=/opt/php_with_imap_client/' '--with-imap-ssl=/opt/openssl' '--with-jpeg-dir=/usr' '--with-kerberos' '--with-libexpat-dir=/usr' '--with-libxml-dir=/opt/xml2' '--with-libxml-dir=/opt/xml2/' '--with-mcrypt=/opt/libmcrypt/' '--with-mhash=/opt/mhash/' '--with-mime-magic' '--with-mssql=/usr' '--with-mysql=/usr' '--with-mysql-sock=/var/lib/mysql/mysql.sock' '--with-mysqli=/usr/bin/mysql_config' '--with-openssl=/opt/openssl' '--with-openssl-dir=/opt/openssl' '--with-pcre-regex=/opt/pcre' '--with-pdo-mysql=shared' '--with-pdo-sqlite=shared' '--with-png-dir=/usr' '--with-pspell' '--with-sqlite=shared' '--with-tidy=/opt/tidy/' '--with-ttf' '--with-unixODBC=/usr' '--with-xmlrpc' '--with-xpm-dir=/usr' '--with-xsl=/opt/xslt/' '--with-zlib' '--with-zlib-dir=/usr'
Server API CGI/FastCGI
Virtual Directory Support disabled
Configuration File (php.ini) Path /usr/lib
Loaded Configuration File /home/bca19560/public_html/insegnanti-inglese.com/php.ini
Scan this dir for additional .ini files (none)
additional .ini files parsed (none)
PHP API 20041225
PHP Extension 20060613
Zend Extension 220060519
Debug Build no
Thread Safety disabled
Zend Memory Manager enabled
IPv6 Support enabled
Registered PHP Streams https, ftps, compress.zlib, compress.bzip2, php, file, data, http, ftp, zip
Registered Stream Socket Transports tcp, udp, unix, udg, ssl, sslv3, sslv2, tls
Registered Stream Filters zlib.*, bzip2.*, convert.iconv.*, string.rot13, string.toupper, string.tolower, string.strip_tags, convert.*, consumed

Zend logo This program makes use of the Zend Scripting Language Engine:
Zend Engine v2.2.0, Copyright (c) 1998-2010 Zend Technologies
with the ionCube PHP Loader v3.3.20, Copyright (c) 2002-2010, by ionCube Ltd., and
with Zend Optimizer v3.3.9, Copyright (c) 1998-2009, by Zend Technologies


This is the htaccess sitting on the domain insegnanti-inglese.com:
<IfModule mod_suphp.c>
suPHP_ConfigPath /home/bca19560/public_html/insegnanti-inglese.com
<Files php.ini>
order allow,deny
deny from all
</Files>
</IfModule>



I can't think of anything else to add to this. I don't know anything about servers, nor did I ever want to.

Any suggestions anybody?

Brian


Average of ratings: -
In reply to brian avery

Re: 500 error for pretty much everything.

by brian avery -
Well, it's disappointing that nobody offered any help for my problem.

For reference, for anybody else that has a similar problem, especially with a shared server, let me offer you an explanation of what the fault turned out to be:

First, I have a shared server hosting service with Hostgator. On the whole they are quite economical, but the standard of help service is generally very poor, in my experience.

Second, I have a newish install of moodle - current version; 1.9.9+

Thirdly, I use Thunderbird to download email to my pc. On my various domains, I have about 12-15 email addresses.

Finally, Hostgator restrict shared hosting clients to 25 simultaneous active processes.

So, the problem I had, whereby I was getting 500 server messages almost every time I tried to log onto my site related (in the end) to Thunderbird.

My email client is set to check for email every 10 minutes. Each time Thunderbird checked for mail it started a new process. It also seems that Thunderbird doesn't always log off after checking for mail. The email client, which I often leave open while I'm working, was creating queues and backlogs of processes which, when they breached 25, caused the server to generate a 500 server error. Apparently, according to the 5th help assistant (who had his brain in gear) this is a common fault not just with Thunderbird but also other email clients.

The solution: set concurrent server connections to 1 (is set to 5 by default), ensure that 'idle' is used, set download email to no more than once every 10 minutes, preferably less, and to manually close the program once email has been checked to stop it generating more processes. Once this was done, the system cleared all its faults and reverted to a working state again. This also explains why setting up a cronjob caused an error - it was a process over and above the limits.

Hope somebody finds this information useful.

In reply to brian avery

Re: 500 error for pretty much everything.

by Colin Fraser -
Picture of Documentation writers Picture of Testers
So you have diagnosed and dealt with your own problem and that means we can help you ..how?


Finally, Hostgator restrict shared hosting clients to 25 simultaneous active processes.

If this is your issue then the solution is clear...

If this is not the issue then please, we have an information overload here...

Most of the people who could provide you with a better answer, like Howard, will probably be tied up on testing and writing Moodle 2.0, so we are all struggling for the moment...



In reply to brian avery

Re: 500 error for pretty much everything.

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
There's absolutely no way that a mail client should stop your web site working. They are *completely* different systems.

If your host has a blanket 25 process quota that covers everything you do then I'd be out of there like a shot. That's stupid.

Just for the record... there's no way anybody would have spotted that from the information you gave. That's not your fault, it's just an incredibly weird scenario. You provided all the information we normally don't get!!
In reply to Howard Miller

Re: 500 error for pretty much everything.

by brian avery -
Howard,

Oh, I know it's a weird situation. You wouldn't believe the time I spent wrestling with this and with no idea what to do. Hostgtor were not terribly helpful either.

However, I they gave me a link to a mozzilla page which referred to this specific problem. The guy who did this looked at the site while it was coming up with these errors and said it was all tied to the IMAP email client. Now I don't know if that's true or not, but I do know that since making the changes I haven't had a problem. And I do know that when I've had the problem, thunderbird was also running at the same time. Whether it should be possible or not is beyond me. I can't judge. I simply added the comments just in case somebody else had the same problem. If it works, it works.

As for the 25 process limit, I first didn't see that before signing up (the info is well hidden in amongst the pages of terms) and secondly, I truly wouldn't have any idea of its significance. I'm still not sure I understand it.

I know there's nothing in the info I provided that gives a clue - that was what confused me even more. I couldn't see anything wrong - albeit with my remedial level knowledge!

Thanks for replying.



As for Colin Fraser:
"So you have diagnosed and dealt with your own problem and that means we can help you ..how? "

Read the email. I made an observation, reported what I know and said I hope it's of help to someone else. Sarcastic questions don't appear to be called for.



In reply to brian avery

Re: 500 error for pretty much everything.

by Colin Fraser -
Picture of Documentation writers Picture of Testers
That was not meant to be sarcastic, but genuinely puzzled as to what it was you were actually asking for, if you took it as sarcasm, please accept my apologies.

It looked to me that you had answered your own question, a 25 process limit seems to be to be too restrictive - in which case as Howard suggested, I too would be gone... .
In reply to Colin Fraser

Re: 500 error for pretty much everything.

by brian avery -

Colin,

A misunderstanding, sorry.

I was only trying to offer advice on what I had been told and what fixed the problem..for now. I want to change isp but it's hard to find a good one that isn't expensive. Search for host on google and it'll take you a lifetime to read all the pages, most of which are not particularly helpful..

Brian

In reply to brian avery

Re: 500 error for pretty much everything.

by Colin Fraser -
Picture of Documentation writers Picture of Testers
You may want to look for a Moodle Partner... whether they are of any benefit to you or not I am not sure, the program seems to be somewhat controversial from time to time.

A hosting service is never going to get it right for everyone, sometimes it will work sometimes it won't. It is the same 95% solution Microsoft uses, "works for 95% of the time for 95% of the people". Fortunately you are not restricted by locale anymore, and apparently the reputation of British and European Partners tends a little better then their American counterparts. Try one of them or at least talk to them.
In reply to Colin Fraser

Re: 500 error for pretty much everything.

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

Moodle Partners most certainly are restricted by region. However, a customer *can* choose to work with any company they wish (MPs just can't look for business outside their own region).

I think some of the American MPs might be a little offended by your remarks. It's not a MacDonald's style franchise. We are all different and have different strengths and skills - look for the MP that suits your needs best.
In reply to Howard Miller

Re: 500 error for pretty much everything.

by Mary Cooch -
Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Testers Picture of Translators
What's a MacDonald's style franchise? (genuine question)
In reply to Mary Cooch

Re: 500 error for pretty much everything.

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
Most MacDonalds "restaurants" (funny in itself) are franchises. They are run by individuals not MacDonalds themselves. You would never know. The parent company provides the pre-fab building, the training, the uniforms, the food. They're all the same. Becoming a MP has certain requirements but being some carbon copy isn't one of them. Our small one-man-and-a-dog (well, three dogs actually) operation bears little resemblance to the very big USA Partners but we'll have that personal touch - of course big grin
In reply to Howard Miller

Re: 500 error for pretty much everything.

by Colin Fraser -
Picture of Documentation writers Picture of Testers
Well Howard, I offend most organizations at one time or another, either through deliberate callousness or pure thoughtlessness. It comes of being a Celt/Australian I think... the important point is, I am an equal opportunity offender, I don't care who I offend..big grin, as long as it is not an individual, for the wrong reasons.

Any company, government, organization, even Moodle.org, needs to be assaulted from time to time, preferably bushwacked, when they get it wrong. Many of the comments made in these forums makes it obvious that Moodle Partner does not automatically equal "good guy". There are some who are good, conscientious, capable, but a simple change of staff can alter that dynamic. A change in management can damage a company, but past practice can constrain even the most honourable of intents.

Agghhh enough... Sorry, I got a lot of moralizing to do in the very near future seem to be getting in some practice first...tongueout