HostMonster Web Hosting Help

CGI Basics

Summary

CGI (Common Gateway Interface) is a standard method of extending web server functionality by executing programs or scripts on a Web server.

What Is CGI?

CGI (COMMON GATEWAY INTERFACE) is a standard method of extending Web server functionality by executing programs or scripts on a Web server in response to Web browser requests. A common use of CGI is in form processing, where the Web browser sends form data to a CGI script on the server, the script integrates the data with a database, and sends back the results as a Web page. Use of CGI can make a Web page much more dynamic and add interactivity for the user.

How is CGI going to help me?

CGI is used to provide interactivity and turn static pages into dynamic ones. What do I mean? Let's take a guestbook for example. Most of them are powered by CGI. They allow your visitors to leave their comments on your site. This makes it interactive. But guestbook is only one example. You also have bulletin boards, form processing, counters, and much more.

How am I supposed to install a script?

Usually most of the scripts that I have tried before have complete instructions and a special ReadMe file with everything you need to know about installing that script. I recommend you reading the instructions a few times before starting to install the script. This will help you to make less mistakes.

What does "chmod" mean?

To chmod a file means to set a certain permission. Few of the most common chmod commands are 755 and 777. To see more about modifying file permissions please see our articles on changing file permissions and setting file and user permissions

What are the most common errors and how do I deal with them?

One of the most common errors is "500 Internal Error". The chances are that you will experience it many times. The worst thing about it, is that it doesn't actually tells you what's wrong with the script. It only tells you that something is not right. There are several possibilities that cause of this error. Here they are:

  • Incorrect path to PERL. See the next question for more information.
  • Syntax error. Check and see if you didn't accidentally delete a command or a word that the instructions didn't tell you to.
  • Incorrect CHMOD command. Make sure that you chmod the file exactly as the instructions say.
Note: Most of the times it will be either 755 or 777 (not always!). You can also get an "Access Denied" error, if you didn't chmod the file or a directory correctly. Basically, 500 Internal Error and Access Denied are 99% of errors you'll experience. 99% the cause of the error will be one of the above.

What is the path to PERL (interpretator)?

The perl path is the very first line in every .cgi or .pl file. Usually it looks something like this #!/usr/bin/perl. Make sure that the path is correct, otherwise you'll get an error. If you don't have the telnet access, simply email your tech support and ask them.

Knowledgebase Article 106,675 views bookmark tags: cgi (updated 642 days ago)


Was this resource helpful?

Did this resolve your issue?


Please add any other comments or suggestions about this content:





Recommended Help Content

Does your company have any limit about CGI script use? (updated 642 days ago)
Knowledgebase Article 85,048 views tags: cgi script

I need help with my CGI script? (updated 1665 days ago)
Knowledgebase Article 87,728 views tags: cgi scripting

What is CGI? (updated 642 days ago)
Knowledgebase Article 83,315 views tags: cgi

Related Help Content

Can I add my own CGI scripts? (updated 646 days ago)
Knowledgebase Article 91,313 views tags: cgi scripts

Why am I Getting File Not Found When Executing My CGI? (updated 1028 days ago)
Knowledgebase Article 75,191 views tags: cgi

How to run CGI scripts for Addon domains. (updated 638 days ago)
Knowledgebase Article 74,166 views tags: cgi htaccess

What is an IP address? (updated 624 days ago)
Knowledgebase Article 25,990 views tags: ip

Understanding Internet email headers. (updated 17 days ago)
Knowledgebase Article 40,073 views tags: email header ip

Do You Have Any Applications Available for Customers to Use? (updated 283 days ago)
Knowledgebase Article 90,592 views tags: MOJO cgi scripts

How do I change file permissions? (updated 435 days ago)
Knowledgebase Article 98,286 views tags: cgi permissions

What is the path to PERL (interpreter)? (updated 1635 days ago)
Knowledgebase Article 72,010 views tags: cgi perl