Jump to content

Setting Systemwide $PATH for Composer and Laravel

Recommended Posts


In the Laravel installation documentation it says:



Make sure to place composer’s system-wide vendor bin directory in your $PATH so the laravel executable can be located by your system. This directory exists in different locations based on your operating system; however, some common locations include:

macOS: $HOME/.composer/vendor/bin

GNU / Linux Distributions: $HOME/.config/composer/vendor/bin


But it really doesn’t mention how to do this and assumes you’re already a system administrator on Linux :)

When logged in a root via SSH you can run the following command to set the path above.  Keep in mind we’re running on CentOS 7 64-bit so if you are on another flavor of Linux you’re $PATH could be different.

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

The composer and laravel command will now work globally in different directories and when switching other users.

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now