Wednesday, November 28, 2007

Installing IIS7 + PHP5 .2.5 on Windows Vista

I spent several nights on google trying to make this combo work. Now, that it's working I am sharing the steps I took with all of you who are still struggling -

  1. Start with a fresh IIS installation with both ISAPI filters and extensions enabled.
  2. Under the main settings [at the very top of your IIS Manager's hierarchy view, above Application Pools], add the following in this order:
    2.1. an ISAPI Filter for php5isapi.dll
    2.2. an ISAPI and CGI Restriction entry for php5isapi.dll
    2.3. a Handler Mapping for php5isapi.dll
  3. Go to the application Pools section.
  4. Right-click on Default Application Pool and select Advanced Settings.
  5. Set the second option [Enable 32-Bit...] to True.


From what I saw in various posts, doing this much worked for most. I had to do a couple of more things -

  1. Copy php.ini-dist to c:\windows\
  2. Under Default Web Site [sub-heading under Web Sites], add the following -
    2.1. ISAPI and ISAPI Filter modules
    2.2. an ISAPI Filter for php5isapi.dll
    2.3. a Handler Mapping for php5isapi.dll

That's it! You should be able to run the .php files now.

4 comments:

Goward said...

Here I found a very simple installation of the PHP 5 ISAPI filter on the IIS 7 (Vista)

http://blogs.iis.net/bills/archive/2006/09/19/How-to-install-PHP-on-IIS7-_2800_RC1_2900_.aspx

It really works.

Nantech1 said...

Hajuria I tried this but no go. I am now getting a http error 500.0 server error. One thing that puzzled me was that in the ISAPI filter and restrictions they ask for more than the filename. They want a request path (I put *) and type (I selected system.web.ui.page). But it did not work. I followed ALL your steps more than once. Any other suggestions? Thanks.

Niloct said...

Thank you dude.

The key point was to allow the default application pool to run in 32-bit mode, as you said ! (I´m running Vista Ultimate x64)

Nevertheless, I had to configure PHPRC as a env variable pointing to c:\php\ because for some odd reason, even though I had c:\php on my PATH variable, the engine kept looking for it on c:\windows...

Also, there is no need to register the ISAPI Filter, only the handler and the ISAPI permission.

After that, it worked flawlessly ! Thank you !

Niloct said...

Also, there was one VERY important thing missing.

In vista the username for the IIS process account is IUSR, as you can see in IIS Manager - Authentication - Anonymous authentication.

It´s not IIS_IUSRS !!

That gave me a major headache cause I was getting permissions errors on cache and temp folders all the time !

So you basically have to give full control to IUSR on dirs IIS has to write.

Post a Comment