I recently read about a package management system for PHP on NetTuts called Composer. It looked interesting but I hadn’t had time to play around with it. At work, though, a new project came up that called for using a package from Composer so I needed to figure out how to get it installed and working on my Macintosh running Mountain Lion. I followed the instructions in the article for installation but ran into some problems.
Running the curl command specified in the article:
$ cd /path/to/my/project
$ curl -s http://getcomposer.org/installer | php
gave me the following results:
Doing some Googling, I found people mentioning that the solution is to problem is to edit the php.ini file. I couldn’t find a php.ini file in Mountain Lion but I did find a php.ini.default in the /private/etc/ directory. So, I copied the php.ini.default file as php.ini and opened it up for editing. At the end of the file, I added the configuration:
detect_unicode = Off
Then, I reran the curl command. Composer was now installed but with a warning:
So, I looked up the timezone for my location and added another option to my php.ini file:
date.timezone = America/New_York
I then followed the directions in the NetTuts article to add Composer to my /usr/sbin/ directory and it worked like a charm.
Thanks for your post. Its helped configure composer in my new mac.
One thing i would like to add is the possibility to start composer with an alias, because of my laziness; in my ~/.profile (or ~/.bash_profile) I add this line “alias composer=’php /PfadToComposer/composer.phar'” without quotes of course.
You got it.
Thank you, You solve my problem.
I was trying change /etc/, but the right place is /private/etc/ and worked very well.
Thank you again
Thanks, man. Your article helped me!
Just wanted to say, thank you!