前言
本文主要给大家介绍了关于iis 7下安装laravel 5.4环境的相关内容,分享出来供大家参考学习,下面来一起看看详细的介绍:
laravel版本: laravel5.4
iis版本:iis7
站点配置就不详细说啦,大家网上可以搜一坨很多的配置方法啦哈
安装方法
直接上图:
由于iis没有像apache.htaccess文件,创建一个web.config文件在 d:\www\clw_app\public 下面
web.config配置如下:
<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是:
<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额)
iisreset /restart
在iis中如果w3svc服务没有运行,可以开始用下面的命令:
net start w3svc
最终运行效果:
总结
以上就是iis 7下安装laravel 5.4环境的教程详解的详细内容。
