我试图在运行IIS 7.5的hostgator上的远程服务器上使用web.config在页面上显示详细的错误消息。我已经尝试了几乎所有内容,但无法正常工作。
<configuration>
<system.webServer>
<httpErrors errorMode="Detailed" existingResponse="PassThrough" />
</system.webServer>
</configuration>
当我预览页面时,出现此错误。
处理URL时服务器上发生错误。请联系
系统管理员。
如果您是系统管理员,请单击此处以了解更多信息。
这个错误。
最佳答案
您所拥有的是正确的,但是您还需要告诉Classic ASP处理程序将错误发送到浏览器或默认浏览器
An error occurred on the server when processing the URL. Please contact the system administrator. If you are the system administrator please click here to find out more about this error.
will be sent.
To do this you just need to override the current ASP configuration by updating the web.config
file, something like;
<configuration>
<system.webServer>
<httpErrors errorMode="Detailed" existingResponse="PassThrough" />
<asp scriptErrorSentToBrowser="True" />
</system.webServer>
</configuration>
由于IIS配置继承的工作方式很酷,因此应使用特定于站点的
False
文件中定义的值覆盖applicationHosts.config
中web.config
的默认值。值得注意的是,在某些无法访问服务器配置的预算/共享托管环境中,设置某些配置值可能会遇到问题,因为所有者(托管公司等)已将
applicationHosts.config
部分配置为overrideModeDefault="Deny"
值,从而锁定了在Web应用程序级别覆盖配置值。有用链接
web.config
文件中配置的详细信息属性和childNodes)关于asp-classic - 在IIS 7.5上显示详细的错误消息,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42965900/