February 12th, 2011, 12:58 AM
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:
The output to the above code is:
<?php echo("Hello ");?>
Does anyone know how to configure IIS to handle PHP within HTML? Thank you in advance. Bye.
February 12th, 2011, 06:56 AM
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.
February 12th, 2011, 03:26 PM
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.
The man who doesn't read good books has no advantage over the man who can't read them.