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