views:

832

answers:

1

Hi,

I've recently setup PHP 5.2.9-2 on IIS 7 on Windows Server 2008 SP2. Most everything seems to be working fine -- PHP is running great, just about all PHP code runs perfectly... EXCEPT for default pages. Any default document (index.php) is not interpreted by PHP and the page merely displays the underlying PHP code in the browser.

Best Example -- two pages (index.php + phpinfo.php) with the exact same code: <?php phpinfo(); ?>

http://mysite.com/test/ --> "<?php phpinfo(); ?>" (displayed in plaintext) http://mysite.com/test/index.php --> "<?php phpinfo(); ?>" (displayed in plaintext)

http://mysite.com/test/phpinfo.php --> Proper "blue/gray" PHP Info page

What's strange is: the root of my site (http://mysite.com) interprets PHP just fine via its default document, index.php.

I've set up the site via the "best practices" (http://iis.net/fastcgi/configuration). PHP is running via FastCGI. Index.php is the only default document type. "Mysite" is housed in a subdirectory off the root drive, and IUSR has permissions throughout. Handler Mappings shows PHP via FastCGI as the top entry for *.php.

Been Googling this for hours, have seen others with very similar problems, but no resolution.

Thanks!

+1  A: 

I noticed that someone had a similar issue here that was caused by having moved the document root.

Matt
Thanks for the link. I tried moving the site from C:\web\mysite.com\ to C:\inetpub\wwwroot\mysite.com -- phpinfo.php still works, index.php now shows nothing at all - displayed or source...
Sean O
It has to be a configuration option somewhere Sean. Double check your index page configuration now you have moved the site - you shouldnt be getting a blank page (check the logs for an error maybe)
Matt