Install PHP on window with IIS

php


PHP (recursive acronym for PHP: Hypertext Preprocessor) is a widely-used open source general-purpose scripting language that is especially suited for web development and can be embedded into HTML.

We can install php via microsoft installer or by manually.

Installing PHP on your development PC allows you to safely create and test a web application without affecting the data or systems on your live website. This article describes PHP installation as a module within the Windows using IIS

Step 1: Getting PHP

You can download window code from php website.

After downloading extract the folder and rename it to php.
Now copy and paste it to you C drive .

Step 2: Configure php.ini 

Open the c:\php folder and search for php.ini-production file in the directory.
Rename it to php.ini . This is the main initialization file.
Edit this file and search for extension_dir”.

Remove the semi-colon and change the path to c:\php\ext

php.ini


Now search the “cgi.force_redirect” and un-comment it i.e. remove the semi-colon(;).
You can scroll a little bit and find the cgi.force_redirect line

cgi.force_redirect

Scroll a little bit more or search for “fastcgi.impersonate” and un-comment it i.e. remove the semi-colon (;).

fastcgi.impersonate
Save the file and close it.

Step 3: Configure IIS


Now open the IIS either by searching or press window key + R and type inetmgr and press enter key.

Now open the default document.

default document

Now add a new file “index.php

index.php

Re-arrange the sequence and place it below the index.html file

index.php

Select the index.php and you can see the Move up and Move Down link on right side Action menu.
By clicking on this link you can easily re-arrange the file.


Now we have set the FastCGI Setting of IIS.

Click on the FastCGI setting on the IIS screen

FastCGI

Click on the Add application link given on right Action Menu.
A popup window will appear Click on the browser button.
Go to c:\php and select the “php-cgi.exe” file. 

FastCGI

Press Open and then Ok button.
You can see below we have added the CGI

FastCGI

Now we have set the Handler mapping on IIS.

Now Go back to IIS and open the Handler mapping

Handler mapping

Now click on the “Add Module mapping” from the right side action menu and fill the below detail

Request path: *.php
Module: FastCgiModule
Executable: C:\php\php-cgi.exe
Name: PHP

For Module you have to select FastCgiModule from dropdown and for Executable you have to browse to “c:\php” and select “php-cgi.exe” file.

FastCgiModule

Now Save this.

That’s it you have done all the necessary setting, now restart the IIS.

IIS restart

Congrax !! php is Installed now on your system.😏

Step 4: Test PHP

Let’s check the php is it installed or not.

Open a blank notpad file and write the below line

     <?php phpinfo(); ?>                                                                                                                                            

Save as this file with name of “phpinfo.php” and save it to localhost folder.
By default the IIS folder is “C:\inetpub\wwwroot

Now open browser the type http://localhost/phpinfo.php

You can see the php info in the browser like shown below.

php info


Comments

  1. Welcome Bonus and Welcome Offer - JamBase.com
    Welcome Bonus and Welcome Offer - Get all the bonus deals and promos, 광주 출장안마 Bet365 진주 출장샵 Casino: No 서울특별 출장안마 deposit bonus, 100% deposit bonus up to  세종특별자치 출장마사지 Rating: 5 · 상주 출장샵 ‎1 review

    ReplyDelete

Post a Comment

Popular Posts

How to position controls using Canvas control in WPF using MVVM

Change font and size in visual studio

JWTs in ASP.NET Core 2.0