How to setup PHP for IIS 7 server on Vista?

php-iis

Are you a .NET developer? Looking forward to learn or switch to PHP (which is quit impossible. May be I’m dreaming…! :D . However if you are, you are mostly welcome to the word of light..! I mean LAMP) You can setup PHP in IIS server. I’ll walk you through step by step. So, are you ready for the journey..? Let’s go..

I’m writing this tutorial to understand even by a newbie. So bare with me for some very basics stuffs.

First of all you need to install PHP to your computer. You can download PHP at

http://www.php.net/downloads.php

PHP installation is pretty straight forward. I believe you can manage it.

Next you need to ensure whether the IIS server installed in your computer. Regular windows installation won’t install IIS server. So, to test whether it is there or not, right click on My Computer icon and select Manage. Then expand the Services and Application node.

iisphp1

If you don’t see Internet information Service, that means that you should install IIS server manually. It’s pretty simple.

Go to Control Panel and select Classic View in the left pane. Then double click on the Programs and Features icon. Now you’ll have a list of option in your right pane. Select Turn Windows features on or off.

iisphp2

Click the Internet Information Server check box and expand the node.

iisphp3

Again expand the World Wide Web Services , Application Development Features and click the ISAPI Extensions. Then click OK. It will take several minutes to installation.

iisphp4

Now you can check whether the server working properly. Open up your internet browser and type http://localhost/ . You’ll get a page as follows

iisphp5

Now you need to configure the server for PHP. Go to the Computer Management window again (Right click on My Computer and select Manage) and expand the Services and Applications node and click the Internet Information Services link. Then in the connection area select Default Web Site.

iisphp6

Click on Handler Mappings.

iisphp7

On the right side of the window, click on “Add Script Map…”

iisphp8

Once you clicked a pop up window will appear. Fill up the fields with following values.

iisphp9

Click OK. Then a Dialog box will appear. Say Yes! to that. Thats it!

Now you need to check whether the server working with PHP. Open up your favorite text editor and type

1
2
3
<?php
    phpinfo();
?>

Save the file as phpinfo.php under “C:\inetpub\wwwroot”.

Then open up your browser and navigate to http://localhost/phpinfo.php
If you get following page.., you are done..!

PHP info page

Related Articles

Tags: , , ,

This entry was posted on Saturday, May 23rd, 2009 at 1:13 am and is filed under How to, PHP, Tutorials, Web Development. You can follow any responses to this entry through the RSS 2.0 feed.

You can leave a response, or trackback from your own site.