Article #: 51 • Updated: Mon Apr 12 2010 at 12:41 pm
Sooner or later most non-trivial web sites will need one or more custom
programs that run on the server (aka “CGI scripts”). In general we
that any new scripts be written using the PHP programming language
it’s faster, more secure, and more portable than the alternatives.
you want to run a pre-made script that is written in some other
you simply prefer to program in another language (like perl, python,
tcl, etc) we support that too.
Unlike PHP, which is built in to the web server software itself, scripts
written in other programming languages are run as external programs. In
to maintain security an intermediate program called “SafeCGI” is used
sets up a secure environment before launching the script. All of this
be transparent to you, however.
There is no need to place your CGI scripts in a special directory, but
if you want to. Just keep in mind that you can’t use the name “cgi-bin”
this directory because it’s used for cgi scripts shared by all users.
location of the script doesn’t really matter as long as it’s in your web
space. What’s important is the filename of the script and the file
Any file in your web space that ends with “.cgi” will be treated as a
script and SafeCGI will attempt to run it. It must be owned by you and
execute privileges enabled. The file itself may be a binary executable
long as it’s compatible with our servers), or (more commonly) a text
containing a script written in an interpreted language like perl or
For interpreted languages, the first line of the file is generally a
path”, which tells the operating system which program should be invoked
interpret the rest of the code in the file.
Common bang paths include:
Note that certain filename extensions will force a specific interpreter.
example, if your script name ends with “.pl”, perl will be used
the bang path. An extension of “.py” will use python, and “.rb” will use
Islandnet AMT Solutions Group Inc.
Hosting, Domain Registration, PHP, MySQL, Python, Perl, Ruby, Other
Telephone / fax: 1-250-383-0096
Toll free phone / fax: 1-800-331 3055