问题
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
回答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 ...
回答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.
回答3:
Type composer require mdmsoft/yii2-admin "~1.0"
in your cmd
回答4:
in windows execute
composer require mdmsoft/yii2-admin "~1.0"
regards!
来源:https://stackoverflow.com/questions/27813693/could-not-open-input-file-composer-phar-in-windows-7