一、 安装Composer
curl -sS https://getcomposer.org/installer | php
改为全局可用
mv composer.phar /usr/local/bin/composer
二、切换国内镜像
composer config -g repos.packagist composer https://php.cnpkg.org composer config -g repo.packagist composer https://mirrors.aliyun.com/composer/ //composer设置成阿里云镜像
composer config -g --unset repos.packagist //取消设置
三、安装 Laravel
composer global require laravel/installer
四、创建 Laravel 项目
通过Composer创建一个Laravel项目
composer create-project --prefer-dist laravel/laravel myproject
若想指定版本,则改为
composer create-project --prefer-dist laravel/laravel=5.5.* myproject