Github安装:Laravel & Lumen 一键安装包下载
地址:https://www.golaravel.com/download/
Git源码地址:https://github.com/laravel/laravel
composer安装:
laravel默认的命名安装,可能长时间没反应;因为他的镜像在国外所以需要切换镜像:
方法一: 修改 composer 的全局配置文件(推荐方式),然后输入安装命令
composer config -g repo.packagist composer https://packagist.phpcomposer.com // 配置命令
composer create-project laravel/laravel // 安装命令
方法二: 修改当前项目的 composer.json 配置文件:
进入你的项目的根目录(也就是 composer.json
文件所在目录),执行如下命令:
composer config repo.packagist composer https://packagist.phpcomposer.com
方式三:手动全局模式
新建composer文件夹,然后创建composer.json (推荐方式)
composer/composer.json代码(切换国内镜像)
{"config": {},"repositories": [{"type": "composer", "url": "https://packagist.phpcomposer.com"},{"packagist": false}]
}
命令窗口进入到cd: xxx/xx/composer 目录下,运行命令
composer create-project laravel/laravel larave laravel58
// 会在创建一个composer/laravel58文件夹,里面的是laravel文件
D:\Learning >composer create-project laravel/laravel l58
Installing laravel/laravel (v5.8.0)- Installing laravel/laravel (v5.8.0): Loading from cache
Created project in l58
> @php -r "file_exists('.env') || copy('.env.example', '.env');"
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 74 installs, 0 updates, 0 removals- Installing symfony/polyfill-ctype (v1.10.0): Loading from cache- Installing phpoption/phpoption (1.5.0): Downloading (100%)- Installing vlucas/phpdotenv (v3.3.2): Downloading (100%)- Installing symfony/css-selector (v4.2.3): Downloading (100%)- Installing tijsverkoyen/css-to-inline-styles (2.2.1): Loading from cache- Installing symfony/polyfill-php72 (v1.10.0): Loading from cache- Installing symfony/polyfill-mbstring (v1.10.0): Loading from cache
....
Discovered Package: [32mnunomaduro/collision[39m
[32mPackage manifest generated successfully.[39m
> @php artisan key:generate --ansi
[32mApplication key set successfully.[39mD:\Learning >
查看laravel版本
D:\phpStudy\PHPTutorial\WWW\composer\l58>php artisan -v
Laravel Framework 5.8.0
安装完毕