CGI Basic tutorial

By

Aleck

We will speak about proper installation of cgi-scripts, I've heard that this is rather complex for most people.

Okay, 1st thing we should take of about is proper unzipping. Usually scripts come in zip-packages, open 'em in WinZip for Windows9x/NT, that supports long filenames, check all filenames and folder names (no filenames like longfi~1.dat should appear)

2nd step, rather complex sometimes, is to set all variables as mentioned in the script's manual

Usually most problems come with the full path to script. If you have telnet access to your server (usually that's true for serious hosting providers) log in and type 'pwd' you will receive the full path to your home folder (something like /usr/ web/ users/ thatdude/) in most cases add /domainname/cgi-bin /scriptname/ to that path and your will be ok, but you can always ask your system administrator, it will take exactly 2 seconds to type an answer in icq window and press Alt-S :-)

Next step is uploading, make sure you are using ASCII mode for all cgi files (same for .pm, .txt. usually all files in cgi-package are in text format, but data files (.dat) can be in binary one (check script's manual to find out this). Graphic files like .jpg, .gif & .png always are in binary mode, archives .zip, .gz are too

Very important step, 90% of all problems are here. Set proper permissions. Usually manual gives you full information about this, but keep in mind that all cgi scripts should have 755 mode, data files 666 and folders 777. this will work in 99.5% of the cases.

To set permissions you can use telnet and 'chmod' shell command, but I recommend to use FTP client that can set chmod from remote system without telnet logon at all. CuteFTP and FAR built-in FTP client do it ok.

Final step. Make sure you have done all above steps properly. If your script has an install feature with autocheck feature - very good, you can make sure that everything is ok.

Now some common problems:

500 server error: two possible reasons - script was uploaded in binary mode or you've screwed up the permissions. Please note that sometimes this error can appear due to improper error handling in the script, like wrong setup, etc. so keep in mind that 500 error is rather common, but always make sure that the script was uploaded in ASCII mode and proper permissions were set.

Various script error messages - check your script manual for this.

This will help you to save money on doctors :)

Hope the word "cgi" won't lead to a headache to often ... lol

Good Luck,
Aleck

 
"Advertising is the rattling of a stick inside a swill bucket."
George Orwell
 
Previous PageNext Page

© 2001-2002 EA Ventures. All rights reserved.