Could not open input file composer.phar in Windows 7

江枫思渺然 提交于 2020-01-01 16:39:09

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!