Jump to content

Configure IIS7 to run php within html


speedy_rudolf

Recommended Posts

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 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:

<html>
<head><title>TITLE</title></head>
<body>
<?php echo("Hello ");?>
world!
</body>
</html>

The output to the above code is:

<?php echo("Hello ");?> world!

Does anyone know how to solve this problem? Thank you in advance. Bye.

Link to comment
Share on other sites

Are you using IIS or Apache? If you are using IIS, it is probably configured so that PHP handles only pages that end with the .php extension. If your page above is named someName.html, IIS won't know that PHP should handle the page. Not sure if Apache works similarly. My suggestion: try naming your page with .php extension and see what happens.

 

Hope that helps.

 

-Brian

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.