Set environment variable $PATH globally on Ubuntu 14.04












2















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?










share|improve this question





























    2















    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?










    share|improve this question



























      2












      2








      2


      2






      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?










      share|improve this question
















      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?







      ubuntu environment-variables path






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Oct 18 '15 at 21:01









      Thomas Dickey

      52.3k594165




      52.3k594165










      asked Jul 16 '15 at 12:05









      DpENDpEN

      113114




      113114






















          2 Answers
          2






          active

          oldest

          votes


















          3














          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).






          share|improve this answer
























          • /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.

            – Gilles
            Jul 16 '15 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
            Jul 25 '16 at 13:58











          • @Frank The easiest way is to log out and back in.

            – Gilles
            Jul 25 '16 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
            Jul 25 '16 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.

            – Gilles
            Jul 25 '16 at 16:41



















          0














          @Gilles, Hi Gilles, I have installed Magento 2 and it is well accessible on browser but I couldn't be able to run commands on CLI. Please help. Should I have to set environment variables and if it is, then what should I set? Pls help.






          share|improve this answer








          New contributor




          Wasim Akram is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
          Check out our Code of Conduct.




















            Your Answer








            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "106"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: false,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: null,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














            draft saved

            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f216444%2fset-environment-variable-path-globally-on-ubuntu-14-04%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            2 Answers
            2






            active

            oldest

            votes








            2 Answers
            2






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            3














            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).






            share|improve this answer
























            • /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.

              – Gilles
              Jul 16 '15 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
              Jul 25 '16 at 13:58











            • @Frank The easiest way is to log out and back in.

              – Gilles
              Jul 25 '16 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
              Jul 25 '16 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.

              – Gilles
              Jul 25 '16 at 16:41
















            3














            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).






            share|improve this answer
























            • /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.

              – Gilles
              Jul 16 '15 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
              Jul 25 '16 at 13:58











            • @Frank The easiest way is to log out and back in.

              – Gilles
              Jul 25 '16 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
              Jul 25 '16 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.

              – Gilles
              Jul 25 '16 at 16:41














            3












            3








            3







            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).






            share|improve this answer













            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).







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Jul 16 '15 at 12:18









            FiximanFiximan

            3,158625




            3,158625













            • /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.

              – Gilles
              Jul 16 '15 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
              Jul 25 '16 at 13:58











            • @Frank The easiest way is to log out and back in.

              – Gilles
              Jul 25 '16 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
              Jul 25 '16 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.

              – Gilles
              Jul 25 '16 at 16:41



















            • /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.

              – Gilles
              Jul 16 '15 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
              Jul 25 '16 at 13:58











            • @Frank The easiest way is to log out and back in.

              – Gilles
              Jul 25 '16 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
              Jul 25 '16 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.

              – Gilles
              Jul 25 '16 at 16:41

















            /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.

            – Gilles
            Jul 16 '15 at 22:19





            /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.

            – Gilles
            Jul 16 '15 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
            Jul 25 '16 at 13:58





            @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
            Jul 25 '16 at 13:58













            @Frank The easiest way is to log out and back in.

            – Gilles
            Jul 25 '16 at 14:08





            @Frank The easiest way is to log out and back in.

            – Gilles
            Jul 25 '16 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
            Jul 25 '16 at 14:42





            @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
            Jul 25 '16 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.

            – Gilles
            Jul 25 '16 at 16:41





            @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.

            – Gilles
            Jul 25 '16 at 16:41













            0














            @Gilles, Hi Gilles, I have installed Magento 2 and it is well accessible on browser but I couldn't be able to run commands on CLI. Please help. Should I have to set environment variables and if it is, then what should I set? Pls help.






            share|improve this answer








            New contributor




            Wasim Akram is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
            Check out our Code of Conduct.

























              0














              @Gilles, Hi Gilles, I have installed Magento 2 and it is well accessible on browser but I couldn't be able to run commands on CLI. Please help. Should I have to set environment variables and if it is, then what should I set? Pls help.






              share|improve this answer








              New contributor




              Wasim Akram is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
              Check out our Code of Conduct.























                0












                0








                0







                @Gilles, Hi Gilles, I have installed Magento 2 and it is well accessible on browser but I couldn't be able to run commands on CLI. Please help. Should I have to set environment variables and if it is, then what should I set? Pls help.






                share|improve this answer








                New contributor




                Wasim Akram is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                Check out our Code of Conduct.










                @Gilles, Hi Gilles, I have installed Magento 2 and it is well accessible on browser but I couldn't be able to run commands on CLI. Please help. Should I have to set environment variables and if it is, then what should I set? Pls help.







                share|improve this answer








                New contributor




                Wasim Akram is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                Check out our Code of Conduct.









                share|improve this answer



                share|improve this answer






                New contributor




                Wasim Akram is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                Check out our Code of Conduct.









                answered 26 mins ago









                Wasim AkramWasim Akram

                1




                1




                New contributor




                Wasim Akram is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                Check out our Code of Conduct.





                New contributor





                Wasim Akram is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                Check out our Code of Conduct.






                Wasim Akram is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                Check out our Code of Conduct.






























                    draft saved

                    draft discarded




















































                    Thanks for contributing an answer to Unix & Linux Stack Exchange!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f216444%2fset-environment-variable-path-globally-on-ubuntu-14-04%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    Accessing regular linux commands in Huawei's Dopra Linux

                    Can't connect RFCOMM socket: Host is down

                    Kernel panic - not syncing: Fatal Exception in Interrupt