Re: 500 Internal Server Error

by "Peter Newton" <c-newton(at)ihug.co.nz>

 Date:  Mon, 17 Jan 2000 13:12:03 +1300
 To:  <hwg-techniques(at)hwg.org>
 References:  jeff
  todo: View Thread, Original

This happened to me a lot when I 1st started
with cgi/perl scripting now it happens ocasionally,
as has been said virtually any error in the script
can  trigger this response and it is quite frustrating
to deal with. Now if you are not able to access your
error logs you might find the following to be useful,
I was taught this trick by the list and so I'm just passing
it on as follows:-

At the start of your script beneath the perl path line

type the following like so:-

#!/usr/bin/perl

BEGIN {

open (STDERR, ">error.txt");
$localtime=localtime;
print STDERR "\n$localtime\n";

}


What this does is to redirect the STDERR o/p
from the screen to a file. Perl uses STDERR
to show compilation errors and so now these
errors will be written to the file error.txt (you can
call it anything you like).

The last 2 lines are simply used to date stamp
the error message so that you can make sure
that you are reading an up to date message, you
do not need to include this if you don't want to.

When you get this error simply find an expedient
way to read the error.txt (or whatever you chose to
call it) file and you will be able to read exactly what
the perl compilor found wrong AND WHERE.

Hope this helps
Peter Newton

nb:-
depending on how you choose to read this file
you may need to make sure you are looking at a
current copy of it. I was able to read it by typing its
name into the browser (and needed to use the
refresh button before seeing an up to date version)

ie http://yourname.com/wherever/error.txt

but this will depend on your configuration and
permissions. Another way is to have your ftp
software handy and use that to read the file.

Hope this helps you as much as it did me.
Peter Newton





  Has anyone ever seen this error message
>
> Internal Server Error
> The server encountered an internal error or misconfiguration and was
unable
> to complete your request.
> Please contact the server administrator, webmaster(at)tlcsilver.com and
inform
> them of the time the error occurred, and anything you might have done that
> may have caused the error.
>
> More information about this error may be available in the server error
log.
>
> I get it trying to set up a cgi program, I'm not a cgi expert but I have
20+
> accounts and have never seen this before. The account is with cihost and
> they told my client it is something that I did and he won't pay me.
Boycott
> them forever.
>
>
> Rossi Designs
> (904) 226-8979
> P.O. Box 1084, Holly Hill, Florida 32125-1084
> http://rossidesigns.net
>
>

HWG hwg-techniques mailing list archives, maintained by Webmasters @ IWA