I am trying to add environment path variable of composer globally. I've tried many ways but it does not seem to work. I searched other posts, but did not find matching answers.

I am trying to configure laravel 5+ but I need to add the composer path globally in order to access "laravel" syntax using a terminal.

A temporary path set using Terminal works, but permanent path set does not. How do I do this?

1 Answer 1


You can change the settings in /etc/environment which contains a definiton of the $PATH variable, or add an entry to the system-wide bashrc ( /etc/bash.bashrc which is not as universal as changing the environment setting (i.e. only for bash and if the system-wide bashrc is actually loaded).

  • /etc/environment, yes. /etc/bash.bashrc, no that would only set the variable in interactive shells, not elsewhere (applications started from a menu, cron jobs, etc.). Never set environment variables in .bashrc, only interactive shell settings. Commented Jul 16, 2015 at 22:19
  • @Gilles, Do I have to reboot the Ubuntu 16.04 desktop computer after adding an environment variable key-value combination to /etc/environment? Thank you very much.
    – Frank
    Commented Jul 25, 2016 at 13:58
  • @Frank The easiest way is to log out and back in. Commented Jul 25, 2016 at 14:08
  • @Gilles. Thank you for your great answer to my question. Could I also export MONO_WINFORMS_XIM_STYLE=disabled using /etc/environment so that any programs which run from either the terminal monodevlelop,doubleclick take this environment variable ?
    – Frank
    Commented Jul 25, 2016 at 14:42
  • @Frank Sure, you can put any environment variable there. Remember that the syntax is just MONO_WINFORMS_XIM_STYLE=disabled, no export, this isn't a shell script. Commented Jul 25, 2016 at 16:41

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .