PHP configuration in IIS in Windows


Steps for configuring PHP to work with IIS in Windows

Make Sure that you have IIS up and running with The Internet Server Application Programming Interface (ISAPI) Filter installed from window installation.

Configuring PHP:

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

For Windows 7 / Windows Server 2012

  • Open Control Panel
  • Programs and Features
  • Turn Windows features on or off.

Internet Information Management window opens, Now double click on Handler Mappings.

Or

Enabling Fast CGI support in IIS

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 differ based on the version of Windows being used.

To enable Fast CGI support on Windows Vista SP1 and Windows 7:

  1. In the Windows Start Menu choose "Run:", type "optionalfeatures.exe" and click "Ok";
  2. In the "Windows Features" dialog expand "Internet Information Services", "World Wide Web Services", "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 IIS Manager user interface to create a handler mapping for PHP

Follow these 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;
  • In the "Actions" pane click "Add Module Mapping...";
  • In the "Add Module Mapping" dialog enter the following:
    • Request path: *.php
    • Module: FastCgiModule
    • Executable: C:\[Path to PHP installation]\php-cgi.exe
    • Name: PHP_via_FastCGI
  • Click the "Request Restrictions" button and then configure the mapping to invoke handler only if the request is mapped to a file or a folder;
  • 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.

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

Install PHP 5 on Apache in Windows

Apache Installation

  1. Extract the compressed Apache download. extract it to any directory (by default on the root directory of the drive ) example:- C:\Apache24.
  1. Open an “Administrator” command prompt. (Click the Windows “Start” icon, then type “cmd”. Right-click the “Command Prompt” item which appears, and select “Run As Administrator.”)
  2. Change to the installation directory (For our purposes C:\Apache24\bin).
  3. Run the program httpd.exe.
  4. You will likely notice a dialogue box from the Windows Firewall noting that some features are being blocked. If this appears, place a checkmark in “Private Networks…” as well as “Public Networks…”, and then click “Allow access.”
  5. opening up your Web Browser and typing in the address: http://localhost

If everything is working properly, you should see the ‘Apache test page.’

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

Post a Comment

0 Comments