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

Darcy Brodie darcy at canasc.ca
Tue Dec 29 10:12:42 PST 2009


Dean Mah wrote:
>
> 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

Okay, progress.  Adding this line to my sample scripts allows them to 
run correctly.  However, still no change to the batchsetup.cgi file

Darcy

> Dean




More information about the clug-talk mailing list