How to add composer to the path (for Laravel)

Once you have installed composer add the composer bin folder to your path to execute commands such as laravel new project and valet park

The command append it to your existing path on a Linux Mint / Ubuntu or equivalent system is:

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

Note:
Do not sudo composer require. If you do that Composer will be install at ~./composer instead of the correct location of ~/.config

References:

Share this article

Share on facebook
Share on twitter
Share on linkedin

Leave a Reply

Your email address will not be published. Required fields are marked *

Scroll to Top