Sunday, February 6, 2011

What are the CGI Script Guidelines?

CGI Script Guidelines:

  1. When editing your CGI script, use a program that saves the file as a ‘text file’ type. DO NOT use Wordpad that comes with Microsoft Windows because it doesn’t save files in pure ASCII text format. Use Notepad instead to edit files.
  2. Upload your CGI scripts in ASCII mode into the cgi-bin directory.
  3. Set the file permissions on the CGI script file and directories to be ‘chmod 755.’ If you use an FTP program to transfer files, right-click on the file and select change file attributes. Using FileZilla, enter 755 under numeric value.
  4. If you are still getting errors, you can instruct the server to display any errors messages to the web browser by adding the following line near the top of the Perl script:
    1#!/usr/bin/perl use CGI::Carp qw(fatalsToBrowser);
  5. Double-check any changes you have made to the script and also ensure the following line appears after the Perl path:
    1print "Content-type: text/htmlnn";
  6. Ensure that the Perl modules you require for your script is supported on the Netfirms Hosting plPn. For a list of the currently supported Perl modules, please click here.
  7. If your website is driven by Joomla, some third party components may result in a “500 Internal Server error.” To confirm this, login to your web account and location the components folder and then rename it. Then visit your Joomla website. If the error disappears, then this confirms one or more Joomla components are causing the error. You can test activating/renaming components folders until you determine which one(s) is problematic. source