Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/csharp-4.0/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Azure网站上不允许使用PHP API-500方法_Php_Api_Azure - Fatal编程技术网

Azure网站上不允许使用PHP API-500方法

Azure网站上不允许使用PHP API-500方法,php,api,azure,Php,Api,Azure,我刚刚在本地服务器上完成了PHPAPI,它工作得非常好。现在我尝试将其部署到Azure Web App上,但在任何get/post请求期间都出现了错误,如: 这是我的web.config文件: <configuration> <location> <system.webServer> <security> <authentication>

我刚刚在本地服务器上完成了PHPAPI,它工作得非常好。现在我尝试将其部署到Azure Web App上,但在任何get/post请求期间都出现了错误,如:

这是我的web.config文件:

<configuration>
    <location>
        <system.webServer>
            <security>
                <authentication>
                    <anonymousAuthentication enabled="true" />
                    <iisClientCertificateMappingAuthentication enabled="true" oneToOneCertificateMappingsEnabled="true" manyToOneCertificateMappingsEnabled="false" logonMethod="ClearText">
                        <oneToOneMappings>
                            <clear />
                            <add userName="domain\user" password="pass" certificate="the certificate blob" />
                        </oneToOneMappings>
                        <manyToOneMappings>
                            <clear />
                        </manyToOneMappings>
                    </iisClientCertificateMappingAuthentication>
                    <windowsAuthentication enabled="false" />
                </authentication>
                <access sslFlags="Ssl, SslNegotiateCert, SslRequireCert" />
            </security>
            <defaultDocument enabled="true">
                <files>
                    <clear />
                    <add value="index.php" />
                    <add value="index.htm" />
                    <add value="index.html" />
                </files>
            </defaultDocument>
            <handlers>
                <remove name="PHP53_via_FastCGI" />
                <add name="PHP53_via_FastCGI" path="*.php" verb="GET, PUT, POST, HEAD, OPTIONS, TRACE, PROPFIND, PROPPATCH, MKCOL, COPY, MOVE, LOCK, UNLOCK" modules="FastCgiModule" scriptProcessor="D:\Program Files (x86)\PHP\v5.3\php-cgi.exe" resourceType="Either" requireAccess="Script"
                />
            </handlers>
        </system.webServer>
    </location>
</configuration>

默认情况下,PHP v5.3在Azure Web App上不可用。这可能会引起你的问题。您可以将PHP运行时升级到v5.5或更高版本

处理程序
配置替换为以下内容。它应该会起作用

<handlers>
    <remove name="PHP56_via_FastCGI" />
    <add name="PHP56_via_FastCGI" path="*.php" verb="GET, PUT, POST, HEAD, OPTIONS, TRACE, PROPFIND, PROPPATCH, MKCOL, COPY, MOVE, LOCK, UNLOCK" modules="FastCgiModule" scriptProcessor="D:\Program Files (x86)\PHP\v5.6\php-cgi.exe" resourceType="Either" requireAccess="Script" />
</handlers>


显式设置站点的PHP运行时。

您在哪里看到“不允许使用方法”?谢谢!我使用PHP7.1。所以我必须用71替换56,用7.1替换5.6,才能使它工作。对我来说不起作用: