簡體   English   中英

IIS - Flask python 腳本 webconfig 錯誤 wfastcgi

[英]IIS - Flask python script webconfig error wfastcgi

我在 IIS 上使用 wfastcgi 啟用 flask 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"

我需要幫助來解決這個問題,請做必要的我

當您未在根 web.config 中設置配置或您錯過在 IIS 中安裝某些內容時,IIS 會返回此錯誤。

1.請確保 C:\Users\goe\Documents\mywebsite\ 是您的 web 服務器的根 web.config。 您需要確保在 web 應用程序的根 web.config 中設置了處理程序部分。

2.請確保

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

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

4.請確保 IIS 功能已完全安裝。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM