Blog
    C#
    ADO.Net
    .NET
    ASP.Net & Web Forms
    Custom Controls
    Web Development
    Exception Handling
    XML
    Database
    Security in .Net
    Testing
    Web Services
    Windows Services
    Windows Controls
    WCF
    AJAX
    WPF
    XAML
    Reporting
    Setup
    VB.Net
    LINQ
    JQuery
    SilverLight
    JavaScript
    HTML5
    Crystal Report
    Cloud Computing
    Share Point
    Visual C++
    MVC
    Android
    PHP
    Java
    HTML
    WordPress
    Joomla
    Products
    Drupal
    Windows Phone
    JSON
    LightSwitch
    iPhone/iPad
    Ruby on Rails
    IIS 7
    Windows 8
    CSS/CSS3
    Excel
    MS Access
    Shortcut Keys
    Visual SourceSafe
    Team Foundation Server
    APIs
Follow Us
Follow _MindStick_ on Twitter View MindStick Software's LinkedIn profile View MindStick Software's Facebook profile
Top Contributor
Advertisement
Advertise with Us
Mindstick
Article Article  Forum Forum  Blog Blog  Quiz Quiz  Beginner Beginner  Careers Careers  Contact Contact  Login Login  
Home | Product | Services | About Us | Interview | DeveloperSection | Submit an Article | Submit Blog
Report Abuse Form
Reason:    
 

Home >> PHP >> How to host PHP on IIS
How to host PHP on IIS

PHP application can be hosted on IIS web server by using FastCGI Module that can be found in IIS. Here I’m using IIS 7 as web server. Before moving for next step for how to host PHP on IIS (Internet Information Services) let’s take a look what is FastCGI Module?
Views: 827     Comments: 0
by Arun Singh on 3/12/2012

How to host PHP on IIS

PHP application can be hosted on IIS web server by using FastCGI Module that can be found in IIS. Here I’m using IIS 7 as web server.  Before moving for next step for how to host PHP on IIS (Internet Information Services) let’s take a look what is FastCGI Module? FastCGI is a standard protocol that allows the CGI executable files for application frameworks to interface with the Web server. It differs from the standard CGI protocol in that FastCGI reuses CGI processes for multiple requests, which provides a significant performance boost as compared to CGI. Support for IIS FastCGI enables IIS to host normal CGI programs like PHP or Ruby on Rails by using the FastCGI protocol, and to offer high performance and stability for production deployment of such application frameworks.

Now, to host PHP on IIS successfully you have to perform some following steps:

Step 1: Install IIS Web Server with CGI option in your system.

Step 2: Install PHP for Windows operating system in your system (For more details on PHP Installation click here)

Step 3: Configure PHP configuration file (php.ini) to work with IIS web server

Step 4: Configure FastCGI module to work with PHP

Manually Configure php.ini file to work with IIS web server:

To run PHP on IIS web server you have to make some changes in php.ini file. Let’s take a look about these changes:

Step 1:  Set fastcgi.impersonate = 1

Step 2:  Set cgi.fix_pathinfo=1

Step 3:  Set cgi.force_redirect = 0

Step 4:  Set open_basedir to point to that folder or network path where the content of the Web site is located.

Step 5:  Set extension_dir to point to that location where the PHP extensions are located. Typically, for PHP 5.2.X the value would be set as extension_dir = "./ext"

Step 6:  Enable the required PHP extension by un-commenting the corresponding lines, for example:

extension = php_mssql.dll

extension=php_mysql.dll

Manually Configure FastCGI Module to work with PHP:

To manually configure the IIS and FastCGI extension, you have to perform some following steps:

Step 1: Open Internet Information Services (IIS) Manager (to open IIS manager type ‘inetmgr’ in run command textbox)

Step 2: Double click on ‘Handler Mapping’ and select ‘Add Module Mapping’ from left Action Pane. After that filled appropriate information into textboxes.

 Request path: *.php

Module: FastCgiModule

Executable: "C:\[Path to your PHP installation]\php-cgi.exe"

Name: PHP via FastCGI

After this, just click on ok button.

Now IIS web server is ready for run PHP file or PHP web site.

Title :  
Comment :
Text ColorBackground Color
BoldItalicUnderline
LeftCenterRightJustify
Ordered ListBulleted List
IndentOutdent
Horizontal Rule
SubscriptSuperscript
HyperlinkImage
Design ModeDesign
View HtmlHtml
       
 
Report Abuse Form
Reason:    
 
Latest ArticleRSS Feed
    
    
    
    
    
    
    
    
    
    
More...
Latest Blogs by Arun SinghRSS Feed
    
    
    
    
    
    
    
    
    
    
More...
Top Viewed ArticlesRSS Feed
    
    
    
    
    
    
    
    
    
    
Top Viewed BlogsRSS Feed
    
    
    
    
    
    
    
    
    
    
Latest Interview QuestionsRSS Feed
    
    
    
    
    
    
    
    
    
    
More...
Total Online Users: 2665
  
Copyright © 2013MindStick. All Rights Reserved.