OSX Composer can't set memory limit (SOLUTION)
My situation was simple, and yet annoying. Composer would run out of memory due to a very low 16mb limit. No matter what php.ini file I changed, nothing improved. It had nothing to do with the value php -i had either. Composer for some reason just had it's own insanely low memory limit to work with. After a lot of searching, the following command worked for me.
php -d memory_limit=-1 /usr/local/bin/composer require etc/etc
Please note, the value of -1 implies "unlimited". You may want to go with 512m or even 1024m to se a reasonable limit that composer really just should never exceed.