composer global require laravel/installer
Changed current directory to /root/.composer
Do not run Composer as root/super user! See https://getcomposer.org/root for details
vim ~/.bashrc
export PATH="PATH"
wq
source ~/.bashrc
composer config -g repo.packagist composer https://packagist.laravel-china.org
composer config -gl
macOS: $HOME/.composer/vendor/bin
GNU / Linux Distributions: $HOME/.config/composer/vendor/bin
设置.bashrc之后
composer global require laravel/installer
Changed current directory to /root/.composer
Do not run Composer as root/super user! See https://getcomposer.org/root for details
虽说警告 不要用root,事实上 稍等一会 会继续执行的
安装laravel-install之后
laravel new blog
bash: laravel: command not found
之前虚拟机上
whereis laravel
/home/vagrant/.composer/vender/bin/laravel
docker里安装目录是 ~/.composer/vender/bin/laravel
需要vim ~/.bashrc
将composer 和 laravel环境变量都加上
export PATH="$HOME/.config/composer/vendor/bin:$PATH"
export PATH="$HOME/.composer/vendor/bin:$PATH"
需要将laravel放到环境变量