Reputation: 24061
I have composer installed, but checking the Laravel docs, I'm struggling with:
"Make sure to place the ~/.composer/vendor/bin directory in your PATH so the laravel executable is found when you run the laravel command in your terminal."
I'm not sure what to do here, could someone explain it to me?
Upvotes: 2
Views: 6713
Reputation: 81
Go to terminal and paste the next line:
nano ~/.bash_profile
After that paste the next line in nano:
export PATH="$PATH:$HOME/.composer/vendor/bin"
Done. Restart your terminal and enjoy laravel.
Upvotes: 8
Reputation: 121
The PATH
environment variable tells your system where to look when you run a command. By default ~/.composer/vendor/bin
will not be in your PATH
. Therefore, if you just attempt to run the command laravel
after installing it via composer, your terminal will give you an error saying the command is not found. But if you use the entire path to the command (~/.composer/vendor/bin/laravel
), it will execute successfully.
When you run the command composer global require "laravel/installer=~1.1"
, composer puts the laravel installer into the directory ~/.composer/vendor/bin
(in *nix, ~
represents your home directory). Adding ~/.composer/vendor/bin
to your PATH
allows you to just execute the command laravel
instead of having to use the full path of ~/.composer/vendor/bin/laravel
.
Helpful Stuff:
How to set/change your PATH environment variable in OSX
Installing composer packages globally
Upvotes: 7