'composer' is not recognized as an internal or external command in windows server
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:\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 this:
And this is what my PATH
is now:
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.
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"
.
https://getcomposer.org/doc/00-intro.md#installation-windows
Close your current terminal and open a new one.