Answer the question
In order to leave comments, you need to log in
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
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
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.
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>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question