IIS7.5 + PHP

Source: Internet
Author: User
IIS7.5 + PHP

After Microsoft cooperated with Zend, Microsoft launched a special FastCGI support for IIS. to run PHP under IIS, FastCGI should be used for running, rather than ISAPI.

In versions later than IIS7.0, Microsoft went further and built FastCGI into IIS. that is to say, you only need to extract the php zip package to any directory on the local machine and configure php. ini (do not copy to another location), and then, do not add environment variables, do not add ISAPI filter, as long as you set a place, you can run PHP in The FastCGI mode in the IIS.

How to configure PHP in IIS 7.0 or later versions:

1. in "Turn Windows features on or off (enable or disable windows function)", select "Internet Information Service (IIS Service)". other options can be selected as needed, however, you must select the "CGI" project under "Application Development Features (Application Development component)" under "World wide web services.

2. download any version of the non-thread safe zip package of PHP (PHP's non-security process zip package) and decompress it to any Directory, such as "D: \ Server \ php ".

3. rename php. ini-recommended to php. ini, open it, and modify the following options:
Fastcgi. impersonate = 1
Cgi. fix_pathinfo = 1
Cgi. force_redirect = 0
Extension_dir = "./ext"; is it amazing? General configuration. no matter which Directory your php is installed, it is OK and you do not need to specify the detailed path. this is a new feature.
4. activate the extension options you need. This step is the same as any previous version.
5. open "Internet Information Services (IIS) Manager (IIS Manager)" and select your computer on the left side. (we recommend that you do not select a specific site. the configuration takes effect for all sites ), select "Handler Mapping" on the right and "Add Module Mapping" on the right. in the pop-up window, enter the following prompt:
Request path: *. php
Module: FastCgiModule
Executable: "D: \ server \ php \ php-cgi.exe"
Name: PHP via FastCGI

Now, all the sites on your machine can run PHP in the most efficient and secure way officially recommended by IIS7.5 and PHP5.x. you can install mySQL and Zend optimization as needed, these are the same as before.

Http://learn.iis.net/page.aspx/246/using-fastcgi-to-host-php-applications-on-iis-70/#EnableFastCGI

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.