wfastcgi启用失败检查(Ensure your user has sufficient privileges and try again)

C:\Users\XXX>wfastcgi-enable
ERROR ( message:New application object missing required attributes. Cannot add duplicate collection entry of type 'application' with combined key attributes 'fullPath, arguments' respectively set to 'e:\python\python\python.exe, e:\python\python\lib\site-packages\wfastcgi.py'
. )
An error occurred running the command:

['C:\\WINDOWS\\system32\\inetsrv\\appcmd.exe', 'set', 'config', '/section:system.webServer/fastCGI', "/+[fullPath='e:\\python\\python\\python.exe', arguments='e:\\python\\python\\lib\\site-packages\\wfastcgi.py', signalBeforeTerminateSeconds='30']"]

Ensure your user has sufficient privileges and try again.

可能是之前启用的没有禁用,可以先禁用再启用试试。

wfastcgi-disable
wfastcgi-enable

如果还是不行,可以检查IIS中的FastCGI设置是否正确。

之后检查自己的web.config,在自己的网站根目录下。

<?xml version="1.0" encoding="UTF-8"?>
    <configuration>
        <system.webServer>
            <handlers>
                <add name="Python FastCGI" 
                     path="*" 
                     verb="*" 
                     modules="FastCgiModule" 
                     scriptProcessor="<Path to Python>\python.exe|<Path to Python>\lib\site-packages\wfastcgi.py" 
                     resourceType="Unspecified" 
                     requireAccess="Script"/>
            </handlers>
        </system.webServer>
    </configuration>

'Path to Python’这里填写脚本解析器(python.exe)和wfastcgi.py的绝对路径 【解析器路径可以用python安装目录下的python.exe 也可以用python虚拟环境的python.exe,根据自己的情况选择即可】。

如何配置IIS 可以参考文章

https://blog.youkuaiyun.com/bigcarp/article/details/121028820

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值