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

Vasheer's avatar

Trouble installing Composer! Believe it or not

Hi All,

I have just switched to a MacBook Pro from windows and the first thing i want to do is get Laravel running :-) so i tried to get composer going.

I installed the composer.phar file and ran it using "php composer.phar" and everything went as expected. So now i want to move the file to a globally accessible area and i am following Jeff's: Laravel 5 fundamentals e01. I tried the mv command as in Jeff's video and i get the following returned:

"mv: rename composer.phar to /usr/local/bin/composer: Not a directory"

i have no clue what is going on because I don't know mac at all yet. Please could someone give me some advice on how to get composer running with a simple "composer" terminal command.

Thank you in advance.

Regards, Vash.

0 likes
8 replies
jekinney's avatar

If I remember you have to sudo before moving. Also the el captain update changed file permissions.

I just followed the instructions on the composer website and had no issues.

Vasheer's avatar

Hey guys I have tried the instructions from the composer site already and this is what i get back in the terminal. And I copied and pasted the code from the composer site, then i tried it with sudo and my password:

Vasheers-MacBook-Pro:~ Vash$ curl -sS https://getcomposer.org/installer | php #!/usr/bin/env php All settings correct for using Composer Downloading...

Composer successfully installed to: /Users/Vash/composer.phar Use it: php composer.phar

Vasheers-MacBook-Pro:~ Vash$ mv composer.phar /usr/local/bin/composer mv: rename composer.phar to /usr/local/bin/composer: Not a directory Vasheers-MacBook-Pro:~ Vash$

so clearly this is something that is not right on my computer, its brand new :-( what can i check? Im brand new to apple so any guidance will be highly appreciated.

Vasheer's avatar

Hey guys,

A bit more information... i am on El Capitan. I just tried installing composer on a macbook running Yosemite and all is well. I have seen some info about apple's new System Integrity Protector (SIP) which denies any access to some root files. I found a way to disable it so i want to try to switch it off then move composer to the /usr/local/bin and then re-enable it. Will keep you posted.

What about creating another folder somewhere and adding that to the PATH? Is this something that would work or is it not the greatest solution?

Vasheer's avatar

ok so its now working. Hopefully this can help someone else who runs into this problem, so here is what i did to fix it:

  1. Reboot in recovery mode: restart you mac and hold down cmd+R.
  2. Open the terminal once recovery mode has started via Utilities->Terminal via the bar at the top.
  3. Type in csrutil disable and hit enter. You should see a msg returned saying that the System Integrity Protection is off.
  4. Restart the computer as normal and then go set up composer. I had to put it in /usr/bin and NOT /usr/local/bin because for some reason it just didn't work there.
  5. Go back to recovery mode and enable System Integrity Protector by typing csrutil enable
  6. Come back in normal boot up and check that composer works. It did for me.

Goodluck.

jekinney's avatar

Lol, I mentioned that el captain changed file permissions. You can right click properties to change them or via terminal too.

Please or to participate in this conversation.