« Previous Next »

Thread: PHP 5.2.8 and Fast CGI configuration issue

Last post 11-25-2009 11:15 PM by AntiAlias. 17 replies.

Average Rating Rate It (5)

RSS

Page 1 of 2 (18 items) 1 2 Next >

Sort Posts:

  • 02-03-2009, 5:31 PM

    • jaminxz
    • Not Ranked
    • Joined on 02-03-2009, 10:11 PM
    • Posts 3

    PHP 5.2.8 and Fast CGI configuration issue

    Hi guys,

     I am trying to configure IIS so that I can build PHP applications on my local vista home premium 64 machine for a project. I have been following this guide: http://learn.iis.net/page.aspx/246/using-fastcgi-to-host-php-applications-on-iis-70/ but am stuck on the Configure IIS 7.0 to Handle PHP Requests section > then configure by using command line.

     The first line executes no problem, but the second line to create the handler mapping, which is:

    C:\>%windir%\system32\inetsrv\appcmd set config /section:system.webServer/handlers /+[name='PHP_via_FastCGI',path='*.php',verb='*',modules='FastCgiModule',scriptProcessor='c:\{php_folder}\php-cgi.exe',resourceType='Unspecified'] 

    returns the following error:

    Unknown config section system.webServer/handlers /+[name='PHP_via_FastCGI',path='*.php',verb='*',modules='FastCgiModule',scriptProcessor='c:\{php_folder}\php-cgi.exe',resourceType='Unspecified']

     

    Im really stupmed, im pretty sure its not a typo on the php install path so im not sure what it could be. On a possibly unrelated note  i did try to install the following update:http://forums.iis.net/t/1151379.aspx  but i got an error message saying "This update does not apply to your system". I deffinitely have IIS7 installed and im confident php is installed fine. It also might be worth mentioning that I am running web developer express 2008 and sql lite 2008 for other projects i'm working on.  Any help would be greatly appreciated.

  • 02-03-2009, 5:54 PM In reply to

    • ruslany
    • Top 25 Contributor
    • Joined on 07-01-2007, 7:38 PM
    • Redmond, WA
    • Posts 661

    Re: PHP 5.2.8 and Fast CGI configuration issue

    Just to make sure - you have Vista SP1, right?

    The error message regarding not applicability of the update may be because you already have the update installed or you do not have FastCGI installed. Can you check the version and date modified of this file:

    %WINDIR%\system32\inetsrv\iisfcgi.dll.

    http://ruslany.net
  • 02-09-2009, 12:47 PM In reply to

    • jaminxz
    • Not Ranked
    • Joined on 02-03-2009, 10:11 PM
    • Posts 3

    Re: PHP 5.2.8 and Fast CGI configuration issue

     yeah i have sp1, managed to fix this my using IIS manager, didnt realise i could access it, only thought this feature was on MS server OS's.

     

    thanks 4 the help.

  • 04-18-2009, 1:51 PM In reply to

    • tnjman
    • Not Ranked
    • Joined on 04-18-2009, 5:48 PM
    • Posts 4

    Re: PHP 5.2.8 and Fast CGI configuration issue

    This is the kind of thing that truly frustrates me: hundreds of people looking for a fix, and you say you "fixed" your FastCGI problem, but you give no details.

    PLEASE , give details of exactly what you did in IIS 7.0 manager to fix it.

    MANY people are having this problem, and if you have a fix, please share the exact details.

    Thanks. --  

  • 04-19-2009, 2:40 AM In reply to

    Re: PHP 5.2.8 and Fast CGI configuration issue

    Jaminxz said he just followed the steps from  http://learn.iis.net/page.aspx/246/using-fastcgi-to-host-php-applications-on-iis-70/ .

    Instead of using appcmd which was failing for him he used IIS Admin Manager UI.

    Jaroslav Dunajsky (MSFT, IIS)
  • 04-21-2009, 12:50 PM In reply to

    • tnjman
    • Not Ranked
    • Joined on 04-18-2009, 5:48 PM
    • Posts 4

    Re: PHP 5.2.8 and Fast CGI configuration issue

    Thanks. I didn't catch that. It's still unclear, but I will look at the link and follow along.

    I do have that issue, but also a totally separate issue: Can someone please clarify why a "blank page" shows up, after I run the ".msi" (non-thread-safe) installer on Win XP Pro, SP2, IIS 5.1.(php-5.2.9-2-nts-Win32-VC6-x86.msi - this is the one I ran).

    The WebPI did not appear to run exactly right, so I downloaded the actual .msi and ran that. Maybe the WebPI ran okay - so it could be my imagination on that part.

    Nobody seems to have a consensus on the "test.php" <? phpinfo(); ?> 'blank page' issue. When right-clicking in IIS mgr, Web sites, Properties, Home Directory, Configuration, here is the ".php" entry: C:\Windows\System32\inetsrv\fcgiext.dll

    I've seen various steps regarding various install instructions which bother me:

    For example, one person has a 5-step process for installing PHP5 for IIS5.x:
    http://www.iis-aid.com/articles/how_to_guides/installing_php_5_on_iis_in_5_simple_steps

    It references the "ts" (thread-safe) model. It also mentions that you must separately download some PECL32 portion, put that in the PHP\ext folder, and do some magic. :)

    Also, per "Mr 5-Step," you must create "sessions," "upload" and "log" folders, and create a blank php.log in the log folder.

    Anyway, I think you can get my point: If there is this wonderful installer, why is all this manual stuff still needed (the PECL piece, and the creating the additional folders, etc.)? Granted, he is showing the "manual method," but the fact that your installer does not have some of the things he references is rather unsettling.

    I ran your installer, and it does not create those 3 folders mentioned, so I'm guessing that needs to be added to your WebPI and/or .msi installer package. Or... are those folders not needed; are they only for a specific version? There seems to be a LOT of 'disconnect' regarding what IS needed; and what is NOT needed - and maybe that would be a good "article" for one of you 'gurus' to write for us n00bs. Even a very nice "matrix" chart showing exactly what's needed and what isn't. For example, you say a certain "fast cgi" dll is needed; and Vista SP1 is needed; so, apparently that particular DLL is only regarding IIS7/Vista SP1. Whereas, after I ran your installer on an XP Pro SP2 system, I get the "C:\Windows\System32\inetsrv\fcgiext.dll" entry; BUT, "Mister 5-Step" says I need to point to "php5isapi.dll;" which your installer does not even extract to the PHP folder. So, again, you can see how all this might be a bit confusing.

    Also, does it matter C:\PHP vs. C:\Program Files\PHP? (Someone mentioned the 'space' in the "Program Files" folder name, but that may have been in reference to an older o/s - i.e., changing some reference to "C:\Progra~1\PHP" [maybe in the Environment variables?]).

    It just does not seem like it should be this difficult to get PHP to run on XP Pro SP2, with IIS 5.1. And maybe it [IS] "running," but it's certainly not displaying the "info" when I run the infamous "phpinfo()" directive - it just gives a blank page (view source shows the phpinfo() directive, so obviously IIS is trying to serve up the page, in some form or fashion).

    Maybe it's just me but, when I see that a package has an "installer," I expect that, once the install is completed, I should be able to see the package work, without having to be a contortionist. And again, maybe  it [IS] working, and I just am confused.

    Thanks for any info and help.

  • 04-21-2009, 2:29 PM In reply to

    • jaminxz
    • Not Ranked
    • Joined on 02-03-2009, 10:11 PM
    • Posts 3

    Re: PHP 5.2.8 and Fast CGI configuration issue

    HI tnjman,

    sorry I cant help you any further with your problem but just to reiterate - i was following the specified guide and  appcmd was failing for me. I was trying to use appcmd instead of IIS manager because i only though IIS manager shipped with microsoft server OS's. Eventually I found out that it didnt and simply followed the steps in the specified guide.

     

    good luck.

    Jaminxz.

  • 04-21-2009, 2:43 PM In reply to

    Re: PHP 5.2.8 and Fast CGI configuration issue

    Hi tnjman,

    I am the "Mr 5-step" who wrote the guide you referenced. I totally agree with you that there is a ton of conflicting information out there that  makes installing PHP on IIS harder than it needs to be. This is exaclty why I wrote that guide in a way to try and break down the installtion process into sections.

    I'll do my best to answer your questions;

    1) Using PHP with ISAPI or FastCGI should essentially do the same thing. They are simply two methods in which IIS can be configured to intepret PHP scripts. The guide I wrote is a few years old now, and when I wrote it ISAPI was the best option for running PHP on IIS. This is now in the process of changing to FastCGI as ISAPI will be dumped as of PHP 5.3, however until then ISAPI is still a valid choice.

    2) Downloading the extra PHP Extensions (PECL) is not required, but rather was included for completeness sake as some PHP applications require these extensions to function.

    3) TAgain, the upload, session and log directories referenced in my guide are optional when installing PHP on IIS. Having said that most popular PHP applications will use either PHP uploads and/or sessions, meaning you will probably need to create these at some stage. As general good practice I like to enable logging so you can keep a close eye on what is going on with PHP.

    4) Having spaces in your path can cause issues with IIS application mappings. however as you mention using the 8.3 naming format you can still install PHP in program files if that is your wish.

    5) If you are seeing phpinfo() in your page source, then your php script is not being processed by IIS. Your info file should contain the following and nothing else;

    <?php

    phpinfo();

    ?>

    Failing all that, if you are still having issue you may wish to use the PHP Installer I maintain, which more or less does everything I cover in the guide you referenced. It is free download (open source) which can be gotten here;

    http://www.iis-aid.com/iis_aid_php_installer
     

    ----------------
    Dominic Ryan
    Microsoft IIS MVP
    www.iis-aid.com
    My IIS articles
    My PHP articles
    My How-to guides
  • 04-21-2009, 2:44 PM In reply to

    • tnjman
    • Not Ranked
    • Joined on 04-18-2009, 5:48 PM
    • Posts 4

    Re: PHP 5.2.8 and Fast CGI configuration issue

    Thanks. Actually, I'm hoping some of the 'gurus' read my issues and help me out.

    Either way, eventually I will muddle through. Apologies if I came off as 'frustrated;' I am. :)

    Cheers!

  • 04-21-2009, 10:28 PM In reply to

    • tnjman
    • Not Ranked
    • Joined on 04-18-2009, 5:48 PM
    • Posts 4

    Re: PHP 5.2.8 and Fast CGI configuration issue

    SUCCESS!! Wow, thank you very much!

    It was that simple - just a 'bad directive.' I was sleep-deprived and copied the directive from another source - apparently if the directive is not exactly the way you show it above, then it does not work. I think I am in good shape - again, many thanks.

  • 11-16-2009, 6:49 PM In reply to

    Re: PHP 5.2.8 and Fast CGI configuration issue

     Brashquido, thank you for your participation here. You seem very well informed and I need help. This post was active long ago and the PHP installation options are different now. I've used the WPI and all programs appear to have installed correctly. Yet, when I run a .php file, I am prompted to download the file. I'm assuming I just need a tweak to the settings somewhere and all will be fine. However, I've been pouring over all the installation comments and blogs to find and answer without success.

    I am running XPSP3 and IIS 5.1. I'm thinking this combo just doesn't work in this new FastCGI environment using PHP 5.+.

    Should I upgrade IIS to 7? If so, point me in the right direction. Should I use the installer you are suggesting in this post? Or, is this installer obsolete now?

    Please help if you can.

    Thanks,

    Antialias

  • 11-17-2009, 7:31 PM In reply to

    Re: PHP 5.2.8 and Fast CGI configuration issue

    Glad to help Antialias,

     I have just had a shot at answering your prompt to download php file issue in your other thread;

     http://forums.iis.net/p/1162689/1925115.aspx#1925115

    As for your other questions, there should be no need to upgrade to IIS 7 just to use PHP/FastCGI. I haven't tried SP3 on XP / IIS 5.1 yet, but am not aware of any reason why that combo should not work. I've found that the WPI works fine on a Vanilla install of Windows / IIS, but can run into trouble when there has been some tinkering with the system. I wrote my installer to try and be as bullet proof as possible, however even it doesn't check every single thing that can bring a PHP installation unstuck. Have a read through the link I provided in the other thread and we'll take it from there.

     

    ----------------
    Dominic Ryan
    Microsoft IIS MVP
    www.iis-aid.com
    My IIS articles
    My PHP articles
    My How-to guides
  • 11-17-2009, 7:42 PM In reply to

    Re: PHP 5.2.8 and Fast CGI configuration issue

    Hi,

    AntiAlias:

    I am running XPSP3 and IIS 5.1. I'm thinking this combo just doesn't work in this new FastCGI environment using PHP 5.+.

    FastCGI is very much supported on XP platform and is the recommended way of running PHP.

    Brashquido has already provided you a link where you can trobleshoot your problem. You can also use my blog at http://blogs.iis.net/donraman/archive/2009/11/15/troubleshooting-php-installation-on-windows.aspx to see if your installation is fine.

    AntiAlias:
    Should I upgrade IIS to 7?

    There is no point upgrading to IIS7. IIS7 is not supported on XP. Using WPI to configure PHP is the right thing to do.

    I would say your handler mapping to '*.php' files seem incorrect and hence your browser is treating that as a text file/normal file. You can learn more in my troubleshooting blog.

    Thanks,

    Don.

  • 11-18-2009, 10:16 PM In reply to

    Re: PHP 5.2.8 and Fast CGI configuration issue

    Thanks to Dominic and Don for your interest and response.

    If my comment is approved, you'll read details of this ongoing issue there.

    http://forums.iis.net/t/1162357.aspx?PageIndex=2

    I've reviewed and followed both your installation instructions over and over, but it seems that my OK button is disabled.

    See these screenshots. They should be familiar to you:
    http://www.meimedia.com/images/IIS-WPI-Setup-WebSitesProperties.jpg
    http://www.meimedia.com/images/IIS-WPI-Setup-1.jpg
    http://www.meimedia.com/images/IIS-WPI-Setup-2.jpg

    I look forward to your response.

    Thanks,

    AA

  • 11-18-2009, 10:20 PM In reply to

    Re: PHP 5.2.8 and Fast CGI configuration issue

    Dominic,

    Your page on link:

    http://www.iis-aid.com/articles/how_to_guides/installing_php_5_on_iis_in_5_simple_steps is down.

    FYI

Page 1 of 2 (18 items) 1 2 Next >
Microsoft Communities