How to Install Composer on Mac OS

How to install composer on Mac OS.

What is Composer ?

Composer is a cross-platform dependency manager that allows you to manage package dependency in your project.

In my previous article i explained how to manage package dependency in PHP through composer.

How to Install Composer on Mac OS

To install composer in your Mac os, execute following command.

The installer provided by composer check few PHP settings. If everything seems ok then it will download composer.phar in your working directory.PHAR stands for PHP archive, it’s an archive format for PHP which can be run on the command line, amongst other things.

NOTE: Installation Error

Subscribe Our Tutorials

Get Latest Updates on Facebook

In some cases you might get following error. To resolve this error open your php.ini file and enter this line (detect_unicode = Off) at the end of file .

To access composer globally, let’s move it to /usr/local/bin directory.

Now composer.phar is moved to our /usr/local/bin directory. Let’s create an alias in .bash_profile file.

If you are using Z shell then create this alias in .zshrc file.

Linux commands with examples

Now everything is done to check whether composer is installed successfully or not type composer in your terminal. If it installed successfully then you get following output.


About WebRewrite

I am technology lover who loves to keep updated with latest technology. My interest field is Web Development.
Tagged . Bookmark the permalink.