in reply to Re: Mod Perl Content Header Output
in thread Mod Perl Content Header Output

I set the PerlSendHeader to 'off' in my httpd.conf configuration but i am still getting a content-type header printed out by apache. Under mod_perl this test script outputs to my browser the following:
Content-type:image/gif
Here's my test.cgi script which is inside my mod_perl directory (/home/httpd/perl/).
#!/usr/bin/perl -w use strict; if ($ENV{'MOD_PERL'}){ print "Content-type:image/gif\n\n"; #my image output will go here }else{ print "Content-type:text/html\n\n"; print "MOD_PERL is off"; } exit;
And here's my httpd.conf settings.
<IfModule mod_perl.c> Alias /perl/ /home/httpd/perl/ <Location /perl> SetHandler perl-script PerlHandler Apache::Registry Options +ExecCGI PerlSendHeader off </Location> </IfModule>
I restarted apache and did a killall -HUP apache. As you can see by the output of the script, mod_perl is working. I'm running mod_perl/1.23. Anybody have any ideas on how i can fix this? I'd like to be able to output more than just text/html files with mod_perl.

thanks monks,
james

p.s. i tried "PerlSendHeader off" and "PerlSendHeader Off"

Replies are listed 'Best First'.
Re: mod_perl Content Header Output with PerlSendHeader off
by lestrrat (Deacon) on Oct 23, 2002 at 10:16 UTC

    It's the other way around. PerlSendHeader should be *ON*. From the ModPerl documentation:

    The PerlSendHeader On directive tells mod_perl to intercept anything that looks like a header line (such as Content-Type: text/plain) and automatically turn it into a correctly formatted HTTP/1.0 header, the same way it happens with CGI scripts running under mod_cgi. This allows you to keep your CGI scripts unmodified.
Re: mod_perl Content Header Output with PerlSendHeader off
by true (Pilgrim) on Oct 23, 2002 at 10:55 UTC
    oh crap, you are absolutely right. lol. May my stupidity be a shining beacon for those who follow in my footsteps.
    thanks very much.
    jtrue