I was trying to update a project using Composer when I got the following error:

You must set up the project dependencies.
Run the following commands in /Users/Kim/Sites/control.local:

curl -s http://getcomposer.org/installer | php
php composer.phar install

Composer needs the PHP setting detect_unicode to be disabled. If it is enabled, composer will fail with a message like this:

The detect_unicode setting must be disabled. 
Add the following to the end of your php.ini: detect_unicode = Off

The solution is simple. You have to add the following to the end of your php.ini: detect_unicode = Off

To find out which php.ini file PHP is loading, you can use this command:

php -i|grep ini

Installing dependenices with Composer

php composer.phar install

I started getting errors. It could not find the MongoDB extension which I had installed in Mamp. I knew it was there, and correctly installed since it showed on my phpinfo(). The problem is that composer is reading the default PHP version on your MacOS and not MAMPs.

Fortunately this is an easy fix. You need to edit your .bash_profile with the correct path. To do this:

cd ~
vi .bash_profile

NOTE: If the file does not exist, you must create a new one.

add the following line to your .bash_profile file:

export PATH=/Applications/MAMP/bin/php/php5.3.6/bin:$PATH

NOTE: Change the path for the PHP version you are using.

Then close and run:

. .bash_profile

NOTE: The above code is period-space-period and not ..!

Then check if the path to PHP is correct by running

which php

If the path is showing your MAMP path, then you should be good to run

php composer.phar install