IIS7 the coexistence of multiple versions of PHP in IIS8

Source: Internet
Author: User
Tags php open source project

Original address:

Https://blog.cozof.com/pieces/54.shtml

Recently returned to. NET, using back to IIS. Then use a PHP open source project, the need for a lower version of PHP, before the installation of a php5.5 can not be used, so decided to drop the version, later found that can actually be shared with multiple versions. So I'm going to share it. Before sharing the first online search, there are found that someone realized, but the method is different, so share the following:

My computer is Win7 64-bit

PHP can be downloaded on the official website http://windows.php.net/download/,php 5.4 Before the version seems to be gone, the old version I was looking for elsewhere.

We will use the FastCGI module to download the non-thread safe (Non thread safe) version directly, the efficiency is high. x86 is 32 bit, x64 is 64 bit wrong, then click Zip Download.

Download and unzip into a directory, such as:

E:\php7.0.3\

E:\php5.5.30\

E:\php5.2.6\

PHP.ini configuration here will not say, the original how to set how to set.

Steps

1. Open IIS 7. IIS top-level > handler Mappings

2. Add module mappings to the right

3. In the window that pops up

Path Write *.php module select Fastcgimodule, executable file is PHP directory Php-cgi.exe

Please fill in the name, in order to remember the PHP version name, and then determine.

Add multiple versions of PHP in a few more times

4. A Web. config file is not automatically generated for each site directory because it is added at the top level of IIS, rather than at the point where a site is added. We can add a utf-8 encoded Web. config file ourselves to the Web site directory, to invoke different versions of PHP, regardless of whether there are multiple versions of PHP, need such a Web. config file, the content is as follows:

<?xml version= "1.0" encoding= "UTF-8"?><configuration>    <system.webServer>        

The main is the ScriptProcessor (script processor) path, decided to call a different version of PHP.

<remove name= "php5.5.30"/> is also important to remove all versions of PHP first (here "Name=" is the name previously filled). Add name= to ensure that the desired version is tuned in.

Note: If the Remove is only 3, and in fact you add 5 versions of PHP, in order to ensure that the correct version of the call, the other two should be added in.

And then it's ready. There is a new station, then put this web. config to the site directory, and then modify the path of the next scriptprocessor can be.

I have a few PHP common is a MySQL, version is 5.6.24, can be used normally.

Because PHP different versions are not backward compatible, such as php5.6 later does not support the mysql_* function to connect MySQL database, only support mysqli_* and pdo_*, so multi-version coexistence or more meaningful.

IIS7 the coexistence of multiple versions of PHP in IIS8

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.