How to install Composer on macOS?
27,250
OLD Answer (The Ruby Homebrew installer is now deprecated and has been rewritten in Bash.):
First install Brew on your MAC:
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
NEW Answer:
First install Brew on your MAC:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
Then install PHP:
brew update
brew install php
brew install composer
To test installation, run:
$ composer -V
Author by
Admin
Updated on February 02, 2022Comments
-
Admin over 2 years
I was trying to install the Composer on my macOS version:
high sierra--> 10.13.4
but after using the command:
sudo php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
It created some files and directory but it didn't download the composer. My terminal displayed following error:
No log handling enabled - using stderr logging
Created directory: /var/db/net-snmp
Created directory: /var/db/net-snmp/mib_indexes`
How can I resolve this problem?
-
Abed Putra over 5 yearsshow error: 1. Error: homebrew/dupes was deprecated. This tap is now empty as all its formulae were migrated. 2. Error: homebrew/php was deprecated. This tap is now empty as all its formulae were migrated.
-
Yorick about 5 yearshomebrew/dupes is now part of core - stackoverflow.com/questions/45124717/… same with homebrew/php github.com/weprovide/valet-plus/issues/127
-
Mir Stephen about 3 yearsI tried
composer update --ignore-platform-reqs
on top of those command and it worked -
Tim Rogers about 2 yearsStep 3 should be
composer -V
with a capital V.