> >   Basically, it all boils down to the fact that once an SSI directive
> >   with #EXEC CGI is parsed, the document fails to parse any further
> >   SSI directives *if the script to be executed has a perl-script 
> >   handler.*
> 
> from the manpage:
> 
> * When chaining handlers via Apache::Filter, if you use <!--#include...-->
> or <!--#exec cgi=...-->, then Apache::SSI must be the last filter in the
> chain.  This is because Apache::SSI uses $r->lookup_uri(...)->run to
> include the files, and this sends the output through C's stdout rather than 
> Perl's STDOUT.  Thus Apache::Filter can't catch it and filter it.

I'm not sure if it's the same problem as I was having (I was using
Apache::OutputChain instead because it seems to be more memory-friendly), 
but switching to Apache::Filter with Apache::SSI *almost* works:

   <Files ~ "\.phtml$">
      SetHandler perl-script
      PerlSetVar Filter On
      PerlModule Apache::Filter Apache::RegistryFilter Apache::SSI
      PerlHandler Apache::RegistryFilter Apache::SSI
   </Files>

The problem now is that everything is sent out encoded as text/plain.  If
I add a line like this

   AddType text/html .phtml

The problem goes away and everything is hunky-dory.  But that seems wrong.
Is it?  Am I missing something?  Turning PerlSendHeader On or Off doesn't 
change things any.

> for a way around this, see recipe 10.2 in the mod_perl developer's
> cookbook:
> 
> http://www.modperlcookbook.org/code/ch10/Cookbook/SSI.pm

Cool, thanks!  I'll try to get Apache::Filter working first, but if that
doesn't work, it's good to have a fallback.

That looks like a great resource.  I'm definitely ordering a copy!

> 
> you can also try Apache::FakeSSI (includes with Apache::SSI) but I haven't
> tried it myself.

Does anyone know how to force Apache::SSIChain to use Apache::FakeSSI 
instead of Apache::SSI?  It was giving me fits.

Chris

-- 
Reporting bugs: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html

Reply via email to