错误的PHP版本显示在phpinfo Azure Web应用程序

问题描述:

当我从Azure门户的Azure Web应用程序将PHP版本从5.6更改为7.1时,将成功。但是当我从一个php文件运行phpinfo()时,它仍然向我展示PHP的旧版本5.6.31。另外,我上传到Azure Web App的代码不理解7.1更改..错误的PHP版本显示在phpinfo Azure Web应用程序

我已经从Azure CLI更新了PHP版本并重新启动了服务器。但没有运气:(没有任何人有另一种选择来试试呢?

enter image description here

enter image description here

我不能重现此问题,但您可以尝试几个选项。

选项1:

添加一条线到处理程序映射具有以下值:

扩展*.php

处理器路径D:\Program Files (x86)\PHP\v7.1\php-cgi.exe

enter image description here

选项2:

创建一个web.config文件并将其放到您网站的根文件夹中。

<?xml version="1.0" encoding="utf-8" ?> 
<configuration> 
    <system.webServer> 
    <handlers> 
     <add name="FastCGIHandler" path="*.php" verb="GET,HEAD,POST" modules="FastCgiModule" scriptProcessor="D:\Program Files (x86)\PHP\v7.1\php-cgi.exe" /> 
    </handlers> 
    </system.webServer> 
</configuration> 

所有预安装PHP运行时可以找到D:\Program Files (x86)\PHP(86)和D:\Program Files\PHP(64)。

enter image description here

+0

你是对的!在web.config文件中,我有PHP 5.6 ...将其更改为7.1,我工作! – Flappy