How to Install PHP with FastCGI Extension on IIS 7 / IIS 8 Server

FastCGI is a regular protocol which enables a Web Server to interface with CGI executable files of app structure. The windows most current PHP 4.4.x and PHP 5.x distribution totally support this FastCGI Extension.

This article provides step by step description of how to install PHP on the IIS7 or IIS8 through FastCGI interface.  You will learn steps to follow to install FastCGI and set it up to work with PHP.Follow these tips and steps to install FastCGI Extension for IIS 7 / IIS 8 Windows Server:

Step 1: Integrate The CGI Role Services

To do this, Navigate to the Server Manager, click on the option labeled “Roles” and then Click on the Add Role Services.

This action immediately enables both the CGI and also FastCGI services: Below is a pictorial step to help you.

How to Install PHP with FastCGI Extension on IIS 7 / IIS 8 Server

Step 2: Include the CGIs Features (For Windows Vista SP1 and Windows 7)

In order to do this, navigate into the Control Panel of your system and click on the Programs and Features submenu. Select the “Turn Windows features on/off” option. Note that doing this would enable the services of FastCGI and also the CGI.

How to Install PHP with FastCGI Extension on IIS 7 / IIS 8 Server

Step 3: Download PHP And Install It On Your System

When done with the features setting, make a download of the most current PHP Version 5.6 Family. When downloading, ensure you select the ZIP file tagged VC11 x86 Non Thread Safe.

Step 4: Extract the PHP Files contents

After it is downloaded, extract the PHP Files contents to any of your server’s. Then, double the php.ini-production files by making another copy which you name php.ini. Then open that second file,php.iniand complete the parameters below, by setting it up. Already, every single parameter is there, all you need to do, is locate it, delete the indentations (“”) and finally ensure the values are changed. You should be careful to note that the shown options aren’t more than one in the file (php.ini).

Memory limit = 256M
post max size = 128M
extensiondir = "C:PHPext"
upload_tmp_dir = "C:PHPupload"
upload_max_filesize = 128M
max_execution_time = 600
max_input_time = 600
max_input_vars = 2000
cgi.force_redirect = 0
cgi.fix_pathinfo = 1
fastcgi.impersonate = 1
extension=php_curl.dll
extension=php_mbstring.dll
extension=php_exif.dll
extension=php_gd2.dll
extension=php_ldap.dll
extension=php_mysqli.dll
session.save_path = "C:PHPsession"
session.use_cookies = 1

Step 5: Load the extensions

When loading your extensions, ensure they follow the order in the highlighted box above. Also, note that "php_mbstring.dll"is to be loaded before the "php_exif.dll". Follow this Order when Loading Extensions:

i: Create Sub Directories

Create two sub-directories named “session” and “upload” in the directory of the C:PHP. It is not mandatory to use these names but just ensure they are matched with the session. save_path and upload_tmp_dirparameters you configure inside the php.ini.

ii: Configure Date/Time Zone

Ensure you set up in the php.ini, the date.timezone parameter. Below is a little example. Make sure the city you choose is either the city you stay in or one from the same time zone as yours. The linkfull list of possible date.timezone values on PHP.net websites shows the list of all possible date/time zones.

date.timezone = "America/New_York"

iii: Save the file

When you are sure you have done these, then have the “.ini” file saved.

Step 6: Run PHP command line

In order to check if installing the PHP was successful, then run immediately, the command line thus

C:PHP>php -i

If PHP Fails to Start

The compiler for Visual Studio 2008 is used to compile the VC9 Versions and their stability and performance have been improved. You are to install the Microsoft 2008 C++ Runtime (x64) or the Microsoft 2008 C++ Runtime (x86) for the VC9 versions. In situations when PHP can’t start, downloading an old Windows Versions with the above-listed extensions might be a necessity for you.

Step 7: Configure IIS 7 to Handle PHP Requests

Adding a handler mapping which tells the IIS to transfer through FastCGI Protocol, particular requests to the Framework of the PHP application is vital to enable PHP applications to be hosted by IIS 7. You can either use IIS Manager or the command line to do this.

Step 8: Configure IIS 7 to Handle PHP Requests Through the IIS Manager

In order to make use of the IIS Manager, ensure you follow the below steps carefully.

I: Open Handler Mappings

Enter into the IIS Manager at the level of the server where you would see a menu, the click the Handler Mappings sub-menu.

How to Install PHP with FastCGI Extension on IIS 7 / IIS 8 Server

II: Set the Configuration

Choose the action tagged Add Module Mapping, and pinpoint the settings for configurations as in the image below.

This is the format in filling the data:

Request path: *.php

Module: FastCgiModule

Executable: "C:PHPphp-cgi.exe"

Name: PHP via FastCGI

How to Install PHP with FastCGI Extension on IIS 7 / IIS 8 Server

 

You should note that if you don’t see in the modules space,"FastCgiModule"drop-down menu, it entails that the module has either not been enabled or registered. To confirm that FastCGI module has been registered, access the IIS configuration file%WINDIR%windowssystem32configapplicationHost.configand confirm the line is also in the section of the <globalmodules>.

<add name="FastCgiModule" image="%windir%System32inetsrviisfcgi.dll" />

In that exact file, confirm that the <modules> section has had the FastCGI module added to it like the highlighted path below.

<add name="FastCgiModule" />

Then respond, yes, to the pop-up menu like stated below:

How to Install PHP with FastCGI Extension on IIS 7 / IIS 8 Server

Step 9: Set a FastCGI Configuration for Optimal Performance

Be sure to install on your server, the IIS 7 Administration Pack because if you don’t, then you won’t be able to see the settings option for configuring FastCGI.

How to Install PHP with FastCGI Extension on IIS 7 / IIS 8 Server

Step 10: Configure a Default Document in IIS

Index.php is a file used by most PHP applications as their application documents for default. So you must handle the file as the content page for default by configuring IIS with the following steps below.

I: Open the Default document

At the level of the server first, click the IIS Manager open and choose default document. The image below would give you a good hint.

How to Install PHP with FastCGI Extension on IIS 7 / IIS 8 Server

II: Fill “index.php” in the space

On its opening, select add and then fill the index.php link into the space as displayed below.

How to Install PHP with FastCGI Extension on IIS 7 / IIS 8 Server

Step 11: Test the PHP CGI

After the FastCGI extension has been installed by you, registered the PHP CGI and configured it, then you will be able to easily use the KMP. Then in order to let all the changes you made apply fully, try and restart the IIS server.

Conclusion:

We have covered all you need to install a FastCGI extension. You should by now comfortably carry out the operations on your own if you carefully followed the steps. However, if you are still experiencing issues, we are here to help!

Check out these top 3 Best web hosting services

HostArmada
$2.49 /mo
Starting price
Visit HostArmada
Rating based on expert review
  • User Friendly
    4.5
  • Support
    4.5
  • Features
    4.5
  • Reliability
    4.5
  • Pricing
    4.0
Kamatera
$4.00 /mo
Starting price
Visit Kamatera
Rating based on expert review
  • User Friendly
    3.5
  • Support
    3.0
  • Features
    3.9
  • Reliability
    4.0
  • Pricing
    4.3
Hostens
$2.00 /mo
Starting price
Visit Hostens
Rating based on expert review
  • User Friendly
    4.5
  • Support
    3.8
  • Features
    4.3
  • Reliability
    4.5
  • Pricing
    4.8

How To Add A FastCGI Environment Variable For PHP

This article tells you steps to add FastCGI environment for PHP in the IIS Manag
7 min read
Vladimir Rakov
Vladimir Rakov
Hosting Expert

How to Install the LEMP (Linux, Nginx, MySQL, PHP) Stack on CentOS 7 VPS or Dedicated Server

LEMP is an acronym for Linux, Nginx, MySQL and PHP. LEMP stack just like LAMP st
5 min read
Max Ostryzhko
Max Ostryzhko
Senior Web Developer, HostAdvice CTO

How To Install And Configure Advanced Poll For Use With Fastcgi On IIS 6

This article shows you how to install and configure Advanced Poll For Use With F
4 min read
Eliran Ouzan
Eliran Ouzan
Web Designer & Hosting Expert

How to Install OpenCart on an Ubuntu 18.04 Server or VPS with Apache, MariaDB and PHP 7

In this how-to, you'll learn how to install OpenCart, an open source shopping ca
3 min read
Angela Olaru
Angela Olaru
Senior Writer & Hosting Expert
HostAdvice.com provides professional web hosting reviews fully independent of any other entity. Our reviews are unbiased, honest, and apply the same evaluation standards to all those reviewed. While monetary compensation is received from a few of the companies listed on this site, compensation of services and products have no influence on the direction or conclusions of our reviews. Nor does the compensation influence our rankings for certain host companies. This compensation covers account purchasing costs, testing costs and royalties paid to reviewers.