Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I am using IIS7 on Windows Server 2008r2. I have recently installed php and IIS. I am trying to browse to the index.php but it returns a blank page. It loads the favicon and the header of my page. When I load an info.php file it is not blank.

If I disable Anonymus Authentication it the same index.php returns IIS 7.5 Detailed Error - 401.2 - Unauthorized.

What is strange is I installed this exact code onto another fresh IIS install I just did and it loads fine. Permissions for the directory are the same for both.

share|improve this question
1  
Anything of note in the IIS logs? –  uSlackr Jan 9 '12 at 16:47

5 Answers 5

From the IIS click or select the site folder then in top right corner click permission

under security add "Network Service" which is equivalent of IISUSER

then restart the site and try

share|improve this answer

This Microsoft KB article is for IIS7, but works for 7.5 as well. I would recommend making your way through the article, and if your problem persists, please provide some screenshots of the errors (either in browser, or IIS log)

http://support.microsoft.com/kb/942043/

You also might want to just open a command prompt and type 'iisreset /force' to see if that resolves the issue. If not, go through the article mentioned above.

Let me know if you need any more information, or if that didn't help!

share|improve this answer

The most simple test you can do is create a text file called text.txt, put 'Hello World' in it, and then put it at the root. If the web server can present this file, then try the same thing with a HTML file. If these files can be served, you have some web site (permissions or IIS) tweaks/configs to work on. If not, you may want to re-install IIS/PHP from the ground up.

It's more than likely something with your PHP install but you need to rule if the website can serve up basic files first.

share|improve this answer

The easiest way to run PHP on an IIS server is to use the Web Platform Installer (see Installer link). This will step by step install PHP and ensure that it is able to run on your server/workstation.

Then I would recommend creating a php page with the following code to test:

<html>
<head>
<title>PHP Test</title>
</head>
<body>
<?php phpinfo(); ?>
</body>
</html>

See http://php.iis.net/ for more info

share|improve this answer

PHP Manager for IIS

This is pretty good about letting you use whatever version of PHP you want and handling all the necessary bindings and what not for you.

That said, I would verify that PHP is functioning properly by calling it from the command line targeting your index.php file and make sure that you get the output you'd expect there. That will tell you whether the issue is with the PHP implementation or IIS.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.