Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 17 Oct 2001 10:14:04 -0500
From:      "Thill, Daniel Gerard (UMR-Student)" <thill@umr.edu>
To:        "'freebsd-questions@freebsd.org'" <freebsd-questions@freebsd.org>
Cc:        "'cjcarri@earthlink.net'" <cjcarri@earthlink.net>
Subject:   RE: One CGI script won't run - permission problemss?? 
Message-ID:  <6CAC36C3427CEB45A4A6DF0FBDABA56D950977@umr-mail03.cc.umr.edu>

next in thread | raw e-mail | index | archive | help
> I checked /var/log/httpd-error.log, and found the 
> messages "No such file or
> directory: exec of 
> /usr/local/www/cgi-bin/nutest1.pl failed" and "Premature
> end of script headers usr/local/www/cgi-bin/nutest1.pl"


I'm pretty sure it's the line-endings in the file.  *NIX's store text files
with a linefeed (LF) as the end of line marker.  Windows uses a carriage
return  as well (CRLF).  When you copy them over to *NIX, sometimes things
will work, sometimes they won't.  (If you see ^M's at the end of every line
in your text editor, you know for sure that it was made under Windows).  I
know on solaris, I used "dos2unix" to convert file.  I'm sure that FreeBSD
has an equivalent, I just haven't had to use it yet :) 

You can also just write a quick perl script that does a "s/\r\n/\n/" on each
line and rewrites the file.  Run this from the your FreeBSD machine.  The
Win32 port of Perl (well, at least Activestate's) write "\n" as CRLF instead
of LF.  

Also, make sure that there is at least one blank line after the shebang
line, ie:


--------------------top of file
#!/path/to/perl

#first line of perl code
# etc

-------------------------------

Let me know if you need any help with the perl code...

-dan

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?6CAC36C3427CEB45A4A6DF0FBDABA56D950977>