• Register
0 votes
1.5k views

Problem :

Currently I am using the windows server 2008 os. I download the composer setup.exe and install it to my PC . But when I try to install composer. I face below error:

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

eg:-

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

operable program or batch file.

7 5 2
3,870 points

1 Answer

0 votes

Solution :

I had the same error in recent past, I just kept repeating my composer installation until it was resolved by this way:

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

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

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

4) It must work now, let us say you want to install the PHP framework from the project directory as follows: cmd=>composer require slim/slim "^3.0".

OR

The solution is very simple you just need to use complete composer path instead of the composer install eg:- C:\ProgramData\ComposerSetup\bin\composer install" instead of "composer install

Just add "C:\ProgramData\ComposerSetup\bin\" to the environment variables, so that now you can use as "composer install".

9 7 4
38,600 points

Related questions

0 votes
1 answer 65 views
65 views
Problem : I am facing following MinGW issue: 'gcc' is not recognized as an internal or external command, operable program or batch file.
asked Nov 18, 2019 peterlaw 6.9k points
0 votes
1 answer 49 views
49 views
Problem : Facing following Node.Js error 'npm' is not recognized as an internal or external command, operable program or batch file.
asked Nov 18, 2019 peterlaw 6.9k points
0 votes
2 answers 104 views
104 views
Problem : I have installed Git for Windows but when I try to use git command in Command Prompt I get the following message: 'git' is not recognized as an internal or external command, operable program or batch file.
asked Nov 18, 2019 peterlaw 6.9k points
0 votes
1 answer 171 views
171 views
Problem : I have Windows 7 and tried to use the 'make' command but getting following error 'make' is not recognized as an internal or external command, operable program or batch file.
asked Nov 15, 2019 peterlaw 6.9k points
0 votes
1 answer 9 views
9 views
I installed WAMP on my computer. After the installation, I created my first php file. I wanted to test it by using the command prompt. php test.php But I got this error instead. 'php' is not recognized as an internal or external command, operable program ... don’t know what’s wrong because I followed the tutorial on how to install WAMP. Any help and guide will be greatly appreciated.
asked Oct 11 azriel 530 points