IIS7 是否需要 web.config 来为 PHP 网站提供服务?
我与一家托管公司签订了 ASP.NET 托管计划。我使用 Windows Server 2008 创建了许多仅提供 PHP(无 .NET)内容的网站,并且我的 wwwroot 文件夹中不需要 web.config。现在,我的一个客户购买了一些主机(与我的同一家公司),当我创建一个 hello world 网站并尝试提供 index.php 时,我得到了 403。所以我通过控制面板,更新了网站的设置,并注意到在他的 wwwroot 目录中创建了一个 web.config。如果这个 web.config 不存在,我会得到 403。但我的东西没有这个问题。有什么想法吗?因为我出去
了我和我的客户拥有同一家网络托管公司。这并不是一个真正的大问题,但我只是在寻找一些关于为什么他的服务器需要 web.config 而我的服务器不需要的见解。 AFAIK,我们都使用 Windows Server 2008、IIS7,并且我已经将它们设置为完全相同的 w/.NET 4.0 集成管道等等。
I have an ASP.NET hosting plan with a hosting company. I've made many websites that only serve PHP (no .NET) stuff using Windows Server 2008 and I don't need a web.config in my wwwroot folder. Now, a client of mine purchased some hosting (w/same company as mine) and when I did a hello world site and tried to serve index.php, I got a 403. So I went through the control panel, updated the website's settings, and noticed a web.config was created in his wwwroot directory. If this web.config is not present, I get the 403. But my stuff doesn't have this problem. Any ideas? because I'm out
P.S. My client and I have the same web hosting company. This isn't really a big problem, but I'm just looking for some insight as to why his server requires the web.config and mine doesn't. AFAIK, we both are on Windows Server 2008, IIS7, and I've set them up exactly the same w/.NET 4.0 Integrated Pipeline, etc etc etc.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
由于您没有说明 Web 配置文件的内容是什么,所以我会说您客户端服务器上的服务器配置文件与您的服务器上的服务器配置文件不同。它可能是配置不同的较新或较旧的服务器。服务器上的设置允许 php 应用程序无需额外配置即可运行,但在客户端服务器上,应用程序实例的自定义 Web 配置必须覆盖默认设置,以允许 php 应用程序运行。
Since you don't say what the contents of the web config file are, I'll take a stab and say that the server config file on your client's server is different than it is on yours. It could be a newer or older server that was provisioned differently. The settings on your server allow the php app to run without additional configuration, but on the client's server, the defaults have to be overridden by his custom web config for his application instance to allow the php app to run.