0

I am trying to install the yii2 and after I installed the composer I tried to run composer.phar global require "fxp/composer-asset-plugin:~1.1.1" it says :

Could not open input file: composer.phar

Any suggestions ?

GAMITG
  • 3,810
  • 7
  • 32
  • 51
Tom Wininger
  • 43
  • 1
  • 7
  • 3
    Possible duplicate of [Could not input open file: composer.phar](http://stackoverflow.com/questions/20769980/could-not-input-open-file-composer-phar) – alexander.polomodov Apr 08 '16 at 10:53
  • You can gave the full path of composer.phar in your command or even reinstall composer with `php -r "readfile('https://getcomposer.org/installer');" | php` and then run your original command – alexander.polomodov Apr 08 '16 at 10:56

3 Answers3

0

Make sure of composer work correctly.

php composer.phar -v

Try

php composer.phar global require "fxp/composer-asset-plugin:~1.1.1"
Xiaosong Guo
  • 485
  • 2
  • 7
0

I know probably you've figured it out by now but still I want to help. Make your composer.phar global so you can access it from anywhere. You can set path in environment variables or you can give direct path like below:

php C:\ProgramData\ComposerSetup\bin\composer.phar create-project --prefer-dist --stability=dev yiisoft/yii2-app-basic basic

Note: I'm using Windows 8.1 and composer is installed in C directory.

0

First of all install composer in your system Like windows system. you can download composer from this url https://getcomposer.org/download/. after install composer you can go to C:\composer check files for composer.phar and composer.bat files then copy both files and goto C:\xampp\php paste both files here and restart xampp then after that you can install yii2 enter image description here