Home » How to Install Composer on Mac

How to Install Composer on Mac

by Online Tutorials Library

How to install Composer on MacOS

Introduction

Composer is an application level package manager for the PHP programming language. It provides a standard format for dependencies management of PHP software and required libraries. It was developed by Nilsadermann and JoddiBoganiano. It was released on March 1, 2012. In this tutorial, we will learn the installation process of Composer on MacOS.

Prerequisites

  1. MacOS
  2. Login as an administrator on terminal
  3. PHP

Installation

Installation of composer includes following steps.

1) Download

Run the following command to download Composer setup on MacOS.

How to install Composer on MacOS

2) Check the installer for verification

Hash file code of Composer setup needs to be verified in order to verify the installer.

How to install Composer on MacOS

3) Run Composer-setup

A file named as composer-setup.php needs to be executed to get started with the installation of composer on our MacOS. It installs the Composer in the current directory which is our home directory. A file named as composer.phar will be created which needs to be moved to /usr/bin/composer to run composer globally.

How to install Composer on MacOS

4) Move Composer.phar to /usr/bin/composer

Composer.phar needs to be moved to /usr/bin/composer in order to run composer globally on the terminal. For this purpose, following command will be executed.

5) Run Composer

Now composer is installed on our system, to get it run on the system, just type composeron the terminal. The window will appear like following.

How to install Composer on MacOS

Hence, we have successfully installed and checked composer on our MacOS. Now we can install other dependencies or packages with its help.

You may also like