cd ~
curl -sS https://getcomposer.org/installer | php
上面命令会安装composer
composer
全局使用:
sudo mv composer.phar /usr/local/bin/composer
使用中国镜像
composer config -g repo.packagist composer https://packagist.phpcomposer.com
然后在/var/www(网站根目录)目录下直接执行
sudo composer create-project laravel/laravel laravel