This tutorial helps you to install and configure PHP composer on macOS operating system.

1. Prerequisites

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

2. Install Composer on macOS

Download the composer binary file from the getcomposer.org website by running the following command. It will create a file named composer.phar in the current directory. 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. Run composer command on the command prompt. This will provide you with composer version details along with options available with the composer command.

3. Upgrade PHP Composer

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

4. Uninstall (Remove) PHP Composer

As the composer is configured with a single file, you can simply remove it from your system.

Conclusion

This tutorial helped you to install the PHP composer on the macOS system. That will help you to manage the dependencies of a PHP-based application.

How to Install Composer on MacOS   TecAdmin - 63