« Previous Next »

Thread: Problem configuring PHP 5.2.9 with IIS 6

Last post 04-06-2009 8:03 PM by brashquido. 12 replies.

Average Rating Rate It (5)

RSS

Page 1 of 1 (13 items)

Sort Posts:

  • 03-22-2009, 7:11 PM

    Problem configuring PHP 5.2.9 with IIS 6

    Hi,

    I downloaded this installer, php-5.2.9-1-win32-installer.msi, and installed it on our web server. The installation completed successfully.

    For IIS configuration, I added a new web service extension in IIS, "PHP ISAPI" with the file location pointing to "D:\Program Files\PHP\php5isapi.dll"

    Then I went to our PHP website folder in IIS Web Sites tree. Under Configuration, I tried to add a new Application Extension Mapping, Executable - "D:\Program Files\PHP\php5isapi.dll" for extension .php. But I am not able to, if I click Ok IIS doesn't take it. It keeps showing me the same window. The Ok button is not disabled, but clicking it is not doing anything. What am I doing wrong? This is a Windows 2003 server machine.

    Thanks.

  • 03-22-2009, 7:59 PM In reply to

    Re: Problem configuring PHP 5.2.9 with IIS 6

     You'll probably need to use the 8.3 format so there are no spaces in your path.

    ----------------
    Dominic Ryan
    Microsoft IIS MVP
    www.iis-aid.com
    My IIS articles
    My PHP articles
    My How-to guides
  • 03-22-2009, 8:29 PM In reply to

    Re: Problem configuring PHP 5.2.9 with IIS 6

    Thank you. That was it. Changed it to D:\Progra~1\, it worked.

     

  • 03-23-2009, 1:27 PM In reply to

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

    Re: Problem configuring PHP 5.2.9 with IIS 6

    With that version of PHP installer, you could just choose the IIS FastCGI option during installation and it will perform all the necessary IIS configuration to get PHP working via FastCGI.

    http://ruslany.net
  • 04-03-2009, 2:33 PM In reply to

    Re: Problem configuring PHP 5.2.9 with IIS 6

    @ruslany: What exactly does the installer (PHP 5.2.9) do after one selects "IIS FastCGI"?

    Thanks,
    Claude

    http://claude.betancourt.us
  • 04-03-2009, 2:54 PM In reply to

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

    Re: Problem configuring PHP 5.2.9 with IIS 6

    The PHP installer checks if you have IIS FastCGI installed. If it is not installed then it will not allow you to proceed. If it is installed then PHP installer will:

    1. Create script mapping for *.php in IIS
    2. Configure IIS FastCGI to work with PHP
    3. Configure index.php as a default document for IIS

    If by ISAPI handler you mean the php5isapi.dll, then PHP installer will have nothing to do with it if you choose "IIS FastCGI" option. In fact running PHP via ISAPI is not recommended for IIS because of stability and app compatibility issues.

    http://ruslany.net
  • 04-03-2009, 3:32 PM In reply to

    Re: Problem configuring PHP 5.2.9 with IIS 6

    Thanks for the quick response.

    I did confuse two things in my post. I never had an issue with the ISAPI install.

    After installing the FastCGI module from MSFT and then running the PHP installer for "IIS FastCGI" all I saw was the FastCGI Handler under Web Service Extensions with a status of Allowed, but nothing else.

    I then manually added .php to the Application Configuration -> Mappings. I pointed it to "C:\WINDOWS\system32\inetsrv\fcgiext.dll". At that point the 404 error went away and the PHP file appeared to be loading. Then I received a 500 Error.

    It wasn't until I changed the mapping to "%SystemRoot%\system32\inetsrv\fcgiext.dll" that it all worked.

    Thanks,
    Claude

    http://claude.betancourt.us
  • 04-03-2009, 9:11 PM In reply to

    Re: Problem configuring PHP 5.2.9 with IIS 6

    ruslany:
    In fact running PHP via ISAPI is not recommended for IIS because of stability and app compatibility issues
     

    I'm aware of some stability issues due to use of some non-thread safe extensions/libraries, however I haven't come across a PHP app (open source at least) that would not work specifically because of using ISAPI. Is there a list of known apps that are not compatible with the PHP ISAPI module? Failing that, what are the issues with PHP ISAPI that can lead to application compatibility issues?

     Obviously people will need to migrate to FastCGI eventually because PHP ISAPI is being retired as of PHP 5.3. However that migration might still be a year off for some people, so it might be good to have a resource that details the specific reasons why they should expedite their migration to FastCGI.
     

    ----------------
    Dominic Ryan
    Microsoft IIS MVP
    www.iis-aid.com
    My IIS articles
    My PHP articles
    My How-to guides
  • 04-05-2009, 6:59 AM In reply to

    • pierrejoye
    • Top 75 Contributor
    • Joined on 02-12-2009, 10:52 PM
    • Germany
    • Posts 73

    Re: Problem configuring PHP 5.2.9 with IIS 6

     The reasons are:

    • not maintained (no developer takes care of the bugs)
    • threading issues with 3rd party libraries causing all kind of crashes or side effects
    • 5.3 does not support it anymore 
    To be honesst, I do not know any appealing reasons to keep using the ISAPI :)
    --
    Pierre

    http://blog.thepimp.net | http://windows.php.net
  • 04-05-2009, 10:31 AM In reply to

    Re: Problem configuring PHP 5.2.9 with IIS 6

    Hi Pierre,

    Valid points, but potentially not enough to encourage people already using ISAPI in a stable environment to migrate (I mean look at how many people are still using PHP4). The only real advantage I can see ISAPI still has over FastCGI is it works properly with all opcode caches with a Win32 release (at least it did last time I was using ISAPI). Get FastCGI working properly with APC and the like and I'd be thinking that would be a big drawcard for people to make the shift from ISAPI to FastCGI. Get a stable and fully functional FastCGI / PHP NTS / APC combo and nothing could touch it performance wise on IIS.

    ----------------
    Dominic Ryan
    Microsoft IIS MVP
    www.iis-aid.com
    My IIS articles
    My PHP articles
    My How-to guides
  • 04-05-2009, 11:03 AM In reply to

    • pierrejoye
    • Top 75 Contributor
    • Joined on 02-12-2009, 10:52 PM
    • Germany
    • Posts 73

    Re: Problem configuring PHP 5.2.9 with IIS 6

     I fully agree.

    Except about php4, it is like using WfW 3.11 ;)

    --
    Pierre

    http://blog.thepimp.net | http://windows.php.net
  • 04-06-2009, 2:17 PM In reply to

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

    Re: Problem configuring PHP 5.2.9 with IIS 6

    brashquido:

    I'm aware of some stability issues due to use of some non-thread safe extensions/libraries, however I haven't come across a PHP app (open source at least) that would not work specifically because of using ISAPI. Is there a list of known apps that are not compatible with the PHP ISAPI module? Failing that, what are the issues with PHP ISAPI that can lead to application compatibility issues?

    Any application that uses URL rewriting and relies on REQUEST_URI server variable to figure our original URL will not work correctly with ISAPI. For example WordPress and Joomla!

    http://ruslany.net
  • 04-06-2009, 8:03 PM In reply to

    Re: Problem configuring PHP 5.2.9 with IIS 6

    True, the addition of REQUEST_URI is a big help, however getting URL rewritting to work on your favourite PHP app is nothing new and there is always more than one way to skin a cat ;) . You are going to have to use a 3rd party URL rewrite tool anyway for these SEF URL's (unless using MS URL Rewrite on IIS 7), so for instance you can use the HTTP_X_REWRITE_URL variable if you're using ISAPI Rewrite 3.x, or the HTTP_X_ORIGINAL_URL variable if using IIS Mod_Rewrite. In fact Wordpress has support for these varibles built right into their code! These variables work just fine when using PHP ISAPI, and even if your PHP App doesn't support them directly it takes about 10 seconds to insert a line or two of code into your PHP app config file to correct this. Even before REQUEST_URI was supported in any way on IIS (which wasn't that long ago) there were still options. Back in the day ISAPI Rewrite 2.x was pretty much the standard for rewritting your PHP app on IIS, and there are loads and loads of guides around the net on how to get most popular PHP apps working with SEF URL's on IIS with this. When it comes to rewritting URL's of PHP applications on IIS, I would say the transfer of Apache mod_rewrite rules to IIS is still a much bigger issue than using PHP ISAPI.

    ----------------
    Dominic Ryan
    Microsoft IIS MVP
    www.iis-aid.com
    My IIS articles
    My PHP articles
    My How-to guides
Page 1 of 1 (13 items)
Microsoft Communities