Installing PHP in IIS on Window platforms

Many of us use PHP in windows platform and transfer the data / files to remote server. The advantage of PHP is, it works equally well in Win platform also. There are different ways to install PHP in a windows platform. Here is one of the way but this may not be the easiest way but this will give you an idea how the web server get configured for running any scripts like PHP. The same technique can be used to run any other script. This for configuring IIS to execute a script based on different file extensions it receives.

1) Download PHP from . I get the zip package because I think it is just as easy, and gives me control over setup.

2) Unzip the file to your drive. I usually unzip it to C:\php

3) Copy the c:\php\php.ini-dist file to c:\windows\php.ini. Tweak it as needed.

Windows XP

Start>control panel>administrative tools>Internet Information Service

Expand the + buttons on the left side area if any and Right click the label saying default web site. You will get a list of items in the menu and then go to properties section.

[Image: propertise.jpg]

In the property section select go to Home Directory tab ( at the top ) and click the button Configuration. Here we are trying to tell IIS to execute php.exe script for all file extensions of PHP.

[Image: home_directory.jpg]

Once we click the configuration button we will get one window with existing file extension and corresponding executable applications. Here we have to add our required application to the list so we have to click the Add button to add our php extension.

[Image: add_app.jpg]

[Image: properties5.jpg]

[Image: mapping5.jpg]

[Image: configuration5.jpg]

Windows Vista/7

Open the IIS Manager (C:\windows\system32\inetsrv\inetmgr.exe)

Click on "Handler Mappings"

[Image: inetmgr.JPG.img?action=preview]

Click on the "Add Script Map" task on the right (in blue):

[Image: handlers.jpg.img?action=preview]

Fill in the dialog box like this:

[Image: onlyscriptMap.JPG]

Pause to enjoy this handy dialog box that I had added late in RC1 just for you, then click "yes"

[Image: onlyExtensionRestriction.JPG]

If you click "Yes" it will automatically register this ISAPI /CGI with the extension restriction list - the feature we added in IIS6 to prevent unauthorized executables from running on the server. This saves time, and considering the fact that you're adding the scriptmap, it's a safe bet you want it to run. Smile

go to your C:\inetpub\wwwroot directory and create a test.php page. You can use the simple

function to test if PHP is working correctly.



Popular Posts