If you believe my posts will help someone please feel free to share.

Installing Composer globally on EC2

I got stuck the other day trying to update composer. There was a permissions conflict I couldn’t figure out so I decided to uninstall composer and reinstall it.

Here are the exact steps I took:

Inside of my home directory, I created an install directory, and entered it.

Then I made sure the file composer.phar was downloaded and that it worked.

Next I moved this composer.phar to a directory in my PATH and renamed it to composer.
This will allow me to use the command composer from the command line anywhere.*

I then like to go look at make sure it is where I think it is

And then just to be double sure,

*you can check which directories are in your path by

if you don’t see the path shown above then you have two choices.

You can either move (mv) the composer file to a path in your $PATH or you can add the directory, /usr/local/bin, to your PATH