-1

Yesterday I created a laravel project using the command php composer.phar create-project laravel/laravel TestProject which worked fine and the project was created.

Today I am trying to do the exact same but with a different project name and now I am getting an error in my console saying : Could not open input file: composer.phar

I have had a poke around on stackoverflow and seen a few answers with people saying to drop the php and .phar and just call the composer, but I still get the same error message just without the extension.

Unsure why it worked yesterday and not today, anyone know why? For reference I am on mac.

MaxCulley
  • 23
  • 5

1 Answers1

0

Fixed, Navigate to the directory you are creating the project in, in this case mine is htdocs then enter this command:

php -r "readfile('https://getcomposer.org/installer');" | php

This will install it in that location.

MaxCulley
  • 23
  • 5
  • 1
    Follow instructions fully for moving it into globally available location for executables. That way you will solve your problem for good. Otherwise you will download composer again and again. Read `Download` and `Getting Started` pages on getcomposer.org site. `Documentation` page won't hurt neither. – Tpojka Jul 28 '20 at 12:25