Using the CGI Center

cPanel FAQs, Tutorials and How To Guides
With Over 80 different features

Common Gateway Interface

Updated: June 7, 2022
By: RSH Web Editorial Staff
cpanel CGI faq
Menu

Without notice from cPanel
The CGI Center, along with the associated CGI Scripts, was deprecated in cPanel v64.

You can read more about this in our documentation from the links below:
cPanel Deprecation Plan
The Removal of cgiemail and cgiecho

How to use the CGI Center

CGI (an abbreviation of Common Gateway Interface) is a specification for transferring information between a World Wide Web server and a CGI program. A CGI program is any program designed to accept and return data that conforms to the CGI specification. CGI programs are the most common way for Web servers to interact dynamically with users.

cPanel

The following pre-installed CGI scripts are available in cPanel:

CGI-Wrapper

The CGI wrapper allows you to run CGI scripts with your user ID

You will need to place the CGI Scripts that you want to run with your userid in the directory /home/cpanelusername/public_html/cgi-bin. Once done, your scripts will be available at http://maindomain.com/cgi-bin/

cpanelusername and maindomain.com should be replaced with the actual cPanel username and primary domain associated with your hosting package.

Random HTML Generator

The random HTML generator picks a string of HTML code from a list and inserts it into an SSI (Server Side Includes) enabled web page.

Put your HTML snippets in the box and click on Save. You can find an example below

cPanel

Now you need to access cPanel > File Manager > public_html and create .shtm or .shtml file.

cPanel

Once created, open the file and paste the aforementioned tag in it.

cPanel

For example, we added a fixed plain text to highlight the random HTML snippets on the page. Now we open http://yourdomain.com/cgi.shtml and refresh the page few times. We can see different results:.

cPanel

Counter

In this menu you can create a counter, clock or date box to display on your website (Counter functionality might not be working correctly on our shared servers.)

cPanel

Check on Preview and if everything looks good, click on HTML and copy the code into your html file

Once copied and saved, open the page in the browser to see the script working

CGI Email

With this option, you can create a simple Contact Form that will send you emails from your website:

1. Click on CGI Email. You will be redirected to the user guide and in the meantime cPanel will automatically create two important files in cgi-bin folder - cgiecho and cgiemail.

2. Create an email template in your public_html folder, for example lets create email.txt

cPanel

From: should be local email address – the one created in cPanel (with your domain using our hosting mail service), otherwise, the server will reject the email in order to prevent spamming activitiy.

To: can be any address you want to receive these emails to and reply from

Values in brackets will be pulled from the form visitor submits

3. Create your HTML page:

cPanel

Here you can change questions and Input values (do not forget to change them in your email.txt as well)

If you change the action URL from
http://yourdomain.com/cgi-bin/cgiemail/email.txt to http://yourdomain.com/cgi-bin/cgiecho/test.txt

The email will not be sent, but you will see if the submission is successful – so-called debug (test) mode.

Tweet  Share  Pin  Tumble  Email

We welcome your comments, questions, corrections and additional information relating to this article. Please be aware that off-topic comments will be deleted.
If you need specific help with your account, feel free to contact us anytime
Thank you

More Articles Of Interest

Simple, Fast and Secure cPanel Hosting