PHP头条
热点:

iis 7如何安装laravel 5.4环境


  • laravel版本: Laravel5.4
  • IIS版本:IIS7

站点配置就不详细说啦,大家网上可以搜一坨很多的配置方法啦哈

安装方法

直接上图:

由于IIS没有像Apache.htaccess文件,创建一个Web.config文件在  D:\www\clw_app\public 下面

web.config配置如下:


1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

<configuration>

 <system.webServer>

 <rewrite>

  <rules>

  <rule name="Imported Rule 1" stopProcessing="true">

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

   <conditions>

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

   </conditions>

   <action type="Redirect" redirectType="Permanent" url="/{R:1}" />

  </rule>

  <rule name="Imported Rule 2" stopProcessing="true">

   <match url="^" ignoreCase="false" />

   <conditions>

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

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

   </conditions>

   <action type="Rewrite" url="index.php" />

  </rule>

  </rules>

 </rewrite>

 </system.webServer>

</configuration>

大家如果是apache环境,那么public目录下的.htaccess是:


1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

<IfModule mod_rewrite.c>

 <IfModule mod_negotiation.c>

  Options -MultiViews

 </IfModule>

 

 RewriteEngine On

 

 # Redirect Trailing Slashes If Not A Folder...

 RewriteCond %{REQUEST_FILENAME} !-d

 RewriteRule ^(.*)/$ /$1 [L,R=301]

 

 # Handle Front Controller...

 RewriteCond %{REQUEST_FILENAME} !-d

 RewriteCond %{REQUEST_FILENAME} !-f

 RewriteRule ^ index.php [L]

 

 # Handle Authorization Header

 RewriteCond %{HTTP:Authorization} .

 RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

</IfModule>

我这里是运行滴iis环境(暂且咱不说apache额)


1

iisreset /restart

在IIS中如果W3SVC服务没有运行,可以开始用下面的命令:


1

net start w3svc

最终运行效果:

www.phpzy.comtrue/php/27875.htmlTechArticleiis 7如何安装laravel 5.4环境 laravel版本: Laravel5.4 IIS版本:IIS7 站点配置就不详细说啦,大家网上可以搜一坨很多的配置方法啦哈 安装方法 直接上图: 由于IIS没有像Apache.htaccess文件,创建一...

相关文章

    暂无相关文章

PHP之友评论

今天推荐