Home » Cloud Hosting FAQ » CGI
What are CGI scripts? #
CGI (Common Gateway Interface) is a process used by the server to pass information between the user and an application on the server. With CGI access, you can install and run Perl scripts on your website.
What version of Perl are you running? #
What information and server paths are needed to run a CGI script? #
The list of current server side paths can be found in the control panel under “Features”.
path to Perl = /usr/bin/perl -w
path to Python = /usr/bin/python
path to sendmail = /usr/sbin/sendmail
path to the date program = /bin/date
If you require a specific Perl module, please inquire at our Help Desk and we will let you know if we have that module available in our Perl environment.
A CGI script is not working, are you able to help install and troubleshoot it? #
CGI script debugging is beyond the scope of the support that we provide. This is a web development issue and we do not offer any in-house web development/consulting services. We make sure that CGI is enabled for your website, that Perl is working properly, that you are provided with the correct path information and we can even help point you in the right direction, but we do not have the resouces to debug, install or develop your scripts.
Here are a few things to try when you are troubleshooting a CGI/Perl script:
Make sure that you have uploaded your script to your cgi-bin which is one level up from your public directory.
NOTE: Do not create subdirectory named cgi-bin in your public directory or your CGI scripts will not work, the /cgi-bin directory is a parallel directory to /web.
Check to see if all the file permissions are set correctly. File permissions can be set using a FTP program that allows permissions to be set on transfer. Typically scripts are set to be 755, user: read, write, execute; group: read, execute; other: read, execute (-rwxr-xr-x), but you should always check your script instructions or README to be sure.
Make sure that there are not any DOS/Windows carriage returns (ie. ^M) at the end of each line in the script. This is usually caused by a text editor or FTP program that is not properly uploading your script in a Unix/Linux format. If this is happening, try changing your code line break settings or upload settings to Unix/Linux.
Here’s how this is done in Dreamweaver: From the menu, goto Edit > Preferences > Code Format, then change Line Breaks to “LF (Unix)”.
The ^M is actually the ASCII LF character. Windows uses CR/LF, Mac uses CR and UNIX uses LF as line terminators. Most FTP programs translate the line terminators when doing an "ASCII" or "text" transfer, but they do not do the translation if it is a binary transfer. The problem with CGI files is that the FTP program may not recognize the extension, so it assumes that it is a binary file. Turning off the auto detect feature and manually transferring the CGI files as ASCII should solve your problem. Another option would be to add .cgi/.pl to the list of ASCII file extensions.
Here are a couple of good online articles on installing Perl CGI scripts
Perl 101: How to install a basic Perl script on a Web server (ServerWatch)
How To Install A Script (About.com)
Can I use Movable Type in the Laughing Squid Cloud?#
Yes. The Cloud infrastructure has all the necessary modules in place to support Moveable Type by default.
Are there any alternatives to CGI scripts that are easier to install and configure? #
Yes, check out PHP, a very popular and dynamic open-source scripting language. It is much easier to configure (no permissions to set, it can run from any directory, etc.) and much of what you can do with a CGI script you can do using PHP.