简体   繁体   English

如何在IIS中部署PHP应用程序

[英]How to Deploy Php Application In IIS

I want to do some thing like below 我想做下面的事情

在此处输入图片说明

In below folder structure application folder contain source of my application which is in PHP and that PHP code use some file from system folder.application folder reside out side of wwwroot. 在下面的文件夹结构中,应用程序文件夹包含我应用程序的源代码,该应用程序位于PHP中,并且PHP代码使用系统文件夹中的某些文件。应用程序文件夹位于wwwroot的外侧。

在此处输入图片说明

and my wwwroot contain below file.in this folder I Have one Web.config which contain url writing as below: 和我的wwwroot包含下面的文件。在此文件夹中,我有一个Web.config,其中包含如下所示的url编写:

 configuration>
  <system.webServer>
    <rewrite>
        <rules>
          <rule name="Imported Rule Test" stopProcessing="true">
            <match url="^(.*)$" ignoreCase="false" />
            <conditions>
              <add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" />
              <add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" />
              <add input="{URL}" pattern="^system.*" ignoreCase="false" />
            </conditions>
            <action type="Rewrite" url="/index.php?/{R:1}" appendQueryString="false" />
          </rule>
          <rule name="Imported Rule 2" stopProcessing="true">
            <match url="^(.*)$" ignoreCase="false" />
            <conditions>
              <add input="{URL}" pattern="^application.*" ignoreCase="false" />
            </conditions>
            <action type="Rewrite" url="/index.php?/{R:1}" appendQueryString="false" />
          </rule>
          <rule name="Imported Rule 3" stopProcessing="true">
            <match url="^(.*)$" ignoreCase="false" />
            <conditions>
              <add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" />
              <add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" />
            </conditions>
            <action type="Rewrite" url="index.php?/{R:1}" appendQueryString="false" />
          </rule>
        </rules>
      </rewrite>
  </system.webServer>
</configuration>

My question is how I deploy this PHP site in IIS 7 ? 我的问题是如何在IIS 7中部署此PHP网站?

A virtual directory is a directory name, used in an address, which corresponds to a physical directory on the server. 虚拟目录是在地址中使用的目录名称,它对应于服务器上的物理目录。 You can add a virtual directory that will include directory content in a site or an application without having to move the content physically into that site or application directory. 您可以添加一个虚拟目录,该目录将在站点或应用程序中包含目录内容,而不必将内容实际移动到该站点或应用程序目录中。

创建iis7站点应用程序和虚拟目录

another guide 另一个指南

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

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