include .php in .html Windows IIS server

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
scott_T
Forum Newbie
Posts: 5
Joined: Sun Jul 16, 2006 12:57 pm

include .php in .html Windows IIS server

Post 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>
User avatar
Burrito
Spockulator
Posts: 4715
Joined: Wed Feb 04, 2004 8:15 pm
Location: Eden, Utah

Post by Burrito »

you'll have to map the html extension to either the dll (isapi) or the exe (cgi) for php.
scott_T
Forum Newbie
Posts: 5
Joined: Sun Jul 16, 2006 12:57 pm

Post 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.
User avatar
Burrito
Spockulator
Posts: 4715
Joined: Wed Feb 04, 2004 8:15 pm
Location: Eden, Utah

Post 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
scott_T
Forum Newbie
Posts: 5
Joined: Sun Jul 16, 2006 12:57 pm

Post by scott_T »

rt click on my website? where do i do this at?
User avatar
Burrito
Spockulator
Posts: 4715
Joined: Wed Feb 04, 2004 8:15 pm
Location: Eden, Utah

Post 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.
scott_T
Forum Newbie
Posts: 5
Joined: Sun Jul 16, 2006 12:57 pm

Post by scott_T »

Im sorry, how/where do i "open the IIS administrative console"?
User avatar
Burrito
Spockulator
Posts: 4715
Joined: Wed Feb 04, 2004 8:15 pm
Location: Eden, Utah

Post 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.
scott_T
Forum Newbie
Posts: 5
Joined: Sun Jul 16, 2006 12:57 pm

Post by scott_T »

Thank You
Post Reply