windows下laravel 快速安装

1. 安装composer  https://getcomposer.org/

2. 安装git windows 客户端工具 https://git-scm.com/downloads

3. 更改composer源地址

  composer config -g repo.packagist composer https://packagist.phpcomposer.php

4. 下载所需的laravel版本   https://github.com/laravel/laravel/releases

5. 解压下载的laravel到合适位置:/path/to/laravel

6. cd /path/to/laravel

  Linux下要设置写权限:

  chmod a+w storage -rf
  chmod a+w bootstrap/cache -rf

7. composer update

8. cp .env.example .env

9. php artisan key:generate

10. 创建mysql数据库,并修改.env 文件相应配置

以下可选:

11.php artisan make:auth

12. php artisan migrate

如果报错:Specified key was too long error

尝试修改:

  $table->string('email')->index();

  $table->string('email')->unique();

改为:

  $table->string('email', 100)->index();

  $table->string('email', 100)->unique();

 删除已经创建的表,再执行php artisan migrate.

原文地址:https://www.cnblogs.com/uniqid/p/8921408.html