IIS configuration for PHP in Windows

 IIS configuration for PHP in Windows

Steps for configuring PHP to work with IIS in Windows

Configuring PHP:

1. Click on Start, type "inetmgr" in the Search programs and files, and press Enter.

 For Windows 7 / Windows Server 2012

·         Open Control Panel

·         Programs and Features

·         Turn Windows features on or off.

open the Internet Information Management window, and double click on Handler Mappings.

Or

Enabling Fast CGI support in IIS

The fast CGI module (Fast CGI is a protocol based on the common gateway interface) is disabled in the default installation of IIS.

The steps to enable it.

To enable Fast CGI support on Windows:

1.      Click on Start Menu choose "Run:", type "optionalfeatures.exe" and click "Ok";

2.      In the "Windows Features" dialog expand "Internet Information Services", "World Wide Web Services", and "Application Development Features" and then enable the "CGI" checkbox;

3.      Click OK and wait until the installation is complete.


To enable Fast CGI support on Windows Server 2008 and Windows Server 2008 R2:

1.      In the Windows Start Menu choose "Run:", type "CompMgmtLauncher" and click "Ok";

2.      If the "Web Server (IIS)" role is not present under the "Roles" node, then add it by clicking "Add Roles";

3.      If the "Web Server (IIS)" role is present, then click "Add Role Services" and then enable the "CGI" checkbox under "Application Development" group;

4.      Click "Next" and then "Install" and wait for the installation to complete.



Using the IIS Manager user interface to create a handler mapping for PHP

Steps to create an IIS handler mapping for PHP in the IIS Manager user interface:

1.      In the Windows Start Menu choose "Run:", type "inetmgr" and click "Ok";

2.      In the IIS Manager user interface select the server node in the "Connections" tree view;

3.      In the "Features View" page open the "Handler Mappings" feature;



 

1.      In the "Actions" pane click "Add Module Mapping...";

2.      In the "Add Module Mapping" dialog enter the following:

o    Request path: *.php

o    Module: FastCgiModule

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

o    Name: PHP_via_FastCGI

3.      Click "Request Restrictions" button and then configure the mapping to invoke the handler only if the request is mapped to a file or a folder;

4.      Click OK on all the dialogs to save the configuration.



Set index.php as a default document in IIS

The IIS default documents are used for HTTP requests that do not specify a document name.

With PHP applications, index.php usually acts as a default document.

To add index.php to the list of IIS default documents. 



=================================================================== 

Post a Comment

0 Comments