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 in Others by Soham
• 8,730 points
3,261 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 by Aditya
• 7,280 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,360 points
1,732 views
0 votes
1 answer

ng is not recognized as an internal or external command

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

answered Feb 11 in Others by Rahul
• 8,980 points
2,569 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 in Others by Rahul
• 8,980 points
1,692 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
216 views
0 votes
0 answers
0 votes
0 answers
0 votes
1 answer
webinar REGISTER FOR FREE WEBINAR X
Send OTP
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP