我對使用命令行非常新,感到沮喪。我目前正在嘗試安裝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