IIS7主机安装WORDPRESS报500错误的解决办法

在windows IIS7主机上安装Wordpress时报500错误,代码如下:
500 – Internal server error.
There is a problem with the resource you are looking for, and it cannot be displayed.
经测试发现传很多网站程序时均报下500错误,后面上网查才明白,原来IIS的主机如果程序出错的话就直接报以下错误,即使你是刚上传的Wordpress程序,因为Wordpress默认是没有配置的,肯定会报错提示你输入配置信息,而这刚好与IIS的主机相冲突,所以就会报如下错误,解决方法很简单,如果你用的Windows IIS6或者IIS7主机,把以下代码复制下来,命名为web.config上传至网站根目录即可。
我按如下方法上传到网站根目录后打开网站就进入了Wordpress博客程序配置界面,配置完成后成功运行Wordpress。
Windows IIS6的用户使用下面的代码

<configuration>
    <system.web>
        <customErrors mode=”Off”/>
        <compilation debug=”true”/>
    </system.web>
</configuration>




Windows IIS7的用户使用下面的代码


<configuration>
    <system.webServer>
        <httpErrors errorMode=”Detailed” />
        <asp scriptErrorSentToBrowser=”true”/>
    </system.webServer>
    <system.web>
        <customErrors mode=”Off”/>
        <compilation debug=”true”/>
    </system.web>
</configuration>








以上代码保存为web.config上传至网站根目录即可。
另外要说的一点是网站程序一般都需要读写权限,在排除是网站权限的情况下,再上传上面的代码进行测试。

Leave a Reply

Your email address will not be published.