Could not open input file: composer.phar

2019-01-13 02:35发布

I am trying to install zendframework using composer tool in wamp server.

The following steps are done towards installation

  1. I downloaded the Composer-Setup.exe file from composer page and got successfully installed.

  2. I downloaded the zendframework and extracted inside the c:\wamp\www\zend folder

  3. I executed the command for self update

    php composer.phar self-update

This line generates the error message: could not open file composer.phar

how to resolve this error

If I try the

composer.phar self-update

enter image description here

10条回答
劫难
2楼-- · 2019-01-13 03:09

First try this: dont use the php composer.phar [parameters] simply use composer [parameters] if this doesn't work for you than try the rest. Hope it helps.

查看更多
贪生不怕死
3楼-- · 2019-01-13 03:15

I was trying to install YII 2.0

php composer.phar create-project yiisoft/yii2-app-advanced advanced 2.0.0-alpha

I got the same error:

Could not open input file: composer.phar

Then i gave the full path of .phar like this:

php C:\ProgramData\Composer\bin\composer.phar create-project yiisoft/yii2-app-advanced advanced 2.0.0-alpha

and it worked.

查看更多
Lonely孤独者°
4楼-- · 2019-01-13 03:15

dont use php composer.phar self-update
First go to Your project directory
simply use composer.phar self-update
This works for me

查看更多
老娘就宠你
5楼-- · 2019-01-13 03:18

Question already answered by the OP, but I am posting this answer for anyone having similar problem, retting to

Could not input open file: composer.phar

error message.

Simply go to your project directory/folder and do a

composer update

Assuming this is where you have your web application:

/Library/WebServer/Documents/zendframework

change directory to it, and then run composer update.

查看更多
登录 后发表回答