Page 1 of 1

include .php in .html Windows IIS server

Posted: Sun Jul 16, 2006 1:04 pm
by scott_T
I was trying to include a php file into a file with the .html extension. Not with the .php extension.

DOESNT work:
http://www.pridenutrition.com/Test.html

DOES work:
http://www.hi-topswrigleyville.com/Test.html

The first is running on a Windows IIS based system and one is running on Unix.

Is this possible on a Windows IIS server? (i.e. Is there a fix to the one that DOESNT work.) Why does one work and not the other?

Here is my code (the same code was used on both servers):

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<h1>
<?php echo '<p>Hello World</p>'; ?>
</h1>
</body>
</html>

Posted: Sun Jul 16, 2006 1:20 pm
by Burrito
you'll have to map the html extension to either the dll (isapi) or the exe (cgi) for php.

Posted: Sun Jul 16, 2006 1:26 pm
by scott_T
Not to be annoying, but I know nothing about what you just said. It would be cool if you could elaborate on what some of what you just said real quick just so I have an idea about what was meant. An answer exact answer to the code isnt needed, but I am just learning about all this server stuff. Like I said I know its annoying, but I am new to that end of things.

Posted: Sun Jul 16, 2006 1:31 pm
by Burrito
ok open the IIS MMC.

rt click on your web site, select properties, click the home directory tab, click configuration, click add, browse to your php.exe or your *isapi.dll, add the .html extension click ok.

if using isapi, you'll probably need to restart IIS, if not, you should be good to do.

Note: I've never tried this with the .html extension so I"m not sure what effect it will have as that extension is probably already mapped somewhere else. 8O

Posted: Sun Jul 16, 2006 1:36 pm
by scott_T
rt click on my website? where do i do this at?

Posted: Sun Jul 16, 2006 1:38 pm
by Burrito
open the IIS administrative console.

hit the plus sign next to your machine name
then drill into it until you see your web site.

Posted: Sun Jul 16, 2006 1:42 pm
by scott_T
Im sorry, how/where do i "open the IIS administrative console"?

Posted: Sun Jul 16, 2006 2:04 pm
by Burrito
either rt click my computer and select manage, then go down to services at the bottom, or go to administrative tools --> internet infomration services.

Posted: Sun Jul 16, 2006 3:01 pm
by scott_T
Thank You