1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2009
    Rep Power

    Configure IIS7 to run php within html

    Hi. I'm fairly new to server management, so bear with me (and sory for my english). I'm have successfuly installed and configured Windows Web Server 2008 R2/IIs7 and PHP 5.3.5 (I know it works because I can run *.php files/scripts just fine), but I have one problem. It doesn't run php scripts within *.html files. Let's consider the following code:
    <?php echo("Hello ");?>
    The output to the above code is:
    <?php echo("Hello ");?> world!
    Does anyone know how to configure IIS to handle PHP within HTML? Thank you in advance. Bye.
  2. #2
  3. Lord of the Dance
    Devshed Specialist (4000 - 4499 posts)

    Join Date
    Oct 2003
    Rep Power
    You can rename all .html files to .php - myFile.html is renamed to myFile.php.

    From a performance and compatibility point (e.g. have to move to another hosting provider) , it is not recommended to parse .html as PHP files.
  4. #3
  5. No Profile Picture
    Grumpier old Moderator
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jun 2003
    Rep Power
    If it's your own server you can visit the IIS setup that maps file extensions to handlers and change to have .html go through the php interpreter. But unless you really need to make this change I'd recommend against it.
    Doug G
    I've never been able to appreciate the sublime arrogance of folks who feel they were put on earth just to save other folks from themselves .." - Donald Hamilton

IMN logo majestic logo threadwatch logo seochat tools logo