« Previous Next »

Thread: PHP not being processed on IIS5.1

Last post 11-26-2009 6:41 AM by DCC. 4 replies.

Average Rating Rate It (5)

RSS

Page 1 of 1 (5 items)

Sort Posts:

  • 11-25-2009, 12:55 PM

    • DCC
    • Not Ranked
    • Joined on 11-25-2009, 12:47 PM
    • Posts 4

    PHP not being processed on IIS5.1

    Hi,

    I'm trying to get Wordpress working on IIS5.1. To get it to work I need PHP. I have tried installing PHP manually, using the installer from PHP, and as part of the Wordpress install from this site. None of them have worked for me.

    The problem is that when I go to the Wordpress site I see the raw PHP of the page.

    If I look in IIS at Web Sites->Properties->Home Directory->Configuration->Mappings ".php" is there with an executable path of "c:\windows\system32\inetsrv\fcgiext.dll". That file exists and fciext.ini appears to be correct, I've pasted the non-comment section below:

    [Types]
    php=PHP

    [PHP]
    ExePath=C:\Program Files\PHP\php-cgi.exe
    InstanceMaxRequests=10000
    ActivityTimeout=300
    RequestTimeout=600
    EnvironmentVars=PHP_FCGI_MAX_REQUESTS:10000,PHPRC:C:\Program Files\PHP\

    I have rebooted since installing and still the same result.

    Any ideas would be greatfully received.

    Thanks,

    Dan

  • 11-25-2009, 1:15 PM In reply to

    Re: PHP not being processed on IIS5.1

    Hi,

    So your PHP is not working. Even a simple PHP file. I would like to know more details please. What error you are getting in the browser? And please follow the troubleshooting blog at http://blogs.iis.net/donraman/archive/2009/11/15/troubleshooting-php-installation-on-windows.aspx.

    Thanks

    Don.

  • 10 hours, 21 minutes ago In reply to

    • DCC
    • Not Ranked
    • Joined on 11-25-2009, 12:47 PM
    • Posts 4

    Re: PHP not being processed on IIS5.1

    Hi Don,

    Thanks for replying. I am not getting any error, I am just seeing the raw php of the file, so with the test file from your troubleshooting I see:

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

    I have seen this post http://blogs.iis.net/donraman/archive/2009/11/01/running-php-displays-the-code-itself.aspx but as you can see the file uses the full <?php tag and was edited in Notepad so should be a simple ANSI file.

    Running through the rest of your steps the only thing I couldn't understand was this section:

    Please name the above file as 'test.php' in your webroot folder (PHP SERVER variable _SERVER["DOCUMENT_ROOT]") and save it. I will be using 'C:\inetpub\wwwroot' as this is my webroot folder and also the place where my PHP_SERVER variable _SERVER["DOCUMENT_ROOT"] is set.

    I couldn't get PHP SERVER command to work although it's probably down to my lack of PHP knowledge. My Default Web Site root directory is c:\inetpub\wwwroot though.

    One other comment is that although running php from the command line worked it took a surprisingly long time (maybe 30 seconds or so) to exit after printing its output each time, I don't know if that's normal.

    I can't see any errors in my IIS logs either, it just seems that IIS is not recognising my php file as something to be processed.

  • 9 hours, 55 minutes ago In reply to

    • DCC
    • Not Ranked
    • Joined on 11-25-2009, 12:47 PM
    • Posts 4

    Re: PHP not being processed on IIS5.1

    Hurrah, I now have some measure of success.

    The accepted answer to this question,

    http://stackoverflow.com/questions/1726815/php-on-iis-5-1-is-not-working 

    includes a comment mentioning that you also need to set the php mapping up in the Default Web Site.

    For me at least the Web Platform Installer set up the .PHP mapping on the "Web Sites" node of the IIS tree. Once I manually added it to the "Default Web Site" node as well php started working. However, it is very slow, the simple test.php takes about 30 seconds to load in Firefox or Chrome, and IE8 decides that there's a problem before then and fails to display the page at all.

  • 8 hours, 58 minutes ago In reply to

    • DCC
    • Not Ranked
    • Joined on 11-25-2009, 12:47 PM
    • Posts 4

    Re: PHP not being processed on IIS5.1

    DCC:

    However, it is very slow, the simple test.php takes about 30 seconds to load in Firefox or Chrome, and IE8 decides that there's a problem before then and fails to display the page at all.

    This was just down to my stupidity, the .php mapping I set up used php-cgi.exe instead of fcgiext.dll.

    So everything's working fine for me now. It might be worth adding the change I had to make to your troubleshooting guide though as I don't seem to be the only person to have had this problem.

    Thanks for the help.

Page 1 of 1 (5 items)
Microsoft Communities