开发者

Set server wide enviroment/server variable on IIS 7.5 shared by PHP and ASP.Net

开发者 https://www.devze.com 2023-01-23 04:59 出处:网络
As a unified way for our applications to detect downtime and server maintenance we\'d like to know if there is a way to set a variable that can be set per application pool (or server) and read by PHP

As a unified way for our applications to detect downtime and server maintenance we'd like to know if there is a way to set a variable that can be set per application pool (or server) and read by PHP and ASP.NET.

I know that it's po开发者_如何学编程ssible to set FastCGI environment variables, but those aren't read by ASP.

Any ideas?


I've not tried this in any ASP applications yet, but the solution seems to be independent. I am using this solution for several PHP sites, and it works great. My purpose was to actually use the variable within the web application. I'm running Windows Server 2008 R2. The solution can be found at:

http://learn.iis.net/page.aspx/686/setting-http-request-headers-and-iis-server-variables/

Using IIS7 (or 7.5), with the URL Rewrite Module installed, use its interface to "Manage Server Variables." You can create a new variable or enable an existing variable to be set/overwritten using rewrite rules that you create in the configuration file (web.config) for each site or a the server level.

You mentioned that you would want a different variable per application pool. In my case, I have a different application pool for each website.

I hope this is helpful.

0

精彩评论

暂无评论...
验证码 换一张
取 消