JSP Hosting
 

HostingServicesSupportOrderAbout UsSoftwareHome


Even experts read the manuals. Our tech support staff has most of the books that are out on a wide variety of web topics. Here are some of their top picks. We think you'll find them useful and informative as well.

 



I'm getting a 500 Server Error. Does this mean the script is broken?

Not necessarily. A 500 Server Error means the script is not sending browser-compatible output to the browser. This can occur for a wide variety of reasons and will appear if there is anything wrong with your installation or configuration that prevents the script from writing browser-compatible output.

  1. Make sure your script is located in your cgi-bin directory.
  2. Make sure the first line of your script begins with the path to the Perl interpreter:
    #!/usr/local/bin/perl
  3. Make sure the very first output printed to the browser begins with the following line:
    print "Content-Type: text/plain\n\n";
  4. Make sure the script is executable from the web. This means setting permissions equivalent to the Unix "chmod 755" command.
    This can be accomplished from most FTP programs by setting the file permissions as follows:
      User Group All
    Read x    
    Write x    
    Execute x x x
  5. Make sure any required library files referenced by the script are present and that the paths to them are correctly defined in your script. If possible, it is easiest to use relative paths and to keep all required files in the same directory as the script. Then required files can simply be referenced using a "./" relative path such as:
    require "./cgi-lib.pl";
  6. Make sure you have not saved or FTP'd the script in a binary format . Always save as "Plain text" and upload in ASCII format.
    This is especially important if you open the script in a word processor which saves files with unusual line breaks or other invisible characters which could be misinterpreted by Perl.
  7. Make sure you have "escaped" any control characters in your script. Escaping a character means adding a backslash in front of it so it is not interpreted as part of a variable name or other Perl expression. Characters which typically require escaping include ",@,',%,$,&,`,| and others. A common source of errors is to leave the escape out of the @ symbol in an email address.

Back To CGI-Tips

Note: MMA technical support staff cannot provide troubleshooting of problems with third-party CGI scripts including but not limited to: Perl scripts, C/C++ binaries, PHP or web/database integration unless these services are specifically contracted. For these services, please see our Quote Request Form.



Copyright © 1995-2012
Motivational Marketing Associates, LLC
All Rights Reserved.