Install Composer on macOS

Install Composer on macOS
Kungs Sam. 21 Décembre 2019 à 09:29

1. Prerequisites
Shell access to a running macOS
PHP 5.3 or higher version must be installed

2. Install Composer on macOS
Download composer binary file from getcomposer.org website by running the following command. It will create a composer.phar file in the current directory.

curl -sS https://getcomposer.org/installer | php


Now, copy this composer.phar file under bin directory to make available anywhere in the system. Also, set the execute permission on file. I have changed the filename from composer.phar to composer for the easy use.

mv composer.phar /usr/local/bin/composer
chmod +x /usr/local/bin/composer


Run composer command on the command prompt. This will provide you composer version details along with options available with composer command.

composer 

______
/ ____/___ ____ ___ ____ ____ ________ _____
/ / / __ \/ __ `__ \/ __ \/ __ \/ ___/ _ \/ ___/
/ /___/ /_/ / / / / / / /_/ / /_/ (__ ) __/ /
\____/\____/_/ /_/ /_/ .___/\____/____/\___/_/
/_/
Composer version 1.9.0 2019-08-02 20:55:32

Usage:
command [options] [arguments]

Options:
-h, --help Display this help message
-q, --quiet Do not output any message
-V, --version Display this application version
--ansi Force ANSI output
--no-ansi Disable ANSI output


3. Upgrade PHP Composer

The PHP composer provides a command-line option (self-update) to upgrade itself. You can simply run below command from the terminal to upgrade compose on your macOS.

sudo composer self-update

Suggestion de sujets
gandalf
gandalf@c36ddb3a a débuté asd333333333333333333333333333
Demo test
1.2K 4
test
test@3aeab72e a débuté Test titlw
General
1.5K 5
somewebdude
somewebdude@4f992797 a débuté This is a picture of a girl on the beach
Demo test
1.7K 3
Vous souhaitez en lire d’avantage ? Parcourer toutes nos catégories ou consulter les dernières discussions.