laravel 5.7 安装

环境满足要求:

  • PHP >= 7.1.3  (我现在是用7.2)
  • PHP OpenSSL 扩展
  • PHP PDO 扩展
  • PHP Mbstring 扩展
  • PHP Tokenizer 扩展
  • PHP XML 扩展
  • PHP Ctype 扩展
  • PHP JSON 扩展

安装

1使用composer 安装 如果没安装先安装 

检查是否安装成功 命令行输入 composer

1.切换到指定目录 新建 composer.json

2、编辑文件

{ "require": { "monolog/monolog": "1.0.*" } }

 

3、执行命令

composer install

  

4.、修改镜像地址

composer config -g repo.packagist composer https://mirrors.aliyun.com/composer/

  

 

2安装laravel

1最新版laravel(不推荐)

composer global require "laravel/installer"	laravel new yzm

2安装5.7版本

composer create-project laravel/laravel file --prefer-dist "5.7.*"

file 是文件目录  

3修改服务器

1添加vhosts.ini  (larval的网站根目录 在Public 下)

server {
        listen       80;
        server_name  www.file.com file.com;
        root   "D:/phpStudy/PHPTutorial/WWW/file/public";  #地址位置
        location / {
            index  index.html index.htm index.php;
            try_files $uri $uri/ /index.php?$query_string;  #这个是地址格式不报错
            #autoindex  on;
        }
        location ~ \.php(.*)$ {
            fastcgi_pass   127.0.0.1:9000;
            fastcgi_index  index.php;
            fastcgi_split_path_info  ^((?U).+\.php)(/?.+)$;
            fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
            fastcgi_param  PATH_INFO  $fastcgi_path_info;
            fastcgi_param  PATH_TRANSLATED  $document_root$fastcgi_path_info;
            include        fastcgi_params;
        }
}

  2修改hosts 

  添加

127.0.0.1	file.com
127.0.0.1	www.file.com

  

  3重启服务器

 

4 目录了解

 

app 应用的核心代码
bootstrap 框架自动加载文件
config 配置文件
database 数据库迁移
public 网站主入口和前端资源
resources 界面文件
routes 路由目录
storage 临时文件
test 自动化测试目录
vendor composer依赖包

.env

 

posted on 2020-01-03 21:21  海星一号  阅读(562)  评论(0)    收藏  举报