[ back to toc ]

bnbform cgi script not working

Date: 2002/05/20 10:46

Q:
Hi Peter. I'm at the end of my rope trying to get a simple cgi form to
work on my server. The tech support at my server told me to use this
BNBform cgi script. My old cgi form was working perfectly on another
server, but my host was bought out by another company and now my old cgi
script is defunct. So, now here I am trying to get this new sucker to
work for me. The new cgi script I'm using is the from "Big Nosed Bird"
(http://bignosebird.com/carchive/bnbform.shtml), where I found a link to
you. I put the BNB script in my cgi bin after following the instructions
very carefully (I thought!), but I'm getting this error (pasted below)
every time I submit a form:
Internal Server Error
The server encountered an internal error or misconfiguration and was
unable to complete your request.

Please contact the server administrator, northern 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.

Apache/1.3.23 Server at northernlightagency.com Port 80

Anyway, I think my perl setting is right (/usr/bin/perl), but I can't
figure out what this error could mean. Can you help me out? My host tech
support isn't responding to my queries, perhaps they don't support cgi
questions from know-nothings such as myself... I dunno.
the link to my server info is
http://www.infinology.com/faq/faq-tech.htm#CGIset
the link to the sample form I'm trying to get to work is :
http://www.northernlightagency.com/nla_guestbook5.html
I also have the sample BNB form on my site at:
http://www.northernlightagency.com/bnbform.html

I am using Adobe Golive 4.02 on a Mac G4 using OS 9.02, if that makes any
difference.
I checked my FTP settings and I know the cgi script was (or at least
should have been) FTPed in ASCII, not binary, so I think I can rule out
that possibility.
I hope this email isn't too drawn-out, or that I've forgotten something
obvious that will make me appear foolish.

Thank you for you consideration.

Greg *NAME-DELETED*
gregwhite@jps.net

A:
This is such a frequent issue that I have made a web page answering it:

http://peter.verhas.com/tutorials/InternalServerError.html

Hope it will help.

regards,
Peter

Internal Server Error
I tried to install a Perl script and got Internal Server Error. What can I
do, what did I do wrong?
This is a frequent question and there is no simple answer. There can be
several reasons why this error happens.
First of all check that the Perl script is syntactically correct. To do
this try to start the program from the command line using the command:

perl -c test.cgi

Check that you have uploaded the code to the server using ASCII mode.
Upload the code again using ASCII mode even if you are sure, you did
upload it using ASCII mode. To be 100% sure that the file was uploaded
ASCII mode, download the file into a separate directory in binary mode and
open it using Notepad. You have to see small rectangles instead of the
line breaks and all the code on a single line.

If there is no error in the program, you may want to look into the tail of
the error log file. This is on the server usually located in
/uvar/log/apache/error.log. However it may be located in different
directory or even named differently on your server. The Apache server
writes a bit more information on the type of the error into the error log,
that may help you to diagnose the reason.

Make sure that the program writes out the correct header information. Thus
the program has to have some print statements that print out lines like

Status: 200 OK\nContent-Type: text/html\n\n

Note that there should be an extra \n to close the header.

If you can not look into the error log file then you can alter your code
so that it starts like:

#! /usr/bin/perl
BEGIN {
print "Status: 200 OK\nContent-Type: text/html\n\n";
}

which will print the header even before the program is loaded. This can
also be done if you can not run the program from the command line.

As a last resort you can press the Refresh or Reload button on your
browser. This may solve the problem if the web server generates the error
due to heavy load. This is not likely though in most cases.

This page was generated April 16, 2002 11:20:28

[ back to toc ]