Short instruction: Install PHP (ISAPI) on Vista (IIS7)

Short instruction: Install PHP (ISAPI) on Vista (IIS7)

am 14.09.2007 14:54:35 von Erwin Moller

Hi,

I am one of those questionable people that started with Vista (Home
Premium).
Not because I think it is a ready/steady OS, but partly out of
curiousity, and partly because I needed to work on an old project that
happens to run on IIS6/W2000/MSSQL7, but my W2000 machine couldn't
handle the size of the database in question anymore. :-(
My new Vista machine is 5 years younger and is a lot faster, so I
started to figure out how to use IIS7 on Vista.
(I could use only the database on my fast machine, and leave the PHP on
the slow W2000, but that would be too easy.)

For clearity: I do not recommend PHP5 on IIS7, use Apache when possible,
but if you have to use IIS7, here are a few pointers/thing I found.

Installing PHP5 on Vista/IIS7 is easy, once you find the right walkthrough.

General considerations:

1) I understand that the new FastCGI rocks (stable and fast), but I
picked the ISAPI because that is the setup of my client.
So if you need more speed, try FastCGI approach.

2) Don't try the installer found at php.net on Vista. (Actually, don't
ever use that thing because you won't be able to install extensions for
php, like mysql). Always use the zipped version and install by hand.

3) Put the php folder under the inetpub tree (but not in wwwroot). That
way the phpfolder will inherit all right permissions under Vista right away.

Install:

I am not going to repeat how to do this, but instead post the sites I
found good. I found many sites describing how to install PHP on IIS7,
but most aimed at beta releases, and many tutorials just didn't work.

Two walkthroughs that are good:

http://blondr.blogspot.com/2006/11/set-up-iis-7-w-mysql-and- php-5.html

This one describes also installing mysql.

and

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

Mind that in this description step 4 says:

4) Install IIS7, making sure you install the ISAPI Extension component
(for PHP-ISAPI - which is what I use) or the CGI component (if you
prefer CGI)


I misinterpreted that line at first, but it means that WHEN installing
IIS7, you must specifically select (by hand) that ISAPI Extensions are
allowed.
http://blondr.blogspot.com/2006/11/set-up-iis-7-w-mysql-and- php-5.html
does describe this step with nice screenshots.
(You can't miss it, unless you happen to run a Dutch version of Vista as
I do, and must make guesses how they translated the english.)

ISAPI Extensions is set to 'off' by default, leading to confusings
errors later on when trying to add the handler that directs *.php
requests to the php5isapi.dll.
(Why can't M$ just say: "Enable ISAPI Extensions in IIS setup first" ??)

Well, I hope this saves somebody a headache. ;-)

Good luck!

Regards,
Erwin Moller


PS: General Vista tip: If you use XP and are considering to 'upgrade' to
Vista, better wait untill SP1 comes out somewhere in 2008.
If you don't use a M$ OS, keep it like that.