[thelist] SSI and PHP mutually exclusive?

Simon Willison cs1spw at bath.ac.uk
Sat Mar 16 03:40:01 CST 2002


hpoe wrote:

> I'd like to know if there's a way to use both SSI and PHP on the same
> file.
> This would really save me a lot of trouble :)  The idea would be to pull
> something into my page with SSI and then have it parsed by PHP. Any
> chance
> this might work - and if so, how?

To my knowledge there's no way to do this with Apache as it stands. I
think Apache 2 (currently available as beta software) has the ability to
run modules on each other's output (meaning it could run SSI on
something, then send it to PHP or vice versa) but it still sounds like a
pretty dodgy thing to do for both performance and code simplicity
reasons. Here's the quote:

Filtering
    Apache modules may now be written as filters which act on the stream
of content as it is
    delivered to or from the server. This allows, for example, the
output of CGI scripts to
    be parsed for Server Side Include directives using the INCLUDES
filter in mod_include.

(from http://httpd.apache.org/docs-2.0/new_features_2_0.html )

You're much better off just using PHP's include function instead:
www.php.net/include




More information about the thelist mailing list