Using CGI-Scripts to enhance your web presence

CGI scripts are used to process information on your Web site. Think of scripts as mini-programs that execute on the server to accomplish tasks. Each formmail, counter, guestbook, or other interactive feature you place on your site must not only have an HTML page, but also a script that works behind the scenes to process the information.

  • Our servers support Perl scripts easily. Other scripting languages, such as C, require the script to be compiled on a system running the same version of Unix as the server before they will function.

  • For your convenience, TCPIPHost has a collection of CGI-Scripts for our customers! Just email techsupport@tcpiphost.com and tell us what you need and we'll tell you if we have it! Using these tools, you may not have to upload your own scripts at all.

  • In addition, when you're uploading the scripts to your cgi-bin directory make sure all scripts and images are uploaded in "ASCII" mode.
When uploading Perl scripts to your account make sure that they are uploaded to your cgi-bin directory and that you upload them in 'Ascii' mode; not 'Binary' mode. The cgi-bin directory is located off of your root directory. Also, you should make sure that you have the proper permissions set on your Perl scripts. Usually they are set as the following:


Information commonly needed for perl scripts:
  • Version of perl: 5.004.04
  • Path to sendmail: /usr/lib/sendmail
  • Operating system: Linux (newer and some older accounts)

    Troubleshooting:
  • "Internal Server Error"- This does not necessarily mean that the server is misconfigured; in fact, it usually means that a CGI script a user has installed is not functioning correctly, and the server is detecting this. Common causes are: the file is not executable, there is a malformed header, or it is has an incorrect path reference when using a Server Side Include. Also make sure there are no control characters included in the script by using 'Ascii' mode when uploading.

  • Many errors in Perl CGI scripts can be more easily diagnosed by adding
    use CGI::Carp qw(fatalsToBrowser);
    to the top of the program. This will cause fatal error messages your script generates to be sent to your Web browser.


  • Make sure you have your path to Perl listed correctly in the script, and the HTML code of the page correctly refers to the script.


Need more help? Visit our Online Support.