0

I am using Windows 7 with IIS 7. I am trying to get started with PHP. I have performed the following:

  1. Installed PHP using the web platform installer
  2. Verified that PHP is installed by using 'Check phpinfo()' on the PHP manager within the root folder of my website (all on my local machine)

When I test to see if PHP is working with a simple HTML page as follows:

<!DOCTYPE html>
<html>
<body>

<?php
echo "My first PHP script!";
?>  

</body>
</html>

Chrome does not render anything. I am expecting to see the text.

Can anyone advise me how to proceed?

Thanks

MrHopko
  • 879
  • 1
  • 7
  • 16
  • is the file in /htdocs? –  May 03 '13 at 19:44
  • What's the file extension? If not set up for PHP to handle `.html` files, then it won't be parsed with PHP. – Jon May 03 '13 at 19:48
  • Does the file have the `.php` extension? – Mike Perrenoud May 03 '13 at 19:48
  • additional question. is it on your local server? if yes i recommend to use wamp or xampp. It's quite handy for php files. – ROMMEL May 03 '13 at 19:50
  • Rename the file with a `.php` extension, or figure out how to force `.html` pages through the PHP processor. I don't remember how, but I wouldn't suggest it in IIS because IIS does enough weird shit on its own without screwing with the handler mappings. – Sammitch May 03 '13 at 19:58
  • The file does have php extension. The setup is on my local server. I am trying to get it working with IIS. – MrHopko May 03 '13 at 20:02

1 Answers1

1

If this problem ocurrs check:

  • Does the file have extension .php?
  • Does the path is correct on the server?

Its is important to remember that I am assuming that you have a server with php suport activated. On the server, the default extension to PHP files is .php, but you can check with the administrator to garantee.

You can also check if the error log is enable. When it is disabled, and the code has a syntax error, nothing is showed on the screen. You can read more here: https://stackoverflow.com/a/5438125/1735789

  • This is the answer. I was accessing the file using the file path in chrome instead of using 'localhost/mywebfolders/... Thanks very much. – MrHopko May 03 '13 at 20:15