Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

purdeve's avatar

Laravel installation: How to place the ~/.composer/vendor/bin directory in your PATH?

I'm now trying the first method in the quickstart documentation, that is, via Laravel Installer, but it says to "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." so my question is, how do I do that? This may be a simple question but I'm really frustrated and would appreciate any help.

0 likes
5 replies
Mo7sin's avatar

In your .bashrc Or .zshrc depends on your terminal

add this line

export PATH="$PATH:~/.composer/vendor/bin"

Then reload the source

source ~/.bashrc

That should do it.

2 likes
purdeve's avatar

It works only the current session of terminal when i close the terminal and reopen it doesn't work . again i should type this and it will work.

ienderli's avatar

Did you add the snippet to the bottom of the file ~/.bashrc and save it?

purdeve's avatar

it should work for daily,

I type this,

echo 'export PATH="$PATH:$HOME/.composer/vendor/bin"' >> ~/.bashrc

it works,but when i close the terminal and reopen ,again it doesn't work. so I should type this for login :

source ~/.bashrc

now it works.. i want that it should be forever when i type or to craete a project Like this: laravel new name

1 like

Please or to participate in this conversation.