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

0 votes

I am using windows server 2008 os. I downloaded composer setup.exe and installed it on my PC but whenever I try composer install . I getting an error:

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

eg:-

c:\xampp\htdocs\shop>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:\xampp\php\;C:\Users\Administrator\AppData\Roaming\Composer\vendor\bin

Feb 17, 2022 in Others by Soham
• 9,700 points
18,195 views

1 answer to this question.

0 votes

For anyone coming here from Google who are facing the same issue. I installed Composer properly and the Environment variable was set but it just wouldn't work. In my case composer is installed in C:\ProgramData\ComposerSetup\bin 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 the screenshots mentioned below:

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 did work so I hope this helps someone facing the same issue as me.

answered Feb 17, 2022 by Aditya
• 7,680 points

Related Questions In Others

0 votes
1 answer

'git rev-parse HEAD' is not recognized as an internal or external command

Hi@akhtar, I also faced the same problem. You ...READ MORE

answered Jul 17, 2020 in Others by MD
• 95,440 points
3,502 views
+1 vote
1 answer

ng is not recognized as an internal or external command

I solved this problem in accordance with ...READ MORE

answered Feb 11, 2022 in Others by Rahul
• 9,670 points
14,870 views
0 votes
1 answer

ERROR:'keytool' is not recognized as an internal or external command, operable program or batch file

Check if the directory and the keytool ...READ MORE

answered Feb 18, 2022 in Others by Rahul
• 9,670 points
8,009 views
0 votes
0 answers

Self Created Laravel Link Not Working

I installed laravel 6.0 through composer and ...READ MORE

Dec 3, 2019 in Others by anonymous
• 120 points
566 views
0 votes
0 answers

How to install PHP composer inside a docker container

I'm trying to figure out how to ...READ MORE

Apr 12, 2022 in Docker by Abhijeet
• 180 points
6,361 views
0 votes
1 answer

'git' is not recognized as an internal or external command

Add the following paths to PATH: C:\Program Files\Git\bin\ C:\Program ...READ MORE

answered Apr 29, 2022 in Other DevOps Questions by narikkadan
• 63,420 points
4,854 views
0 votes
1 answer

'adb' is not recognized as an internal or external command, operable program or batch file

Set the path of adb into System ...READ MORE

answered Feb 16, 2022 in Others by Aditya
• 7,680 points
6,339 views
0 votes
1 answer
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP