win2008 iis7/iis7.5 The simplest and strongest installation of multiple versions of PHP support environment _win Server

Source: Internet
Author: User
Tags install php

Use PHP manager,windows 2008 R2 IIS7.5 Install multiple versions of PHP environment

Personal on Windows 2008 R2, configure the installation PHP environment in the IIS environment to focus on the practice:

1, if you need to configure MySQL on the server, in the configuration of PHP environment before installing MySQL. (according to their own needs, download the appropriate version of MySQL)

MySQL installation configuration steps please check:

SQL Server 2008 Installation: Http://

win2008 R2 Install SQL Server 2008 you need to be aware that IIS appears to be installing and. 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, cloud-dwelling communities have previously sorted out the relevant solutions.

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

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

You don't need to change your php.ini file, configure PHP, just use PHP Manager to select the PHP version you want php-cgi.exe OK.

For detailed procedures, see the following:

Law I:

The most recent debugging program, in PHP5.2 and 5.3 to exchange between, and accustomed to the development of windows, on how to install multiple version of the support under IIS, impressively found that in fact, Microsoft has prepared a good tool for us.

Microsoft's growing support for PHP is evident in IIS7, not only with fastcgi support, but also by adding a PHP manager for PHP Management. 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 very good to support it, or PHP5.2 for the mainstream. With the good stuff of PHP manager, it's easy to install multiple versions of PHP under IIS.

The specific steps are as follows:

1. Download php Manager ( on Microsoft's website and double-click Install. 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 web site. Because of the fastcgi mode, the most recent 5.2.17 and 5.3.8 have opted to download nts (not thread safe) Zip version. After downloading, find a place to decompress, for example, under the C:\PHP of 5.2 and 5.3 respectively under the directory.

Official Download Address:

3. Enter the IIS management interface, double-click PHP Manager, select Register New PHP version, this is a pop-up selection box, select the 5.2 version of the directory under the Php-cgi.exe file, confirm. Then click Register New PHP version, select the 5.3 version of the Php-cgi.exe file, confirmed, multiple versions of the environment will be built. It's easy.

To use that PHP version, click Change PHP version to select the desired edition. To verify that the settings are set, you can also click the Check Phpinfo () next to view the corresponding PHP settings information.

4. PHP Manager in the PHP settings 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 built a map for us and it's really convenient to get home.

This should be the simplest and most effective way to install PHP and multiple versions of support under IIS!

Law II:

Let's first introduce PHP Manager for IIS support for IIS7 and more than 7 versions of PHP.

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

The first step is of course to install, download the PHP Manager for IIS and install it. Download Address

The PHP Manager icon appears inside IIS Manager when the installation is complete. The following figure:

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

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

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

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

If you are registering multiple PHP versions, you can easily switch versions:

Next to the cut version of the "Check phpinfo ()" is also our favorite stuff. Easy 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 for installing in a development environment where you need to test different versions of the PHP version of the 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 particular version of PHP.

In order to install multiple versions of PHP concurrently on the same IIS server, you must install them manually according to the procedures described in documentation IIS 5.1 and IIS 6.0 and IIS 7.0 and later. Do not use the Windows Installer for PHP because it does not support parallel installations.

After a specific version of PHP is installed, download another version of PHP, extract it to a separate directory, and configure it according to the manual installation steps. After this, configure each IIS server by following these instructions:

IIS 5.1

IIS 6.0

IIS 7.0 and later

Note: All of the examples in the following two PHP versions are installed on the same server. PHP's 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 Web 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 located in%windir%\system32\inetsrv\fcgiext.ini. At the end of this article, a portion of the FASTCGI application is defined. It might look like this:


PHP = php5211


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

Every time a *. PHP files require the use of PHP 5.2.11 to configure IIS. 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 Fcgiexe.ini is updated. The FASTCGI expansion pack has collected all changes before the file is saved.

In IIS 6.0

FastCGI in IIS 6.0 can be configured at the server level, which will cause all IIS Web sites to use the same PHP version. The steps for configuring the switch between fastcgi and PHP versions at the server level and configuring IIS 5.1 are the same.

In addition fastcgi can be configured at the site level, which will allow different Web sites to use different PHP versions, specifying a specific PHP version of the site, please use the following command. Make sure you 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

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.