[提问]
VDS IIS7下安装PHP+Mysql时,web.config中rewrite功能出现500错误
|
|
请各位高手帮帮忙,非常感谢
目标:Godaddy VDS win2008下IIS7可以访问PHP+Mysql站点
问题:花了两天时间搞这个环境,但最后发现,因为程序用到Rewrite伪静态重写功能,为什么在web.config加上了rewrite语句就会出现500错误,而去掉rewrite语句段就是好的,剩下这个小问题还没有解决掉,感谢各位给予兄弟一些帮助,谢谢。
我的能正常访问web.config文件内容如下:(注意:不加rewrite时网站运行完全正常):
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<httpErrors errorMode="Detailed" />
<asp scriptErrorSentToBrowser="true" />
<defaultDocument>
<files>
<add value="default.php" />
<add value="index.php" />
</files>
</defaultDocument>
<handlers>
<add name="php" path="*.php" verb="*" modules="IsapiModule" scriptProcessor="C:\AppServ\php5\php5isapi.dll"
resourceType="Unspecified" preCondition="bitness32" />
</handlers>
</system.webServer>
<system.web>
<customErrors mode="Off" />
<compilation debug="true" />
</system.web>
</configuration>
加上一段rewrite功能web.config文件内容如下(注意:加上rewrite后网站就出现500错误了)
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="Rewrite to index">
<match url="^index.html$" />
<action type="Rewrite" url="index.php" />
</rule>
</rules>
</rewrite>
<httpErrors errorMode="Detailed" />
<asp scriptErrorSentToBrowser="true" />
<defaultDocument>
<files>
<add value="default.php" />
<add value="index.php" />
</files>
</defaultDocument>
<handlers>
<add name="php" path="*.php" verb="*" modules="IsapiModule" scriptProcessor="C:\AppServ\php5\php5isapi.dll"
resourceType="Unspecified" preCondition="bitness32" />
</handlers>
</system.webServer>
<system.web>
<customErrors mode="Off" />
<compilation debug="true" />
</system.web>
</configuration>
请各位帮我找一下原因,为什么加了rewrite就会出现500错误,再次感谢各位的帮助。
附上的我安装步骤:
Godaddy VDS Win2008 + IIS7 下安装mysql +php步骤
========================================================================================
一、appserv安装
1、安装appserv,端口设置为8080,装好后可以看看开始菜单里的appserv文件夹下的几个有用的功能。
2、访问http://test.yourdomain.com:8080和下面的链接phpinfo.php 测试是否正确安装。
3、访问http://test.yourdomain.com:8080/phpMyAdmin/ 输入root密码为空,对root帐号密码进行修改。
4、导入ECSHOP后台导出的sql数据库结构和数据。
a、库大小大于2M的时候,会出现size exceeded the maximum size 错误,按照本文最底下的方法处理即可。
b、出现 Maximum execution time of 30 seconds exceeded,按照本文最底下的方法处理即可。
c、出现 Import has been successfully finished, 623 queries executed. 就OK了
5、将网站放置在c:\appserv\www下面,设置相应的数据库连接,apache下的访问完成。
二、IIS7设置
========================================================================================
1、设置IIS下某个应用程序池属性高级里 “启动32位应用程序”为true,这样才能访问PHP文件
2、加上ISAPI Fiters 和 Handler Mapping,加上*.php C:\appserv\php5\php5isapi.dll
3、测试 <?php phpinfo();?>
4、如果在IIS7下访问phpinfo中没有mysql配置表格选项,说明没有配置正确
5、数据库不能加载的解决办法:见文 “apache加载php.ini正常,但IIS7未加载php.ini的问题.txt”
6、不加web.config rewrite伪静态功能的话,IIS7+PHP+mysql访问OK了。 |
|
|
|
|
|
|
|
|
|
|
bclz
发表于 2011-11-27 00:42:55
|
显示全部楼层
问题已经解决
|
安装一下rewrite的插件就可以了。虽然大家没帮上忙,但还是谢谢大家。另外有没有人参加软考“项管”的呀,今年刚刚考完,不知道能不能过,希望有考的大家一起交流交流,呵呵 QQ:贰零陆零捌壹捌壹 |
|
|
|
|
|
|
|
|
|
|
lwbo1987
发表于 2011-11-27 09:23:38
|
显示全部楼层
回复 2# 的帖子
感谢反馈,解决就好 |
|
|
|
|
|
|
|
|