Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

siggib's avatar

Could not open input file: composer.phar

Brand new to laravel and I just got my laravel setup and it all seem to go just great. Composer is working like charm and so does laravel as far as I can tell, except when I try to create a new project I get this message "Could not open input file: composer.phar" that the laracast on installation didn't show. They showed a long list of dependencies being installed. Composer like I said seems to be working just fine. I followed the global installations and I verified that /usr/local/bin/composer is +rx across the board and that it is in the path. What am I missing.

0 likes
4 replies
jasonfrye's avatar

Well I think if you followed the instructions they have your move composer to the /usr/local/bin folder to make it accessible from anywhere on your system. This also changes how you call it to composer install rather than composer.phar install.

Can you share the composer line you're trying to run?

siggib's avatar

Yes I followed those instructions to the letter, and when I try to use composer directly it works from anywhere. I'm running a laravel command, not a composer command. Here is the command I am running on my ubuntu 14.04 LTS box "laravel new MyTest" here is an example.

siggib@George:~$ laravel new MyTest
Crafting application...
Could not open input file: composer.phar
Application ready! Build something amazing.
siggib@George:~$ 
siggib@George:~$ composer
   ______
  / ____/___  ____ ___  ____  ____  ________  _____
 / /   / __ \/ __ `__ \/ __ \/ __ \/ ___/ _ \/ ___/
/ /___/ /_/ / / / / / / /_/ / /_/ (__  )  __/ /
\____/\____/_/ /_/ /_/ .___/\____/____/\___/_/
                    /_/
Composer version 1.1.2 2016-05-31 19:48:11

Usage:
  command [options] [arguments]
... output truncated ...
siggib's avatar

I ended up deleting the composer file and reinstalling it, and this time it worked as expected, really odd.

annihilat1on's avatar

I'm facing the exact same issue. Is there another fix that doesn't involve reinstalling composer?

Please or to participate in this conversation.