繁体   English   中英

如何为Zend配置IIS

[英]how to configure iis for Zend

我尝试将IIS 7配置为运行zend,而不必键入/public/index.php/。 如果尝试使用此URL http:// <> / dev / foundation / SampleZendApp /访问我的应用程序(这是我的应用程序所在的位置),则会出现以下错误

Message: Invalid controller specified (dev)
Stack trace:

#0 C:\inetpub\wwwroot\Dev\foundation\library\Zend\Controller\Front.php(954): Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http))
#1 C:\inetpub\wwwroot\Dev\foundation\library\Zend\Application\Bootstrap\Bootstrap.php(97): Zend_Controller_Front->dispatch()
#2 C:\inetpub\wwwroot\Dev\foundation\library\Zend\Application.php(366): Zend_Application_Bootstrap_Bootstrap->run()
#3 C:\inetpub\wwwroot\Dev\foundation\SampleZendApp\public\index.php(27): Zend_Application->run()
#4 {main}  

Request Parameters:

array (
  'controller' => 'dev',
  'action' => 'foundation',
  'module' => 'default',

它仅在我在其前面添加/public/index.php时才有效。 如何在IIS中进行更改,以使我不再需要键入/public/index.php?

如果有人可以帮助我,我将非常感激。

谢谢。

在iis上有点棘手。

打开“ Bash” :-)并执行:

%windir%\system32\inetsrv\appcmd.exe set config ^ -section:system.webServer/defaultDocument /+"files.[value='index.php']" ^ /commit:apphost

如果未安装,则必须为iis添加“重写”模块:

安装: http : //www.iis.net/download/urlrewrite

最后一步:将web.config添加到webroot(.htaccess的对应部分)

    <?xml version="1.0" encoding="UTF-8"?>
<configuration>
  <system.webServer>
    <rewrite>
      <rules>
        <rule name="ZF Rewrite" stopProcessing="true">
          <match url="^.*$" />
          <conditions logicalGrouping="MatchAny">
            <add input="{REQUEST_FILENAME}" matchType="IsFile" pattern="" ignoreCase="false" />
            <add input="{REQUEST_FILENAME}" matchType="IsDirectory" pattern="" ignoreCase="false" />
          </conditions>
          <action type="None" />
        </rule>
        <rule name="Imported Rule 2" stopProcessing="true">
          <match url="^.*$" />
          <action type="Rewrite" url="index.php" />
        </rule>
      </rules>
    </rewrite>
  </system.webServer>
</configuration>

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM