Search

How Tos > General

Set up Composer for a single host

If you want to set up Composer for a single host, follow these steps:

  1. Open the following URL in your browser: https://getcomposer.org/doc/00-intro.md#downloading-the-composer-executable
  2. Click the “download this file” link. This will download the “installer” file.
  3. Open the Terminal app.
  4. Change to the document root directory of the desired host.
  5. Enter the following commands (explained here) in the Terminal app. Confirm each line with “Return”.
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php composer-setup.php
php -r "unlink('composer-setup.php');"
  1. Composer is now set up.

To install the “psr/log”, a common interface for logging libraries, type the following in your Terminal app and press return.

php composer.phar require psr/log

Your document root should now look like the this:

MAMP PRO - Set up Composer for a single host - Document Root

You can find packages here.