gpt4 book ai didi

python-2.7 - 在 应用程序配置中找不到 Azure Flask scriptProcessor

转载 作者:行者123 更新时间:2023-12-03 16:52:28 24 4
gpt4 key购买 nike

我正在尝试在 Azure Web 应用程序中部署 Python Flask 应用程序。我已经创建了网络应用程序(Flask)并发布了我的代码。发布后,我从网站收到以下错误。

The page cannot be displayed because an internal server error has occurred.

当检查日志时,我可以看到以下错误。

enter image description here

但这仅发生在我的订阅中(通过 MSDN 获得免费订阅)。但在组织订阅中工作正常。

最佳答案

<fastCGI>设置必须位于 applicationHost.config 中IIS 的文件(在 system.webServer 部分)。只需将其放入 web.config不起作用(通过在本地 IIS 上测试它来确认,而不是在 Azure 中)。示例配置可能如下所示:

<fastCgi>
<application
fullPath="D:\home\Python27\python.exe"
arguments="D:\home\Python27\wfastcgi.py"
maxInstances="16"
idleTimeout="21600"
instanceMaxRequests="10000000"
signalBeforeTerminateSeconds="60"
xdt:Transform="InsertIfMissing"
xdt:Locator="Match(fullPath)">
<environmentVariables>
<environmentVariable name="PYTHONHOME" value="D:\home\Python27" />
</environmentVariables>
</application>
</fastCgi>

您可能想要调整此配置。

这应该可以解决本地 IIS 的问题,您可以在其中编辑 applicationHost.config 。我不确定 Azure,但也许您可以在这里找到一些提示:https://github.com/Azure/azure-python-siteextensions/issues/2 .

关于python-2.7 - 在 <fastCGI> 应用程序配置中找不到 Azure Flask <handler> scriptProcessor,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42438459/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com