No input file specified错误提示,windows2008 server R2+IIS7.5+PHP伪静态

windows2008R2 server +IIS7.5+PHP伪静态设置后出现No input file specified错误提示,通过以下设置问题解决,特记录一下:

1、修改 PHP.INI cgi.fix_pathinfo=0

2、打开web.config

<action type="Rewrite" url="index.php/{R:1}" />

改成

<action type="Rewrite" url="index.php?s={R:1}" />

注意上面这一行的 ?s= ,我主要改了这个,第三点没有改也成功了

3、在配置文件里加上 'URL_MODEL'=>2



另外有一点注意一下,我服务器上有好几个版本PHP在运行,所以伪静态配置文件里增加了<handlers>,不然会出现500错误,如下:

<?xml version="1.0" encoding="UTF-8"?>

<configuration>

  <system.webServer>

    <handlers>

            <remove name="php-5.2.17" />

            <remove name="php-nts-5.3.9" />

            <remove name="php-nts-5.4.9" />

            <remove name="php-nts-5.5.9" />

            <remove name="php-nts-5.6.9" />

            <remove name="php-nts-7.1.5" />

            <add name="php-nts-5.3.9" path="*.php" verb="*" modules="FastCgiModule" scriptProcessor="X:\PHPWAMP_IN3\phpwamp\server\php-nts-5.3.9\php-cgi.exe"

resourceType="Unspecified" requireAccess="Script" />

    </handlers>

    <rewrite>

      <rules>

        <rule name="OrgPage" stopProcessing="true">

          <match url="^(.*)$" />

          <conditions logicalGrouping="MatchAll">

            <add input="{HTTP_HOST}" pattern="^(.*)$" />

            <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />

            <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />

          </conditions>

          <action type="Rewrite" url="index.php?s={R:1}" />

        </rule>

      </rules>

    </rewrite>

  </system.webServer>

</configuration>

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。