Could Not Open Input File: Composer.Phar

Could not open input file: composer.phar

The composer.phar install is not working but without .phar this is working.

We need to enable the openssl module in php before installing the zendframe work.

We have to uncomment the line ;extension=php_openssl.dll from php.ini file.

composer use different php.ini file which is located at the wamp\bin\php\php-<version number>\php.ini

After enabling the openssl we need to restart the server.

The execute the following comments.

I can install successfully using these commands -

composer self-update
composer install --prefer-dist

Sample Image

Composer error Could not open input file: composer

If you got composer installed globally and composer update just works then get rid of php and instead of

php composer require intercom/intercom-php

just do

composer require intercom/intercom-php

The reason why former form does not work while the latter does is that you are invoking php executable and pass composer as its argument. It is then treated by php binary as script file path and as there's neither relative nor absolute path segments used, just file name, then file composer is expected to exist in current working directory which is no the case. In second invocation, your shell will look for composer binary in all known paths defined in $PATH env variable.

If you wonder where composer executable realy lives, you can use

which composer

Or on Windows

where composer 

Composer.phar. Could not open input file in Yii2

This error occurs basically due to the composer being installed in the wrong directory for that you have two options as

  1. Make the composer Global

    Change to a directory on your PATH and run the installer following the Download page instructions to download composer.phar.

    Create a new composer.bat file alongside composer.phar:

    Using cmd.exe:

    C:\bin> echo @php "%~dp0composer.phar" %*>composer.bat

    Add the directory to your PATH environment variable if it isn't already. For information on changing your PATH variable, please see this article and/or use your search engine of choice.
    And to check if it the process is successful or not you can use the command as

    C:\Users\username>composer -V
  2. Directly install the composer in your project root

    Simply hold down the Shift key and right-click on the desktop. In the context menu, you will see the option to Open command window here. Clicking on it will open a CMD window.

    And then simply run the following commands to install the composer for your project root.

    php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
    php -r "if (hash_file('sha384', 'composer-setup.php') === 'e0012edf3e80b6978849f5eff0d4b4e4c79ff1609dd1e613307e16318854d24ae64f26d17af3ef0bf7cfb710ca74755a') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
    php composer-setup.php

Composer Akeneo installation Could not open input file composer.phar

I moved the composer.phar file into the app directory. Now the install advanced. It's not a technical issue a misconfiguration or anything like that.

It's a lack of information about Composer on the Akeneo site but it's probably assumed that users should have knowledge about Composer allready.

Solution for me : moving the "composer.phar" file (from 'home' for me ) to the /var/www/project/ (.. the correct level directory).

So for my case it was a global / local install issue , which is still unclear, and I will have to look deeper how to properly install composer. Not sure if my current setup will not cause any issue later since it's like I installed it globally at first then moved only one file.

Also, command "composer" is not returning anything. I do have the composer file in /usr/bin/ though. This is very strange.

Intervention Image - Could not open input file: composer.phar

To install the most recent version, run the following command

composer require intervention/image

OR

Add to composer.json file:

"require": {
"intervention/image": "^2.5",
},

After, Run this command in the command prompt: composer update

More info: intervention/image



Related Topics



Leave a reply



Submit