Jump to content
Nathan

Setting Systemwide $PATH for Composer and Laravel

Recommended Posts

Composer-Setting-Systemwide-Path.png

In the Laravel installation documentation it says:

Quote

 

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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...