So I've been trying to install laravel for quite sometime now on my mac
I run :- export PATH="$PATH:$HOME/.composer/vendor/bin"
and everything works for that current terminal session. But if I close and open terminal again, it doesn't work.
I've tried adding path to :-
but it still doesn't work.
If I run echo $PATH
, the out put is "/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
Where is this coming from ? I don't see this anywhere in any files.
I believe ~/.profile
is the file you should use.
You can put your export your export command in the file, and then it will work after next login. And if you want to make it work right now, just run source ~/.profile
.
More details, please refer to http://hayne.net/MacDev/Notes/unixFAQ.html#shellStartup
The problem is that with the export is only for the session. You need to add it permanently by creating a .bash_profile
file. Do the following things in your terminal:
cd
(Go to your home directory)
nano .bash_profile
(Create a bash profile file with nano editor)
export PATH="$PATH:$HOME/.composer/vendor/bin"
(Add this line in your file and save it)
Save the file by hitting Ctrl+O.
When you use now echo $PATH
you'll see that your directory is added in this list and it will work now every time, without a new export every time.