Rumah > pembangunan bahagian belakang > tutorial php > iis 7下安装laravel 5.4环境的教程详解

iis 7下安装laravel 5.4环境的教程详解

零下一度
Lepaskan: 2023-03-10 15:52:01
asal
1600 orang telah melayarinya

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

前言

本文主要给大家介绍了关于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>
Salin selepas log masuk

大家如果是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>
Salin selepas log masuk

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


iisreset /restart
Salin selepas log masuk

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


net start w3svc
Salin selepas log masuk

最终运行效果:


总结

Atas ialah kandungan terperinci iis 7下安装laravel 5.4环境的教程详解. Untuk maklumat lanjut, sila ikut artikel berkaitan lain di laman web China PHP!

Kenyataan Laman Web ini
Kandungan artikel ini disumbangkan secara sukarela oleh netizen, dan hak cipta adalah milik pengarang asal. Laman web ini tidak memikul tanggungjawab undang-undang yang sepadan. Jika anda menemui sebarang kandungan yang disyaki plagiarisme atau pelanggaran, sila hubungi admin@php.cn
Isu terkini
Tutorial Popular
Lagi>
Muat turun terkini
Lagi>
kesan web
Kod sumber laman web
Bahan laman web
Templat hujung hadapan