CGI and General Scripting
- How to use CGI, Perl, PHP and Python
Scripts
Our servers have the capability to run CGI scripts
based on Perl, Python, TCL, Unix SH, KSH, CSH, and
C languages. We also support PHP. Perl is a language
of that many are familiar with which is very well
suited for writing CGI programs. The appeal of Perl
code is that it does not require compiling unlike
C code which must be compiled on our servers prior
to use (unless you have a commercial precompiled binary).
Some settings are dependant upon your server group
ie. MLTE0, MLTE1 or MLTE2. For server group specific
questions and answers please review the following
pages:
Here are some general helpful tips to follow when
installing scripts:
Shell Scripts
- Upload to your chosen cgi directory to ensure
proper file permission settings.
- Upload in ASCII transfer mode (and NOT BINARY
mode).
- The first line of each script must read: #!/usr/bin/perl
- Always remember to include echo "Content-type:
text/html\n\n".
Perl Scripts
A user asks "I am having PERL problems. Can you
help?"
While we do NOT provide support for your PERL CGI
script development, we present the following suggestions
that may help. (Please DO NOT request support for
PERL scripts. We supply the following in good faith
and suggest you be careful of your PERL syntax.)
- You may have uploaded your script in binary mode
instead of ASCII. (A common mistake.) Try again,
making sure that you specify ASCII mode when you
upload. You may want to configure your FTP program
to automatically select ASCII mode when transfering
files with a CGI extension, as is done with HTM
and HTML files.
- Is your script written for PERL 4 or PERL5? (UK-Cheapest's
default is PERL 5.)
- If PERL 5, check to see whether your atsigns (@)
are preceded by (also known as "escape with")
backslashes (\). E-mail addresses in double quotes
aren't parsed correctly in PERL 5 if the backslash
is omitted. For example, the correct syntax for
UK-Cheapest support in a PERL 5 script would be
customerservices\@uk-cheapest.co.uk
- If PERL 4, you must specify the path to PERL 4,
because our default is PERL 5. At UK-Cheapest PERL
5 is located in /usr/bin/perl.
- Your PERL script resides in a directory that is
group-writable or world-writable, or it is a subdirectory
of such a directory. CGI scripts may not be located
in such directories at UK-Cheapest, because they
would make the UK-Cheapest server less secure. If
you must create files that are world-writable, like
a guestbook, place them in a separate writable directory,
away from your CGI scripts.
- You forgot to use the .CGI (or .PL) extension
for your PERL file. Rename it.
- Your PERL code just doesn't work. Examine your
syntax for mistakes, fix them, and try again.
- Your file permissions are wrong.
- CGI scripts require permissions of 750.
- Changing
permissions can be done with later versions
of many FTP programs such as AceFTP or CuteFTP,
or via your Web Control Panel if your Hosting Account
with us is either Standard, Business or a Pro Account.
- If none of the above help, and you didn't write
it yourself, contact the author of the script.
We are sorry, but the staff at UK-Cheapest cannot
support your CGI programs other than offering the
suggestions above.
For more information about CGI, do a web search,
or find a good book. There are a lot of good resources
available.
Back
to Online Help Index
|