Christopher Juckins

SysAdmin Tips, Tricks and other Software Tools

User Tools

Site Tools


ssi_includes_with_php_and_vice-versa

To allow an .shtml file to parse a .php include:

<Directory "/path/to/directory/">
    Options FollowSymLinks Includes Indexes
    IndexOptions +NameWidth=*
</Directory>

Then in the .shtml file use something like this:

<!--#include virtual="/directory/footer.php" -->

To allow a .php file to include .shtml files, you may need to edit /etc/php.ini with the following changes:

include_path = /path/to/docs
doc_root = /path/to/docs

service httpd restart

And use the following type of syntax in the .php file:

<?php include("../templates/footer.shtml"); ?>

Note the leading “../” in the include path. The include file does not have to be .shtml (could be .html or .php, obviously)

ssi_includes_with_php_and_vice-versa.txt · Last modified: 2009/01/06 11:50 by juckins