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
- MacOS
- Login as an administrator on terminal
- PHP
Installation
Installation of composer includes following steps.
1) Download
Run the following command to download Composer setup on MacOS.
2) Check the installer for verification
Hash file code of Composer setup needs to be verified in order to verify the installer.
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.
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.
Hence, we have successfully installed and checked composer on our MacOS. Now we can install other dependencies or packages with its help.