1.一开始就报错,差点怀疑人生,其实大部分是网络问题.有一些源被国内屏蔽了
Could not find package laravel/laravel with version
还是阿里后台硬,换成阿里的就好了
composer config -g repo.packagist composer https://mirrors.aliyun.com/composer/
2.laravel: command not found 肯定是laravel命令没在系统里面,按照网上的教程添加
nano ~/.bashrc
alias laravel='~/.composer/vendor/bin/laravel'
ctrl+x 退出,Y保存,
source ~/.bashrc
3.-bash: /root/.composer/vendor/bin/laravel: No such file or directory 路径不对,那么我们就去找正确的路径好
a.显示composer bin路径
composer global config bin-dir --absolute
系统提示:/root/.config/composer/vendor/bin
替换成
alias laravel='/root/.config/composer/vendor/bin/laravel' 继续上面的操作就好了
laravel new blog
5.添加网站,没想到我也开始用宝塔了,以前都是自己在nginx里面配置真香,
www.la5.net