[ back to toc ]

CGI script errors

Date: 2002/03/25 16:03

Q:
One of my client's sites is hosted at a national ISP. I have 4 email forms
on their site, all using the same cgi script provided by the ISP. 3 of
those forms are going to AOL email accounts. When you fill out the form,
it appears to work. You get a "thank you" page etc. The problem is that
the emails are not sent to the AOL accounts. The ISP says it's an AOL
problem -- that they've got blocks on large ISP's (due to spamming). They
told me I could find another script and upload it to the site and maybe
that would work. I've done that, and am now getting "Internal Server
Error", so I can't even see if it works! I uploaded the file using ASCII
mode...

My first question is how to fix the "Internal Server Error" to see if I
can even use the new script. My second question is, if that new script
doesn't work, is there is something that can be done to the script that
would somehow bypass the problems with AOL?

I know this is confusing, but would appreciate any help you could give.
The ISP says it's an AOL problem, and AOL says it's an ISP problem. I'm at
a loss!
A:
Internal Server Error is one of the nastiest one, because this means that
the server can only tell you that there is some error in the operation,
but does not know where it is. What the web server recognizes actually is
that the script is not printing any proper header.

What to do in a situation like that?

First of all try to start the Perl script from the command line. It may
happen that there is a syntax error in it, and that turns out when you try
to start it from the command line on a UNIX or windows workstation.

If the script sytactically is correct then you may have a look at (it that
is possible) the web server error log. If none works, then you should try
to insert the program fragment

BEGIN { print "Status 200 OK\nContent-Type: text/html\n\n"; }

at the beggining of the file, right after the line

#! /usr/bin/perl

This way you will see what your program prints to the CGI output making
the header that the program prints visible. If still getting Internal
Server Error then as a last resort, check the chmod permissions (well do
it before anything else actually) and try to install the program on a home
Linux to debug it.

The mail sending rejected by AOL may depend on the sender address, and
that should be configurable in any script.

Regards,
Peter

[ back to toc ]