服务器之家:专注于VPS、云服务器配置技术及软件下载分享
分类导航

云服务器|WEB服务器|FTP服务器|邮件服务器|虚拟主机|服务器安全|DNS服务器|服务器知识|Nginx|IIS|Tomcat|

服务器之家 - 服务器技术 - IIS - iis 7下安装laravel 5.4环境的方法教程

iis 7下安装laravel 5.4环境的方法教程

2021-05-27 20:23范特西的麦田 IIS

最近想尝试体验下laravel框架,所以自己尝试在iis 7下安装laravel 5.4环境,虽然遇到些问题,但最终都解决了,所以下面这篇文章主要给大家介绍了在iis 7下安装laravel 5.4环境的方法教程,需要的朋友可以参考下。

前言

本文主要给大家介绍了关于iis 7下安装laravel 5.4环境的相关内容,分享出来供大家参考学习,下面来一起看看详细的介绍:

  • laravel版本: laravel5.4
  • iis版本:iis7

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

安装方法

直接上图:

iis 7下安装laravel 5.4环境的方法教程

由于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

最终运行效果:

iis 7下安装laravel 5.4环境的方法教程

总结

以上就是这篇文章的全部内容了,希望本文的内容对大家的学习或者工作能带来一定的帮助,如有疑问大家可以留言交流,谢谢大家对服务器之家的支持。

原文链接:http://www.cnblogs.com/phpper/p/6849305.html

延伸 · 阅读

精彩推荐