gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-12-03 01:06:55 24 4
gpt4 key购买 nike

我刚刚在本地服务器上完成了 PHP API,它运行得很好。现在我尝试将其部署在 Azure Web App 上,但在任何 get/post 请求期间收到错误,例如: enter image description here

这是我的 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 或更高版本。

enter image description here

将您的处理程序配置替换为以下内容。它应该可以工作。

<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>

如果您希望继续在 Azure Web 应用程序中运行 PHP 5.3,请按照 How to: Use a custom PHP runtime 中的步骤操作。显式设置站点的 PHP 运行时。

关于php - Azure 网站 PHP API - 不允许使用 500 方法,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45738876/

24 4 0
文章推荐: azure - Azure 上的专用代理部署
文章推荐: Javascript 函数在复选框的 onclick 上不起作用
文章推荐: vba - MsgBox 后出现类型不匹配错误
文章推荐: javascript - 如何用jquery动态添加