IIS 7 and Above
PHP pages blank
Last post Dec 14, 2008 09:45 PM by kkehoe
Dec 13, 2008 05:29 PM|kkehoe|LINK
First off, I'm a newbie to IIS and PHP. I know this issue has been beaten to death in one form or another because I've spent 2 days reading about others with the same problem, but none of the solutions have worked for me. :( Here's the story...
To display PHP web pages locally using FastCGI for testing purposes
"<?php phpinfo(); ?>" test file displays a blank page
Vista x86 Ultimate SP1 w/IIS7 and KB954946 update installed
PHP 5.2.8 (.ZIP) non-thread-safe installed in C:\PHP
Set up per
Here's what I know:
IISSTART.HTM displays properly
"php - info" command line does return information
PHP.INI (located in C:\PHP) modified only as noted in the above link, and to enable error reporting
View > Source on the blank page does not display the raw script. All you see is...<BODY></BODY>...
I've added PATH and PHPRC Environment Variables in Windows
FastCgi Module is configured w/Script access in IIS Module Mapping - it's Enabled and ahead of StaticFile in the Ordered List
"Everyone" has read/execute permissions on C:\PHP
I can't find anything obvious in PHP/IIS/Windows error logs
PHP-CGI.EXE never shows in Task Manager unless executed directly
Here's what I think:
IIS is trying to call PHP-CGI.EXE but it's not running, so nothing gets passed back to IIS. Am I correct in assuming that you'd see the raw PHP in View > Source if there was a configuration issue in IIS and it wasn't able to pass the code off?
Any idea what I'm dealing with here? Permissions? Paths? Something else? Help!
Dec 14, 2008 01:58 AM|thomad|LINK
Does the following work?
c:\php\php.exe c:\inetpub\wwwroot\<name of your php file>
Dec 14, 2008 09:15 AM|kkehoe|LINK
I would say no, it doesn't work. All the output goes to a Command prompt window. I assume it shouldn't.
My phpinfo.php test file appears to return the same information as the "php -info" command.
Any other .php file just echos the raw PHP code to the Command window, except for some errors regarding includes. It appears to be looking at C:\PHP\INCLUDES for those includes instead of C:\INETPUB\WWWROOT\<sitefolder>\INCLUDES where they're actually located.
On the plus side, at least it's an actual error to work with!! Could that be an indication of a larger PATH issue that's causing my whole problem?
Here's one such error from the log:
[14-Dec-2008 10:18:24] PHP Warning: include(includes/nav_upper.php): failed to open stream: No such file or directory in C:\inetpub\wwwroot\purpleday\includes\header.php on line 40
[14-Dec-2008 10:18:24] PHP Warning: include(): Failed opening 'includes/nav_upper.php' for inclusion (include_path='.;c:\php\includes') in C:\inetpub\wwwroot\purpleday\includes\header.php on line 40
Both those files render correctly in the browser if uploaded to my hosting server.
Dec 14, 2008 09:45 PM|kkehoe|LINK
Got it sorted out!! Evidently I hadn't been checking the order of the Handler Mappings in the right place or in all the places necessary! I went up the whole tree in IIS and found PHP ahead of PHP via FastCGI in a couple of spots. Once I swapped those
around everything perked right up!
Thanks to anyone who's given this issue some thought.