web.config配置IIS显示详细错误信息 二次开发

管理员 沉冰浮水 2019-5-14 4581

表现:IIS 空间报500错误,但是没有更多的错误提示,甚至乱码显示。

-----------------

本地测试正常但是上传到空间到500错误这种事。。可参照如下配置,,Bug修复后将Detailed 改为 Custom ,前者意为“详细”,后者意为“自定义”。另外直接在虚拟主机控制面板自定义的404页面状态码可能不是404.

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
  <system.webServer>
    <httpErrors errorMode="Detailed" />
    <asp scriptErrorSentToBrowser="true"/>
  </system.webServer>
  <system.web>
    <customErrors mode="Off"/>
    <compilation debug="true"/>
  </system.web>
</configuration>

------------

相关教程:

Ajax返回500的调试定位-Z-BlogPHP-ZBlogger技术交流中心:

https://bbs.zblogcn.com/thread-100995.html

「QQ群:我的咸鱼心」「「水坑」系列教程索引」
我大概率能够解决你实际面临的问题(收费),只是”你提出的问题“要如何回答则可能是另一个问题。

最后于 2019-7-7 被沉冰浮水编辑 ,原因:
最新回复 (1)
全部楼主
  • 管理员 沉冰浮水 2019-11-25 0
    引用 2楼
    PHP版如下:
    <?xml version="1.0" encoding="UTF-8"?>
    <configuration>
      <system.webServer>
        <rewrite>
          <rules>
            <rule name="/ Z-BlogPHP Imported Rule" stopProcessing="true">
              <match url="^.*?" ignoreCase="false" />
              <conditions logicalGrouping="MatchAll">
                <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
                <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
              </conditions>
              <action type="Rewrite" url="index.php/{R:0}" />
            </rule>
            <rule name="/ Z-BlogPHP Imported Rule index.php" stopProcessing="true">
              <match url="^index.php/.*?" ignoreCase="false" />
              <conditions logicalGrouping="MatchAll">
                <add input="{REQUEST_FILENAME}" matchType="IsFile" />
              </conditions>
              <action type="Rewrite" url="index.php/{R:0}" />
            </rule>
          </rules>
        </rewrite>
        <httpErrors errorMode="Detailed" />
      </system.webServer>
    </configuration>


    「QQ群:我的咸鱼心」「「水坑」系列教程索引」
    我大概率能够解决你实际面临的问题(收费),只是”你提出的问题“要如何回答则可能是另一个问题。

    • Z-Blog 开发者社区
      3 楼
        丨  
返回