speedy_rudolf Posted February 11, 2011 Share Posted February 11, 2011 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. Quote Link to comment https://forums.phpfreaks.com/topic/227376-configure-iis7-to-run-php-within-html/ Share on other sites More sharing options...
Brian Swan Posted February 11, 2011 Share Posted February 11, 2011 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 Quote Link to comment https://forums.phpfreaks.com/topic/227376-configure-iis7-to-run-php-within-html/#findComment-1172788 Share on other sites More sharing options...
speedy_rudolf Posted February 11, 2011 Author Share Posted February 11, 2011 Yes, I am using IIS. I have tried naming it *.php, that just gives me a "500" error. As for the configuration, how can I configure it so it also handles scripts within html? (I haven't tried inserting a handler for html, but I guess it would also give me the "500" error.) Quote Link to comment https://forums.phpfreaks.com/topic/227376-configure-iis7-to-run-php-within-html/#findComment-1172808 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.