删除IIS的环境变量 [英] Deleting an environmental variable for IIS

查看:71
本文介绍了删除IIS的环境变量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我了解到,为了使IIS读取新的环境变量,我必须通过管理员命令将其重置:

I've understood that, in order to make IIS read a new environmental variable, I have to reset it via an administrator's command:

iireset /restart

我知道也可以从服务器级别的管理面板重新启动IIS.在我之前的问题/答案中,可以了解完整的Web应用程序设置的更多情况:简而言之,这是一个在IIS上运行的Python Flask应用程序通过 WSGI和FastCGI .

I know that one can also restart IIS from the admin panel at server level. More context to my complete web app setup in my previous question/answer: in brief it is a Python Flask app running on IIS through WSGI and FastCGI.

现在仍然令我感到惊讶的是,如果我删除先前创建的环境变量,即使在重新启动之后,IIS仍然会看到它,如上所述.

What is still surprising me is that now, if I delete a previously created environmental variable, IIS keep seeing it, even after restarting it, as done above.

为什么可能会发生这种情况?以及如何删除IIS的变量?

Why is that possibly happening? And how should I delete the variable for IIS?

推荐答案

如果您坚持要使用环境变量(请注意,您还具有备用的 .env 文件),那么您需要通过IIS管理员的IIS FastCGI设置在服务器级别为特定应用程序(通过 wfastcgi-enable 启用的应用程序)进行设置.

If you insist that you want to go with environmental variables (notice that you also have the alternative .env file), then you need to set them via the IIS FastCGI Settings from the IIS admin at server level for your specific application (the one you enabled via wfastcgi-enable).

如上所述,编辑特定行,您将在常规"(General)栏下找到环境变量"(Environment Variables)集合.组的FastCGI属性.

Edit the specific row as said above and you'll find the Environment Variables collection under the "General" group of FastCGI Properties.

现在您可以添加和删除任何这些变量,它将立即生效,而无需重新启动IIS.

Now you can add and delete any of those variables and it will take effect immediately, without the need of any IIS reboot.

这篇关于删除IIS的环境变量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆