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

6
  • is the file in /htdocs? Commented May 3, 2013 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. Commented May 3, 2013 at 19:48
  • Does the file have the .php extension? Commented May 3, 2013 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. Commented May 3, 2013 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. Commented May 3, 2013 at 19:58

1 Answer 1

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

Sign up to request clarification or add additional context in comments.

1 Comment

This is the answer. I was accessing the file using the file path in chrome instead of using 'localhost/mywebfolders/... Thanks very much.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.