Christopher Juckins

SysAdmin Tips, Tricks and other Software Tools

User Tools

Site Tools


ssi_includes_with_php_and_vice-versa

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
ssi_includes_with_php_and_vice-versa [2009/01/06 10:06]
juckins created
ssi_includes_with_php_and_vice-versa [2009/01/06 11:50]
juckins
Line 15: Line 15:
 ------- -------
  
-To allow a .php file to include .shtml files, edit /​etc/​php.ini with the following changes:+To allow a .php file to include .shtml files, ​you may need to edit /​etc/​php.ini with the following changes:
 <​code>​ <​code>​
-include_path = /home/httpadm/docs +include_path = /path/to/docs 
-doc_root = /home/httpadm/docs+doc_root = /path/to/docs
 </​code>​ </​code>​
 service httpd restart service httpd restart
Line 24: Line 24:
 And use the following type of syntax in the .php file: And use the following type of syntax in the .php file:
 <​code>​ <​code>​
-<?php include("​templates/​footer.shtml"​);​ ?>+<?php include("​../templates/​footer.shtml"​);​ ?>
 </​code>​ </​code>​
 +Note the leading “../” in the include path.
 The include file does not have to be .shtml (could be .html or .php, obviously) 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