前言
本文主要給大家介紹了關于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 |
最終運行效果:
總結
以上就是這篇文章的全部內容了,希望本文的內容對大家的學習或者工作能帶來一定的幫助,如有疑問大家可以留言交流,謝謝大家對服務器之家的支持。
原文鏈接:http://www.cnblogs.com/phpper/p/6849305.html