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

when I go to the page it tries and D-load it like a file. How do I have SSI on .php pages?

Thanks much,

Main Topics Oldest First

Showing messages 1 through 1 of 1.

  • Morbus Iff photo php AND ssi?
    2003-03-26 06:19:31  Morbus Iff | O'Reilly Author [View]

    If you're trying to get SSI and PHP working together through one .php file, that's impossible in Apache 1.3. You can either have PHP in .php files, or SSI in .php files - you can't mix and match them.

    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.