我对使用命令行非常新,感到沮丧。我目前正在尝试安装laravel以与我的PHP应用程序一起使用。我已经安装了作曲家,现在我正在尝试安装laravel。安装和运行Laravel
我也第一次尝试跟随在documentation的指示laravel中,我有:
- 安装作曲家
- 跑
composer global require "laravel/installer"
- 无法运行
laravel new blog
:-bash: laravel: command not found
接下来我试着遵循laracast video:
- 安装作曲家
- 跑
composer global require "laravel/installer"
- 打开的vim的〜/ .bashrc并添加
export PATH="$HOME/.composer/vendor/bin:$PATH"
- 无法运行
laravel new blog
:-bash: laravel: command not found
除了laravel仍然没有被availiable,当我回到bashrc文件,我得到以下通知:
Found a swap file by the name "~/.bashrc.swp"
owned by: Shawn dated: Wed Jun 21 16:01:37 2017
file name: ~Shawn/.bashrc
modified: YES
user name: Shawn host name: Shawns-MBP.domain
process ID: 39328
While opening file "/Users/Shawn/.bashrc"
dated: Wed Jun 21 16:19:11 2017
NEWER than swap file!
(1) Another program may be editing the same file. If this is the case,
be careful not to end up with two different instances of the same
file when making changes. Quit, or continue with caution.
(2) An edit session for this file crashed.
If this is the case, use ":recover" or "vim -r /Users/Shawn/.bashrc"
to recover the changes (see ":help recovery").
If you did this already, delete the swap file "/Users/Shawn/.bashrc.swp"
to avoid this message.
,我再次非常受这个过程混乱,根本不能完成我的周围了什么错误,为什么它适用于其他人的头,但我似乎无法得到laravel正确安装。
将作曲者路径添加到.bash_profile中,方法是将现有的作者追加到:不要忘记重新运行它,或者直接登录并重新登录 –
或者,您也可以通过在终端中发布Composer create-project命令来安装Laravel (https://laravel.com/docs/5.4/installation#installing-laravel): 作曲家创建项目--prefer-dist laravel/laravel博客 – manian