0

我正在通过 IIS 启用带有 wfastcgi 的烧瓶 python 脚本。

我已经安装并启用了 wfastCGI。但是,在我创建网站并添加带有以下详细信息的 webconfig 文件后 -

<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.webServer>
<modules>
            <remove name="WebDAVModule" />
        </modules>
  <handlers>   
   <add name="Python FastCGI" path="*" verb="*" modules="FastCgiModule" scriptProcessor="c:\users\goe\appdata\local\programs\python\python38\python.exe|c:\users\goe\appdata\local\programs\python\python38\lib\site-packages\wfastcgi.py" resourceType="Unspecified" requireAccess="Script" />
  </handlers>
        <directoryBrowse enabled="true" />
</system.webServer>
<appSettings>
  <!-- Required settings -->
  <add key="WSGI_HANDLER" value="myapp.app" />
  <add key="PYTHONPATH" value="D:\" />
</appSettings>
</configuration>

但是我在尝试验证处理程序映射文件名时看到以下错误

C:\Users\goe\Documents\mywebsite\webconfig Line number:7 
Error : The configuration section can not be used at this path. This happens when section is locked at parent level. Locking is either bu default (overrideModeDefault="Deny"), or set explictly by a location with overrideMode="Deny" or the legacy allowOverride="false"

我需要帮助来解决这个问题,请做必要的我

4

1 回答 1

1

当您未在根 web.config 中设置配置或您错过在 IIS 中安装某些内容时,IIS 会返回此错误。

1.请确保 C:\Users\goe\Documents\mywebsite\ 是您的 Web 服务器的根 web.config。您需要确保在您的 Web 应用程序的根 web.config 中设置了处理程序部分。

2.请确保

<section name="handlers" overrideModeDefault="Allow" />

3.请到配置管理器system.webServer/handlers查看部分是否已解锁。

4.请确保已完全安装IIS功能。

于 2020-08-07T02:49:37.657 回答