Page 1 of 1

I'm getting an error message when using my script?

Posted: Sat Mar 01, 2008 1:16 pm
by Nick|NFo
It could mean one of many things. Here's a list to describe some potential problems:

Server Error - Premature end of script headers
  • CGI program isn't executable --- Make it executable (chmod 700 filename.cgi, or check executable, read, and write for owner only) or simply run the blanket permissions tool available on the File manager page of our control panel.

    No empty line after CGI header --- Make sure the CGI program prints an empty line right after the last header (e.g. in Perl, print "Content-type: text/html\n\n";).

    CGI program resides in a world- or group-writable directory --- Make the directory not writable by others (this is generally done through a chmod 755 to the directory).

    CGI program is world- or group-writable --- Make it writable, readable, and executable only by the owner (chmod 700 filename.cgi, or check executable, read, and write for owner only) or simply run the blanket permissions tool available on the File manager page of our control panel.

    CGI program mislocates Perl interpreter --- Verify that CGI programs written in Perl begin with #!/usr/bin/perl on the first line; other files need to similarly specify their interpreter, such as with #!/usr/bin/ruby or #!/usr/bin/python.

    CGI program has bad end-of-line characters --- Transfer all CGI programs, particularly those written in Perl, to your account using "text" mode. Binary transfers may corrupt the end-of-line characters.
Server Error - malformed header from script: First, examine the last lines of your error log (available through the File manager page of the control panel) for clues. If that does not help, investigate the following.
  • Error printing CGI header (e.g. a typo, Cntent-tpe: text/html) --- Verify that CGI header contains no typos.

    Program prints something before header --- Debug your CGI program; make it print a header first.

    CGI program has output buffering problems --- Make sure print buffers are emptied when you think they are. In Perl, set the $| variable.