locked
Yet another problem with IIS 6, PHP 5.2.12, and FastCGI RRS feed

  • Question

  • User1094109092 posted

    I've tried desperately to get PHP to work on my web server (IIS 6, running Windows Server 2003 Standard SP2). After installing all of the components and configuring IIS, I am unable to browse to PHP files. IE returns an "Internet Explorer could not display the webpage" error.

    I've tried using the Web Platform Installer and installing the FastCGI and PHP components manually. I've tried troubleshooting it using Don Raman's blog post on troubleshooting PHP. I can successfully execute "php-cgi.exe -v" and "php-cgi.exe C:\Inetpub\wwwroot\test.php" with no errors, and PHP properly displays the result.

    My fcgiext.ini looks like every canonical example I've seen on the web.

    It looks like the document extention .php correctly maps to C:\WINDOWS\system32\inetsrv\fcgiext.dll, with the GET, HEAD, and POST, verbs all mapped.

    I can successfully browse to html pages served by the same server.

    What am I missing?

    Thursday, December 17, 2009 1:01 PM

All replies

  • User-1405480850 posted

    Hi,

    How did you get PHP 5.2.12 from WPI? WPI supports PHP 5.2.11 as of now. Please get your machine into a clean state. The biggest mistake people make is to try all sorts of different MSI and all when one method fails. Please uninstall PHP completely and also delete the PHP folder present in C:\Program Files folder. If possible remove FastCGI too and also delete fcgiext.ini file. No trace of PHP/FastCGI on the machine.

    Now invoke WPI and try installing PHP. It should pull FastCGI as a dependency. If it doesn't stop. This means FastCGI is not uninstalled properly. Please uninstall FastCGI first. Once WPI shows FastCGI as dependency, please install PHP. Now if PHP doesn't work, follow the troubleshooting blog and let me know what is missing.

    All uninstallation should be done by using Control panel/Add-Remove Programs. If the machine was having PHP installed any time, please delete that and also please delete any handler which might be associated with it using 'inetmgr'

    Thanks,

    Don.

    Thursday, December 17, 2009 1:10 PM
  • User1094109092 posted

    Okay, I've done that. Uninstalled both PHP and FastCGI. Made sure there was no trace of either on the machine. No .php mapping was present in IIS. No FastCGI extension was registered in IIS. Installed using the WPI, selecting only PHP (FastCGI was pulled in as a dependency). Went through the steps in the troubleshooting blog (ran adsutil.vbs scripts, ran php-cgi.exe -v, ran php-cgi.exe C:\Inetpub\wwwroot\test.php, checked the fcgiext.ini, verified the php.ini). Still same result. Other suggestions?

    Thursday, December 17, 2009 1:48 PM
  • User-1405480850 posted

    Hi,

    Can you be little bit detail please. Please paste the output of all the commands, PHP file you are trying to run, run the same file using php-cgi.exe on command prompt and paste the result, where have you kept the file in your WEB root, how are you accesing it in the browser etc.

    Thanks,

    Don.

    Thursday, December 17, 2009 1:53 PM
  • User1094109092 posted

    Here are the adsutil commands and output:

    cscript.exe C:\inetpub\AdminScripts\adsutil.vbs GET w3svc/DefaultDoc

    Microsoft (R) Windows Script Host Version 5.6
    Copyright (C) Microsoft Corporation 1996-2001. All rights reserved.

    DefaultDoc                      : (STRING) "Default.aspx,Default.htm,Default.asp,index.htm,index.php"

    cscript.exe C:\inetpub\AdminScripts\adsutil.vbs GET w3svc/ScriptMaps | findstr php

      ".php,C:\WINDOWS\system32\inetsrv\fcgiext.dll,5,GET,HEAD,POST"

    Here is the PHP file I am attempting to run (file name is test.php):

    <?php
    echo 'This is my first PHP program';
    ?>

    Running the php-cgi.exe yields the following result:

    C:\Program Files\PHP>php-cgi.exe C:\Inetpub\wwwroot\test.php
    X-Powered-By: PHP/5.2.11
    Content-type: text/html

    This is my first PHP program

    C:\Inetpub\wwwroot is the default website root directory. I am attempting to access this in the browser using http://localhost/test.php. Also, using the computer name instead of "localhost" likewise does not work. Browsing to http://localhost does, however, bring up the default html page.

    What other information can I provide?

    Thursday, December 17, 2009 2:09 PM
  • User-1405480850 posted

    What error you are getting? Please turn off IE 'Show frendly HTTP error' and let me know what error you are seeing?

    Thanks,

    Don.

    Thursday, December 17, 2009 2:17 PM
  • User1094109092 posted

    I get "Internet Explorer cannot display the webpage". That is with "Show friendly HTTP errors" disabled.

    Thursday, December 17, 2009 2:24 PM
  • User-1405480850 posted

    Sorry, but this error is not an IIS error instead this is coming from the browser. Seems something else is wrong. You will need to tell me the exact error you are getting from IIS.

    Can you ensure using 'inetmgr' that your Default Web Site is mapped to port 80 and physical path C:\inetpub\wwwroot.

    Thanks,

    Don.

    Thursday, December 17, 2009 2:32 PM
  • User1094109092 posted

    How can I tell what error is coming from IIS? This is all I have to go on. It almost seems like IIS is forcibly closing the connection.

    Yes, Default Web Site is port 80, and mapped to C:\inetpub\wwwroot.

    Thursday, December 17, 2009 2:38 PM
  • User-1405480850 posted

    Hi,

    Does the link http://localhost/iisstart.htm works?

    Thanks,

    Don.

    Thursday, December 17, 2009 2:43 PM
  • User1094109092 posted

    Yes, it does. HTML pages are served up just fine by IIS. PHP not so much.

    Thursday, December 17, 2009 2:57 PM
  • User-1405480850 posted

    Seems like everything is right. Mail me at don[dot]raman[at]microsoft[dot]com.

    Thanks,

    Don.

    Thursday, December 17, 2009 3:13 PM
  • User-1653247517 posted

    Can you paste php mapping in fcgiext.ini as well? To get exact error from IIS, try sending request using wfetch.

    Thanks,
    Kanwal

    Friday, December 18, 2009 7:03 PM