in reply to Re^2: Getting random "Internal Server Errors"
in thread Getting random "Internal Server Errors"

Because of 1 and 2 we can assume the script itself is ok and the problem is somewhere in the surroundings as somebody already stated
I'm sorry, but you cannot assume that. You could if the error was 502 Bad Gateway, but a 500 Internal Server Error means your program is broken.

To figure out where, add this code to the top of your script

BEGIN { $|=1; print "Content-type: text/html\n\n"; use CGI::Carp('fatalsToBrowser'); }
Or add this
BEGIN { use CGI::Carp qw(carpout); open(ERROR_LOG, ">>my_error_log") or die("my_error_log: $!\n"); carpout(\*ERROR_LOG); }

Replies are listed 'Best First'.
Re^4: Getting random "Internal Server Errors"
by polki (Novice) on May 05, 2009 at 21:04 UTC
    Ok, added your lines (the second ones, because the first ones won't work. Remember this script is called by a javascript AJAX-call that expects a return value to do something with. The errors would never get to the browser in this case). I performed the AJAX-request several times, some worked, some produced the error. Nonetheless the logfile was EMPTY, error.log of the webserver didn't show anything either.
    Just to make one thing more than clear again: I replaced the whole script by this:
    #!/usr/bin/perl print "123test";
    That was ALL. Nothing else.
    Now again i called it several times, some times worked, some times "500 Internal Server Error".
    Now does this REALLY mean that the script itself is broken? If so, where is this script broken?
      That was ALL. Nothing else. Now again i called it several times, some times worked, some times "500 Internal Server Error".
      Sometimes it worked? Oh, I see, you need to re-boot :) Stop your webserver, re-start your webserver or re-boot your computer. If that doesn't help, you have gremlins :|
        Yes, that's what i also wrote earlier on. Sometimes it works, sometimes it doesn't and up to now i didn't find out on what it depends...
        As you might guess, the reboot is of no success at all. I'm getting crazy on this for nearly weeks now and the machine has been rebooted plenty times...