W
W
Whitewavex2020-12-05 17:12:39
PHP
Whitewavex, 2020-12-05 17:12:39

How to change the PHP version for a single site based on IIS7 (Windows Server 2008 R2)?

Hello.
There is a server based on IIS7. It has several websites. PHP version 5.4.45 is installed on all sites.
I need to change the PHP version on one site to PHP 7.2.0
I do the following procedure:

1. Download the archive php-7.2.0-nts-Win32-VC15-x64.zip
2. Extract the contents to C:\Program Files (x86)\ PHP\php 7.2.0
3. I change the following items in php.ini:
fastcgi.impersonate = 1
cgi.fix_pathinfo = 1
cgi.force_redirect = 0
open_basedir = "D:\sites"
extension_dir = "C:\Program Files (x86) \PHP\php 7.2.0\ext"
4. Open IIS Manager, select the site (on which you want to change the PHP version), select the Handler Mappings item
5fcb950b8f04e757399970.jpeg
5. Edit the PHP_via_FastCGI module in this way:
Request path: * .php
Module: FastCgiModule
Executable : ""C:\Program Files (x86)\PHP\php 7.2.0\php-cgi.exe""
Name: PHP_via_FastCGI
5fcb951d5ec14948302900.jpeg
5. Run info.php
in the Loaded Configuration File field the same path to the old PHP is registered (C:\Program Files (x86)\PHP\php.ini)
As far as I understand, the mysql, mysqli, pdo_mysql extensions are not connected.
5fcb953619bfe622168515.jpeg
5fcb953d6e173060692695.jpeg
The applicationHost.config file contains the following lines:

<fastCgi>
            <application fullPath="C:\Program Files (x86)\PHP\php-cgi.exe" activityTimeout="600" requestTimeout="600" instanceMaxRequests="10000">
                <environmentVariables>
                    <environmentVariable name="PHP_FCGI_MAX_REQUESTS" value="10000" />
                    <environmentVariable name="PHPRC" value="C:\Program Files (x86)\PHP\" />
                </environmentVariables>
            </application>
            <application fullPath="C:\Program Files (x86)\PHP\php 5.5.30\php-cgi.exe" />
            <application fullPath="C:\Program Files (x86)\PHP\php 7.4.13\php-cgi.exe" />
            <application fullPath="C:\Program Files (x86)\PHP\php 5.6.9\php-cgi.exe" />
            <application fullPath="C:\Program Files (x86)\PHP\php 5.6.21\php-cgi.exe" />
            <application fullPath="C:\Program Files (x86)\PHP\php 7.2.0\php-cgi.exe" />
        </fastCgi>


What am I doing wrong?
Why extensions are not connected?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question