Web server (thttpd)

ID #1119

CGI scripts (perl) not working?

This is a common mistake on FREESCO, when files are FTP-ed or copied using SAMBA, they are in so called DOS text format. DOS uses CR codes (^M) at end of line, FREESCO does not.

The effect is that f.i. the first line of a perl CGI script looks like this:

#!/usr/bin/perl^M

this confuses FREESCO because it cannot locate the perl interpreter!

Howto check for ^M codes in the CGI script file(s)?
Load the file(s) in 'edit' and look if the last character is printed as a bold capital M
If you see this, then the file contains ^M codes.

Use the fromdos tool to strip these ^M codes from the file(s).

On FREESCO 03x the command is:

fromdos < original.cgi > stripped.cgi

Or if you have installed fromdos (either from FREESCOSoft) or in utils_1.0_dingetje package, then you can simply use:

fromdos *.cgi

Last update: 2004-11-28 02:05
Author: dingetje
Revision: 1.0

Print this record Print this record
Send to a friend Send to a friend
Show this as PDF file Show this as PDF file
Export as XML-File Export as XML-File

Please rate this entry:

Average rating: 3.75 from 5 (4 Votes )

completely useless 1 2 3 4 5 most valuable

You cannot comment on this entry