Could not open input file composer.phar in Windows 7

16,656

Solution 1

Where did you install composer?

You have to add the directory, for example:

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

If you add the directory to your windows path you can simply call

composer require ...

Solution 2

Read here https://getcomposer.org/download/ it gives you instructions for how to get composer.

The easier way is to run

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

In that directory.

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

Solution 3

Type composer require mdmsoft/yii2-admin "~1.0" in your cmd

Solution 4

in windows execute

composer require mdmsoft/yii2-admin "~1.0"

regards!

Share:
16,656
Kalai S
Author by

Kalai S

Updated on June 08, 2022

Comments

  • Kalai S
    Kalai S almost 2 years

    I am trying to install an extension in Yii2, while I installing through command prompt using

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

    I am getting an error like this:

    could not open input file composer.phar