[clug-talk] Apache web server with cgi / perl scipts

Dean Mah dean.mah at gmail.com
Tue Dec 29 07:17:32 PST 2009


On 2009-12-28, at 10:06 PM, Darcy Brodie <darcy at canasc.ca> wrote:

> yes, I have.  What they are saying for the test scripts is;
>    malformed header from script.  Bad header=This is a test so see  
> if this works : darcy2.pl
>
> what I have in that script is
>
> #!/usr/bin/perl
> print"This is a test to see if this works \n";
>
> It works fine from the command line, but not from the browser
>
>
> From the script for the password program, when I run it from the  
> browser, I get
>    (2)No such file or directory: exec of '/var/www/cgi-bin/ 
> batchsetup.cgi' failed
>    Premature end of script headers: batchsetup.cgi
>
>
> I'm so confused about this,
> Darcy

In your script, you need to send headers before anything else. Try  
adding print "Content-type: text/plain\n\n"; before your print  
statement.

Dean



More information about the clug-talk mailing list