httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Denis Peuziat <dpeuz...@amadeus.com>
Subject Re: [users@httpd] problem with perl script and Apache
Date Mon, 02 Jun 2008 14:51:38 GMT
"Krist van Besien" <krist.vanbesien@gmail.com> 
To
users@httpd.apache.org
cc

Subject
Re: [users@httpd] problem with perl script and Apache





"Krist van Besien" <krist.vanbesien@gmail.com> 
Please respond to : users@httpd.apache.org
02/06/2008 16:31


On Mon, Jun 2, 2008 at 2:44 PM, Octavian Rasnita <orasnita@gmail.com> 
wrote:

> At the beginning of the output generated by your script, you should do:
>
> print "Content-Type: text/html\n\n";

>Exactly.
>
>A minimal script would be:
>
>#!/usr/bin/perl
>
>print "Content-type: text/html\n\n";
>print <<HTML;
><html>
><body>
><p>Hello World</p>
></body>
>HTML
>exit;
>
>And this would, when executed on the command line, output:
>
>Content-Type: text/html
>
><html>
><body>
><p>Hello World</p>
></body>
>
>The Content-Type is importan, because it allows your apache server to
>know what the script will output. (CGI scripts can produce whatever
>you fancy. I have scripts that produce PNGs and SVGs for example...)

I solved the issue :o). I was really puzzled that the script would execute 
properly locally... and you put me on the right track with your last 
reply! I executed it again and found out that there was a flaw within the 
script that produced an output before the "Content-type..." line
I modified it and everything now works properly!

Thanks for your answers 

Denis



Mime
View raw message