Could not open input composer.phar file on Windows 7

I am trying to install an extension in Yii2, while I am installing on the command line with

C:\wamp\www\project>php composer.phar require mdmsoft/yii2-admin "~1.0"

      

I am getting the error:

could not open input file composer.phar

+3


source to share


4 answers


Where did you install the composer?

You need to add a directory, for example:

php C:\ProgramData\ComposerSetup\bin\composer.phar require ...

      



If you add a directory to your window path, you can simply call

composer require ...

      

+10


source


Read here https://getcomposer.org/download/ for instructions on how to get the composer.

An easier way is to run

php -r "readfile('https://getcomposer.org/installer');" | php

      



In this directory.

Or you can follow these instructions https://getcomposer.org/doc/00-intro.md#installation-windows so you can reuse it for other projects.

+5


source


Enter composer require mdmsoft/yii2-admin "~1.0"

in your cmd

+2


source


in windows execute

composer require mdmsoft/yii2-admin "~1.0"

      

Hello!

+1


source







All Articles