Could not open input file: composer.phar

前端 未结 15 695
感情败类
感情败类 2020-12-02 09:38

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

The following steps are done towards installation

  1. I downlo

相关标签:
15条回答
  • 2020-12-02 09:58

    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.

    0 讨论(0)
  • 2020-12-02 10:00

    I have fixed the same issue with below steps

    1. Open project directory Using Terminal (which you are using i.e. mintty )
    2. Now install composer within this directory as per given directions on https://getcomposer.org/download/

    php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"

    php -r "if (hash_file('SHA384', 'composer-setup.php') === 'the-provided-hash-code') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"

    php composer-setup.php php -r "unlink('composer-setup.php');"

    1. Now run your command.

    Everything is working fine now because the composer.phar file is available within the current project directory.

    Copied from https://stackoverflow.com/questions/21670709/running-composer-returns-could-not-open-input-file-composer-phar/51907013#51907013
    

    thanks

    0 讨论(0)
  • 2020-12-02 10:04

    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.

    0 讨论(0)
提交回复
热议问题