注意:需要配置在项目路径的public目录下
apache环境配置
配置 httpd-conf: php5_module rewrite_module Listen
配置 extra/httpd-vhost: 端口 站点 域名 默认首页
系统 hosts: 将 域名 指向 本地
重启 apache:
修改文件权限: storage vendor
nginx环境配置
配置 nginx.conf: 端口 站点 域名 默认首页
FastCgi:
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
● 配置重写规则:
location / {
try_files $uri $uri/ /index.php?$query_string;
}
系统 hosts: 将 域名 指向 本地
重启服务器:
修改文件权限: storage vendor
IIS环境配置
新建站点, 配置 站点名称, 域名, 端口, 站点目录
Handler Mappings -> Add Module Mapping, 将 *.php 用 FastCgi 来解析.
配置重写规则: URL Rewrite, 引入 public 目录下 .htaccess, 导入即可
配置首页: Default Document, 添加 index.php
系统 hosts: 将 域名 指向 本地
修改文件权限: storage vendor