| Article: |
Apache Web-Serving with Mac OS X: Part 3 | |
| Subject: | php AND ssi? | |
| Date: | 2003-03-26 06:01:55 | |
| From: | anonymous2 | |
|
My SSI's work well if I have a .shtml or a .html page but once I try to add .php to: Addhandler server-parsed .shtml .html .php
|
||
Showing messages 1 through 2 of 2.
-
php AND ssi?
2003-03-26 06:19:31 Morbus Iff |
[View]
-
php AND ssi?
2003-04-02 03:37:25 anonymous2 [View]
I'm Just starting out with PHP, but it strikes me as logical to use the PHP function include() when wanting to include files.
EG.
<?php include("include_this_file.html"); ?>
(of course the icluded file could also be .php)
Another option is that it appears that you can include .php files into .shtml files, and the PHP gets Parsed correctly.
EG.
<!--#include file="info.php"-->
I've tried it with a sample and works fine, though am unsure of Pro's/Con's within a larger web application.
Hope this helps.



Ignoring the above, it sounds like .php (which may or may not have been associated with mod_php) is being handled by the SSI part of Apache, and since no MIME-type has been defined for .php, your browser doesn't know what to do with it. You'll want to add .php to:
AddType text/html .shtml
But, remember, you can't use PHP and SSI in the same file. It's one or the other. Apache 2.0 purportedly will allow you to do this by setting up filters, but I've yet to experiment with it.