Using both Apache SSI and PHP

Giganews Newsgroups
Subject: Using both Apache SSI and PHP
Posted by:  lukinagin (jsanta…@csulb.edu)
Date: Mon, 21 Sep 2009

I'm hoping someone out there can help me out with this issue.  I have
a web developer who is attempting to build a page that uses both
Apache server side includes and PHP code.  I have SSI's enabled on my
Apache 2.0.63 instance using the following httpd.conf lines:

AddType text/html .shtml
AddHandler server-parsed .shtml .html .htm
AddOutputFilter INCLUDES .shtml .html

This works great for shtml, html and htm files.  My web developer,
however, is using files with a .php extension for his site.  These
pages execute the PHP properly (version 5.2.9 is installed on the
system) but do not include the server side includes.  When I attempt
to edit my SSI lines to:

AddType text/html .shtml .php
AddHandler server-parsed .shtml .html .htm .php
AddOutputFilter INCLUDES .shtml .html .php

The server side includes work fine but the PHP code does not execute.
I can't seem to find a way to have BOTH Apache server side includes
and PHP code execute correctly.  Does anyone know how to do this?

BTW - I realize I can have the web developer change his code to use
PHP include calls but we are talking about a large number of pages
here so I am hoping to find another alternative for him.

Thank you in advance!

Replies