前言
本文主要給大家介紹了關(guān)于iis 7下安裝laravel 5.4環(huán)境的相關(guān)內(nèi)容,分享出來(lái)供大家參考學(xué)習(xí),下面來(lái)一起看看詳細(xì)的介紹:
- laravel版本: laravel5.4
- iis版本:iis7
站點(diǎn)配置就不詳細(xì)說(shuō)啦,大家網(wǎng)上可以搜一坨很多的配置方法啦哈
安裝方法
直接上圖:
由于iis沒(méi)有像apache.htaccess文件,創(chuàng)建一個(gè)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環(huán)境,那么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> |
我這里是運(yùn)行滴iis環(huán)境(暫且咱不說(shuō)apache額)
1
|
iisreset /restart |
在iis中如果w3svc服務(wù)沒(méi)有運(yùn)行,可以開(kāi)始用下面的命令:
1
|
net start w3svc |
最終運(yùn)行效果:
總結(jié)
以上就是這篇文章的全部?jī)?nèi)容了,希望本文的內(nèi)容對(duì)大家的學(xué)習(xí)或者工作能帶來(lái)一定的幫助,如有疑問(wèn)大家可以留言交流,謝謝大家對(duì)服務(wù)器之家的支持。
原文鏈接:http://www.cnblogs.com/phpper/p/6849305.html