'composer' is not recognized as an internal or external command in windows server












1















I am using windows server 2008 os. i download composer setup.exe and install to my PC . when I try install composer . I getting an error:




'composer' is not recognized as an internal or external command,




eg:-



c:xampphtdocsshop>composer install
'composer' is not recognized as an internal or external command,
operable program or batch file.


My environment variable PATH is shown below:



C:xamppphp;C:UsersAdministratorAppDataRoamingComposervendorbin









share|improve this question





























    1















    I am using windows server 2008 os. i download composer setup.exe and install to my PC . when I try install composer . I getting an error:




    'composer' is not recognized as an internal or external command,




    eg:-



    c:xampphtdocsshop>composer install
    'composer' is not recognized as an internal or external command,
    operable program or batch file.


    My environment variable PATH is shown below:



    C:xamppphp;C:UsersAdministratorAppDataRoamingComposervendorbin









    share|improve this question



























      1












      1








      1








      I am using windows server 2008 os. i download composer setup.exe and install to my PC . when I try install composer . I getting an error:




      'composer' is not recognized as an internal or external command,




      eg:-



      c:xampphtdocsshop>composer install
      'composer' is not recognized as an internal or external command,
      operable program or batch file.


      My environment variable PATH is shown below:



      C:xamppphp;C:UsersAdministratorAppDataRoamingComposervendorbin









      share|improve this question
















      I am using windows server 2008 os. i download composer setup.exe and install to my PC . when I try install composer . I getting an error:




      'composer' is not recognized as an internal or external command,




      eg:-



      c:xampphtdocsshop>composer install
      'composer' is not recognized as an internal or external command,
      operable program or batch file.


      My environment variable PATH is shown below:



      C:xamppphp;C:UsersAdministratorAppDataRoamingComposervendorbin






      php windows composer-php environment-variables






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Sep 27 '16 at 12:53







      danish dani

















      asked Sep 27 '16 at 12:23









      danish danidanish dani

      831212




      831212
























          5 Answers
          5






          active

          oldest

          votes


















          5














          For anyone coming here from Google who are facing the same issue. I just managed to solve this issue after all the other "solutions" other people suggested didn't work.



          I installed Composer properly and the Environment variable was set but it just wouldn't work.



          In my case composer is installed in C:ProgramDataComposerSetupbin and this is exactly what is in my PATH Environment variable. After messing around a bit trying to fix it I saw that under System variables under PATH there is something called PATHEXT I opened that and added ;.PHAR to the end of it. So it ended up like this:



          enter image description here



          And this is what my PATH is now:
          enter image description here



          I closed all file explorer windows and command prompts and started a new CMD and ran composer --version and it worked!



          I hope this helps someone facing the same issue as me.






          share|improve this answer
























          • this worked! Just curious, why do we need to add ;.PHAR to the PATHTEXT?

            – indago
            Aug 13 '18 at 19:06











          • @indago I can't be certain since I got this fixed by just randomly messing around but the reason I thought about adding .PHAR is that there is a Composer.phar inside the composer directory that I believe is what runs when you use composer commands , so when I saw that it's not there I added it and it immediately fixed the issue. Glad you got it sorted as well!

            – Mahan_F
            Aug 13 '18 at 19:33











          • for me just restarting cmd (as admin) was enough

            – Tadas V.
            Oct 31 '18 at 22:23





















          3














          I had the same problem, I kept repeating the composer installation until it was resolved this way:



          1) Download the composer installer (.exe) and put it on C:/XAMPP.



          2) Run the installer by just clicking next till the end.



          3) Open command-line (cmd) and cd to your project directory (C:/XAMPP/htdocs/myproject) and type composer and see if you have it installed.



          4) It should work now, let's say you want to install a PHP framework from your project directory: cmd=>composer require slim/slim "^3.0".






          share|improve this answer

































            1














            https://getcomposer.org/doc/00-intro.md#installation-windows



            Close your current terminal and open a new one.






            share|improve this answer


























            • You do not need to restart your computed, simply close your current terminal and open a new one.

              – user320487
              Jan 18 '18 at 23:20



















            0














            the solution is . user complete composer path instead of composer install



            eg:- C:ProgramDataComposerSetupbincomposer install" instead of "composer install






            share|improve this answer































              0














              If u can't find composer file than follow only 2 steps
              1- Download composer file from [https://getcomposer.org/download/]<click on Composer-Setup.exe>

              2- Install above file at your project root dir. and give second path is your php.exe file and finally solve this issue.





              share|improve this answer























                Your Answer






                StackExchange.ifUsing("editor", function () {
                StackExchange.using("externalEditor", function () {
                StackExchange.using("snippets", function () {
                StackExchange.snippets.init();
                });
                });
                }, "code-snippets");

                StackExchange.ready(function() {
                var channelOptions = {
                tags: "".split(" "),
                id: "1"
                };
                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: true,
                noModals: true,
                showLowRepImageUploadWarning: true,
                reputationToPostImages: 10,
                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%2fstackoverflow.com%2fquestions%2f39724594%2fcomposer-is-not-recognized-as-an-internal-or-external-command-in-windows-serve%23new-answer', 'question_page');
                }
                );

                Post as a guest















                Required, but never shown

























                5 Answers
                5






                active

                oldest

                votes








                5 Answers
                5






                active

                oldest

                votes









                active

                oldest

                votes






                active

                oldest

                votes









                5














                For anyone coming here from Google who are facing the same issue. I just managed to solve this issue after all the other "solutions" other people suggested didn't work.



                I installed Composer properly and the Environment variable was set but it just wouldn't work.



                In my case composer is installed in C:ProgramDataComposerSetupbin and this is exactly what is in my PATH Environment variable. After messing around a bit trying to fix it I saw that under System variables under PATH there is something called PATHEXT I opened that and added ;.PHAR to the end of it. So it ended up like this:



                enter image description here



                And this is what my PATH is now:
                enter image description here



                I closed all file explorer windows and command prompts and started a new CMD and ran composer --version and it worked!



                I hope this helps someone facing the same issue as me.






                share|improve this answer
























                • this worked! Just curious, why do we need to add ;.PHAR to the PATHTEXT?

                  – indago
                  Aug 13 '18 at 19:06











                • @indago I can't be certain since I got this fixed by just randomly messing around but the reason I thought about adding .PHAR is that there is a Composer.phar inside the composer directory that I believe is what runs when you use composer commands , so when I saw that it's not there I added it and it immediately fixed the issue. Glad you got it sorted as well!

                  – Mahan_F
                  Aug 13 '18 at 19:33











                • for me just restarting cmd (as admin) was enough

                  – Tadas V.
                  Oct 31 '18 at 22:23


















                5














                For anyone coming here from Google who are facing the same issue. I just managed to solve this issue after all the other "solutions" other people suggested didn't work.



                I installed Composer properly and the Environment variable was set but it just wouldn't work.



                In my case composer is installed in C:ProgramDataComposerSetupbin and this is exactly what is in my PATH Environment variable. After messing around a bit trying to fix it I saw that under System variables under PATH there is something called PATHEXT I opened that and added ;.PHAR to the end of it. So it ended up like this:



                enter image description here



                And this is what my PATH is now:
                enter image description here



                I closed all file explorer windows and command prompts and started a new CMD and ran composer --version and it worked!



                I hope this helps someone facing the same issue as me.






                share|improve this answer
























                • this worked! Just curious, why do we need to add ;.PHAR to the PATHTEXT?

                  – indago
                  Aug 13 '18 at 19:06











                • @indago I can't be certain since I got this fixed by just randomly messing around but the reason I thought about adding .PHAR is that there is a Composer.phar inside the composer directory that I believe is what runs when you use composer commands , so when I saw that it's not there I added it and it immediately fixed the issue. Glad you got it sorted as well!

                  – Mahan_F
                  Aug 13 '18 at 19:33











                • for me just restarting cmd (as admin) was enough

                  – Tadas V.
                  Oct 31 '18 at 22:23
















                5












                5








                5







                For anyone coming here from Google who are facing the same issue. I just managed to solve this issue after all the other "solutions" other people suggested didn't work.



                I installed Composer properly and the Environment variable was set but it just wouldn't work.



                In my case composer is installed in C:ProgramDataComposerSetupbin and this is exactly what is in my PATH Environment variable. After messing around a bit trying to fix it I saw that under System variables under PATH there is something called PATHEXT I opened that and added ;.PHAR to the end of it. So it ended up like this:



                enter image description here



                And this is what my PATH is now:
                enter image description here



                I closed all file explorer windows and command prompts and started a new CMD and ran composer --version and it worked!



                I hope this helps someone facing the same issue as me.






                share|improve this answer













                For anyone coming here from Google who are facing the same issue. I just managed to solve this issue after all the other "solutions" other people suggested didn't work.



                I installed Composer properly and the Environment variable was set but it just wouldn't work.



                In my case composer is installed in C:ProgramDataComposerSetupbin and this is exactly what is in my PATH Environment variable. After messing around a bit trying to fix it I saw that under System variables under PATH there is something called PATHEXT I opened that and added ;.PHAR to the end of it. So it ended up like this:



                enter image description here



                And this is what my PATH is now:
                enter image description here



                I closed all file explorer windows and command prompts and started a new CMD and ran composer --version and it worked!



                I hope this helps someone facing the same issue as me.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Aug 12 '18 at 18:32









                Mahan_FMahan_F

                516511




                516511













                • this worked! Just curious, why do we need to add ;.PHAR to the PATHTEXT?

                  – indago
                  Aug 13 '18 at 19:06











                • @indago I can't be certain since I got this fixed by just randomly messing around but the reason I thought about adding .PHAR is that there is a Composer.phar inside the composer directory that I believe is what runs when you use composer commands , so when I saw that it's not there I added it and it immediately fixed the issue. Glad you got it sorted as well!

                  – Mahan_F
                  Aug 13 '18 at 19:33











                • for me just restarting cmd (as admin) was enough

                  – Tadas V.
                  Oct 31 '18 at 22:23





















                • this worked! Just curious, why do we need to add ;.PHAR to the PATHTEXT?

                  – indago
                  Aug 13 '18 at 19:06











                • @indago I can't be certain since I got this fixed by just randomly messing around but the reason I thought about adding .PHAR is that there is a Composer.phar inside the composer directory that I believe is what runs when you use composer commands , so when I saw that it's not there I added it and it immediately fixed the issue. Glad you got it sorted as well!

                  – Mahan_F
                  Aug 13 '18 at 19:33











                • for me just restarting cmd (as admin) was enough

                  – Tadas V.
                  Oct 31 '18 at 22:23



















                this worked! Just curious, why do we need to add ;.PHAR to the PATHTEXT?

                – indago
                Aug 13 '18 at 19:06





                this worked! Just curious, why do we need to add ;.PHAR to the PATHTEXT?

                – indago
                Aug 13 '18 at 19:06













                @indago I can't be certain since I got this fixed by just randomly messing around but the reason I thought about adding .PHAR is that there is a Composer.phar inside the composer directory that I believe is what runs when you use composer commands , so when I saw that it's not there I added it and it immediately fixed the issue. Glad you got it sorted as well!

                – Mahan_F
                Aug 13 '18 at 19:33





                @indago I can't be certain since I got this fixed by just randomly messing around but the reason I thought about adding .PHAR is that there is a Composer.phar inside the composer directory that I believe is what runs when you use composer commands , so when I saw that it's not there I added it and it immediately fixed the issue. Glad you got it sorted as well!

                – Mahan_F
                Aug 13 '18 at 19:33













                for me just restarting cmd (as admin) was enough

                – Tadas V.
                Oct 31 '18 at 22:23







                for me just restarting cmd (as admin) was enough

                – Tadas V.
                Oct 31 '18 at 22:23















                3














                I had the same problem, I kept repeating the composer installation until it was resolved this way:



                1) Download the composer installer (.exe) and put it on C:/XAMPP.



                2) Run the installer by just clicking next till the end.



                3) Open command-line (cmd) and cd to your project directory (C:/XAMPP/htdocs/myproject) and type composer and see if you have it installed.



                4) It should work now, let's say you want to install a PHP framework from your project directory: cmd=>composer require slim/slim "^3.0".






                share|improve this answer






























                  3














                  I had the same problem, I kept repeating the composer installation until it was resolved this way:



                  1) Download the composer installer (.exe) and put it on C:/XAMPP.



                  2) Run the installer by just clicking next till the end.



                  3) Open command-line (cmd) and cd to your project directory (C:/XAMPP/htdocs/myproject) and type composer and see if you have it installed.



                  4) It should work now, let's say you want to install a PHP framework from your project directory: cmd=>composer require slim/slim "^3.0".






                  share|improve this answer




























                    3












                    3








                    3







                    I had the same problem, I kept repeating the composer installation until it was resolved this way:



                    1) Download the composer installer (.exe) and put it on C:/XAMPP.



                    2) Run the installer by just clicking next till the end.



                    3) Open command-line (cmd) and cd to your project directory (C:/XAMPP/htdocs/myproject) and type composer and see if you have it installed.



                    4) It should work now, let's say you want to install a PHP framework from your project directory: cmd=>composer require slim/slim "^3.0".






                    share|improve this answer















                    I had the same problem, I kept repeating the composer installation until it was resolved this way:



                    1) Download the composer installer (.exe) and put it on C:/XAMPP.



                    2) Run the installer by just clicking next till the end.



                    3) Open command-line (cmd) and cd to your project directory (C:/XAMPP/htdocs/myproject) and type composer and see if you have it installed.



                    4) It should work now, let's say you want to install a PHP framework from your project directory: cmd=>composer require slim/slim "^3.0".







                    share|improve this answer














                    share|improve this answer



                    share|improve this answer








                    edited May 24 '17 at 14:33









                    Satan Pandeya

                    2,43231633




                    2,43231633










                    answered May 24 '17 at 10:49









                    aminamin

                    313




                    313























                        1














                        https://getcomposer.org/doc/00-intro.md#installation-windows



                        Close your current terminal and open a new one.






                        share|improve this answer


























                        • You do not need to restart your computed, simply close your current terminal and open a new one.

                          – user320487
                          Jan 18 '18 at 23:20
















                        1














                        https://getcomposer.org/doc/00-intro.md#installation-windows



                        Close your current terminal and open a new one.






                        share|improve this answer


























                        • You do not need to restart your computed, simply close your current terminal and open a new one.

                          – user320487
                          Jan 18 '18 at 23:20














                        1












                        1








                        1







                        https://getcomposer.org/doc/00-intro.md#installation-windows



                        Close your current terminal and open a new one.






                        share|improve this answer















                        https://getcomposer.org/doc/00-intro.md#installation-windows



                        Close your current terminal and open a new one.







                        share|improve this answer














                        share|improve this answer



                        share|improve this answer








                        edited May 30 '18 at 7:18

























                        answered Jan 18 '18 at 18:46









                        FurquanFurquan

                        114




                        114













                        • You do not need to restart your computed, simply close your current terminal and open a new one.

                          – user320487
                          Jan 18 '18 at 23:20



















                        • You do not need to restart your computed, simply close your current terminal and open a new one.

                          – user320487
                          Jan 18 '18 at 23:20

















                        You do not need to restart your computed, simply close your current terminal and open a new one.

                        – user320487
                        Jan 18 '18 at 23:20





                        You do not need to restart your computed, simply close your current terminal and open a new one.

                        – user320487
                        Jan 18 '18 at 23:20











                        0














                        the solution is . user complete composer path instead of composer install



                        eg:- C:ProgramDataComposerSetupbincomposer install" instead of "composer install






                        share|improve this answer




























                          0














                          the solution is . user complete composer path instead of composer install



                          eg:- C:ProgramDataComposerSetupbincomposer install" instead of "composer install






                          share|improve this answer


























                            0












                            0








                            0







                            the solution is . user complete composer path instead of composer install



                            eg:- C:ProgramDataComposerSetupbincomposer install" instead of "composer install






                            share|improve this answer













                            the solution is . user complete composer path instead of composer install



                            eg:- C:ProgramDataComposerSetupbincomposer install" instead of "composer install







                            share|improve this answer












                            share|improve this answer



                            share|improve this answer










                            answered Nov 10 '16 at 7:41









                            danish danidanish dani

                            831212




                            831212























                                0














                                If u can't find composer file than follow only 2 steps
                                1- Download composer file from [https://getcomposer.org/download/]<click on Composer-Setup.exe>

                                2- Install above file at your project root dir. and give second path is your php.exe file and finally solve this issue.





                                share|improve this answer




























                                  0














                                  If u can't find composer file than follow only 2 steps
                                  1- Download composer file from [https://getcomposer.org/download/]<click on Composer-Setup.exe>

                                  2- Install above file at your project root dir. and give second path is your php.exe file and finally solve this issue.





                                  share|improve this answer


























                                    0












                                    0








                                    0







                                    If u can't find composer file than follow only 2 steps
                                    1- Download composer file from [https://getcomposer.org/download/]<click on Composer-Setup.exe>

                                    2- Install above file at your project root dir. and give second path is your php.exe file and finally solve this issue.





                                    share|improve this answer













                                    If u can't find composer file than follow only 2 steps
                                    1- Download composer file from [https://getcomposer.org/download/]<click on Composer-Setup.exe>

                                    2- Install above file at your project root dir. and give second path is your php.exe file and finally solve this issue.






                                    share|improve this answer












                                    share|improve this answer



                                    share|improve this answer










                                    answered Nov 11 '17 at 11:35









                                    Yagnesh bhalalaYagnesh bhalala

                                    400412




                                    400412






























                                        draft saved

                                        draft discarded




















































                                        Thanks for contributing an answer to Stack Overflow!


                                        • 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%2fstackoverflow.com%2fquestions%2f39724594%2fcomposer-is-not-recognized-as-an-internal-or-external-command-in-windows-serve%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

                                        404 Error Contact Form 7 ajax form submitting

                                        How to know if a Active Directory user can login interactively

                                        TypeError: fit_transform() missing 1 required positional argument: 'X'