win2008 iis7/iis7.5 under the simplest and strongest installation of multi-version PHP support environment, as well as the resolution of the host Bao PHP version is too low to support different websites different PHP version

Source: Internet
Author: User
Tags install php microsoft website

Install multi-version PHP environments with PHP manager,windows R2 IIS7.5

For individuals on the Windows R2, configure the Install PHP environment in the IIS environment in practice with the attention point:

1. If you need to configure MySQL on the server, install MySQL before configuring the PHP environment. (Download the appropriate MySQL version as per your needs)

MySQL installation configuration steps See:

SQL Server 2008 Installation: Http://

win2008 R2 Installing SQL Server 2008 It is important to note that IIS seems to be installing ASP. NET components, otherwise it is prone to problems. Of course, because of the configuration of the server environment, you can search for related error prompts, the script house has been sorted out the relevant solutions.

2, download the PHP version of the package, under the C drive to create a PHP folder, the contents of the package extracted into the folder. (Multiple versions of PHP can be stored in this folder)

3, download install PHP Manager (, after installation, then in the IIS management interface, there will be one more PHP Manager management options.

You don't need to be yourself. In modifying the php.ini file, configure PHP, just use PHP Manager to select the desired PHP version of Php-cgi.exe OK.

For detailed steps, see below:

Law One:

Recently debug program, want to exchange between PHP5.2 and 5.3, and accustomed to the development under windows, wondering how to install multi-version support under IIS, impressively found that Microsoft has prepared a good tool for us.

Microsoft's support for PHP is increasingly strong, this is evident in IIS7, not only fastcgi support, but also for the management of PHP specifically added a PHP manager. With this stuff, installing PHP based on IIS7 in a Windows environment is a breeze.

Although PHP5.3 has been out for a long time now, many open-source PHP programs are not well-supported or PHP5.2-mainstream. With the good stuff of PHP manager, it's also easy to install multiple versions of PHP under IIS.

The steps are as follows:

1. On the Microsoft website, download php Manager ( and double-click Install. In this case, there will be one more PHP Manager management option in the IIS Admin interface.

2. Download the Windows version of the PHP program from the PHP official website. Because it runs in fastcgi mode, the newest 5.2.17 and 5.3.8 choose to download the zip version of NTS (non-thread safe). After downloading, find a place to decompress separately, for example, under the 5.2 and 5.3 directories under C:\PHP.


3. Go to the IIS Admin interface, double-click PHP Manager, select Register New PHP version, this is a pop-up box, select the 5.2 version of the Php-cgi.exe file, confirm. Then click Register New PHP version, select the 5.3 version of the Php-cgi.exe file under the directory, confirmed, the multi-version of the environment is ready. It's simple.

To use that PHP version, click Change PHP versions to select the desired version. To verify that it is set up, you can also click the Check Phpinfo () next to it to see the appropriate PHP setup information.

4. PHP Manager in the PHP setup also simplifies a lot, can be in PHP setting and PHP Extension directly visual management php.ini, and view the corresponding IIS configuration, will find PHP The manager has generated the corresponding mapping for us, it is really convenient to get home.

This should be the simplest and most effective way to install PHP and multi-version support under IIS!

Law II:

First, the following PHP Manager for IIS to IIS7 and more than 7 version of the PHP multi-version support.

Another day, we will introduce Microsoft's Urlrewrite 2.0 support for IIS7 and how to extend Urlrewrite.

The first step is of course installed, download the PHP Manager for IIS and install it. Http://

The PHP Manager icon appears in IIS Manager when the installation is complete. Such as:

After double-clicking, the specific configuration management of PHP will appear.

To register the PHP version you want to run, find the path to the file php-cgi.exe OK.

The configuration is automatically checked after registration, and if some of the configurations and recommended configurations are not always displayed, the appropriate error message appears. As follows:

Click "View Recommendations" to see the specific error message.

If you have multiple versions of PHP registered, you can easily switch between versions:

The "Check phpInfo" next to the cut version is also our favorite stuff. Very convenient to view specific configuration information:

Reference Address:

Attached +

This article describes how to configure IIS to support multiple versions of PHP on the same server. This is useful in a development environment where you need to test different versions of the PHP application. In addition, it is often used in production environments, where many PHP applications reside on the same server, some of which depend on a specific PHP version.

In order to install multiple versions of PHP at the same time on the same IIS server, you must manually install them according to the steps described in IIS 5.1 and IIS 6.0 and IIS 7.0 and later versions of documentation. Do not use PHP's Windows Installer because it does not support parallel installation.

After the specific PHP version follows the instructions to install, download another version of PHP, extract it to a separate directory, and configure it according to the manual installation steps. After this, follow the instructions below to configure each of the IIS servers:

IIS 5.1

IIS 6.0

IIS 7.0 and later versions

Note: All the examples in the following two PHP versions are installed on the same server. PHP 5.2.11 files are located in the C:\PHP5211\ directory and PHP 5.3.1 files are located in the C:\PHP531\ directory.

In IIS 5.1

The FASTCGI expansion pack can be configured to the same server and site level. Since 5.1 can only have one site, it is not possible to configure it to have two versions of PHP running at the same time. However, there may be a configuration that allows easy switching from one version to another.

Open the configuration file for the IIS FastCGI extension package that is located in%windir%\system32\inetsrv\fcgiext.ini. At the end of the article there will be a section defining the FASTCGI application. It may look like this:


PHP = php5211


ExePath = C:\php5211\PHP-cgi.exe

Whenever A *. PHP files require IIS to be configured using PHP 5.2.11. To switch to PHP 5.3.1, add another part of the declaration, and then modify the section as follows:


; php= php5211

php= php531


ExePath = C:\php5211\PHP-cgi.exe


ExePath = C:\php531\PHP-cgi.exe

Switch back to PHP 5.2.11 Update [type] by commenting PHP = php531 and canceling php = php5211. There is no need to restart IIS after you update Fcgiexe.ini. The FASTCGI expansion pack has collected all the changes before the file is saved.

In IIS 6.0

The fastcgi in IIS 6.0 can be configured at the server level, which causes all IIS Web sites to use the same PHP version. The procedure for switching between fastcgi and PHP versions at the server level is the same as for configuring IIS 5.1.

In addition fastcgi can be configured at the site level, this will allow different websites to use different PHP versions, specify a specific PHP version of the site, please use the following command. Be sure to replace it with a real site.

cscript%windir%\system32\inetsrv\fcgiconfig.js-add-section: "php5211" ^

-extension:php-path: "C:\php5211\php-cgi.exe"-site:

cscript%windir%\system32\inetsrv\fcgiconfig.js-add-section: "php531" ^

-extension:php-path: "C:\php531\php-cgi.exe"-site:

After you execute these commands, open the Fcgiext.ini file in%windir%\system32\inetsrv. It should contain the following sections:


php:169297538 = php5211; the actual site ID will not be the same as your site

php:273357939 = php531; the actual site ID will not be the same as your site


ExePath = C:\php5211\PHP-cgi.exe


ExePath = C:\php531\PHP-cgi.exe

This article transferred from:

win2008 iis7/iis7.5 under the simplest and strongest installation of multi-version PHP support environment, as well as the resolution of the host Bao PHP version is too low to support different websites different PHP version

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: 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.