iis7.0 Configuring PHP

Source: Internet
Author: User
Tags microsoft iis
Microsoft IIS 7.0 and later

This section contains instructions-Manually setting up Internet information Services (IIS) 7.0 and later PHP on Microsoft Windows Vista SP1, Windows 7, Windows Server, and Windows Server R2. For instructions on setting-IIS 5.1 and IIS 6.0 on Windows XP and Windows Server 2003 refer to Microsoft IIS 5.1 and II S 6.0.

Enabling FastCGI support in IIS

FastCGI module is disabled in default installation of IIS. The steps to enable it differ based on the version of Windows being used.

To enable FastCGI for Windows Vista SP1 and Windows 7:

In the Windows Start menu choose "Run:", type "Optionalfeatures.exe" and click "OK";

In the ' Windows Features ' dialog expand "Internet Information Services", "World Wide Web Services", "Application Developme NT Features "and then enable the" CGI "checkbox;

Click OK and wait until the installation is complete.

To enable FastCGI in Windows Server, and Windows Server R2:

In the Windows Start menu choose "Run:", type "Compmgmtlauncher" and click "OK";

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

If the "Web Server (IIS)" Role is present, then click "Add Role Services" and then enable the "CGI" checkbox under "Applic ation development "group;

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

Configuring IIS to process PHP requests

Download and install PHP in accordance to the instructions described in manual installation steps

Note:

Non-thread-safe build of PHP is recommended when using IIS. The Non-thread-safe builds is available at»php for windows:binaries and Sources releases.

Configure the Cgi-and fastcgi-specific settings in Php.inifile as shown below:

Example #1 CGI and FastCGI settings in php.ini

Fastcgi.impersonate = 1fastcgi.logging = 0cgi.fix_pathinfo=1cgi.force_redirect = 0

Configure IIS handler mapping for PHP by using the either IIS Manager user interface or a command line tool.

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

Follow these steps to create a IIS handler mapping for PHP in IIS Manager user interface:

In the Windows Start menu choose "Run:", type "inetmgr" and click "OK";

The IIS Manager user interface Select the server node in the "Connections" tree view;

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 "Request Restrictions" button and then configure the mapping to invoke handler only if Request are mapped to a file O R a folder;

Click OK on the dialogs to save the configuration.

Reprint: http://cn2.php.net/manual/zh/install.windows.iis7.php

  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.