Posted by : Tom Doyle in (Web Development) 14th Jul, 2008
Install PHP 5 with IIS 7 (Windows Vista)
Tagged Under : Internet Information Service, PHP, Windows Vista, World Wide Web
I had to get my hands dirty today and get a look at some code we’re developing. Having not developed personally in quite some time, I had no reason to have IIS installed, nevermind PHP!
So I set off on the task of installing PHP 5.2 on my Windows Vista machine. And here’s how I did it.
- Install IIS7
Control Panel > Programs and features > Turn Windows features on or off
From here I selected Internet Information Service. I dug a little deeper into Worldwide Web Services and turned on the ISAPI extensions. - Download & Install PHP
Download PHP http://www.php.net/downloads.php - for simple set up, get the zip package.
Unzip your files to your preferred location, mine is C:\PHP
Copy the php.ini-dist file into your windows folder. (C:\windows\php.ini) - Open IIS Manager
From your start menu, type iis and hit return to open IIS Manager.
Select “default web site” and double click, “Handler Mappings”.
On the right hand side - select “Add Script Map”In the dialogue that opens enter the following:
Request Path: *.php
Executable: C:\PHP\php5isapi.dll (*NOTE*: if this is where you’ve stored the unzipped files)
Name: PHPClick OK. Then you will be asked “Would you like to enable the ISAPI extension”, choose Yes. - That’s It!
You might want to check it with a phpinfo file.
e.g. Create a text file and type <? phpinfo(); ?>. Save this file as phpinfo.php, copy it into your C:\inetpub\wwwroot. Go to your browser and open http://localhost/phpinfo.php
Enjoy!
