无法在Mac(Yosemite)上安装Composer

时间:2014-12-09 14:28:22

标签: php macos composer-php

localhost:1nbox myusername$ sudo curl -s http://getcomposer.org/installer | phpmamp
#!/usr/bin/env php
All settings correct for using Composer
PHP Fatal error:  Uncaught exception 'RuntimeException' with message 'Unable to write bundled cacert.pem to: /Users/myusername/.composer/cacert.pem' in -:403
Stack trace:
#0 -(112): installComposer(false, false, 'composer.phar', false, false, false)
#1 -(14): process(Array)
#2 {main}
  thrown in - on line 403
localhost:1nbox myusername$ 

我的.bash_profile有:

alias phpmamp='/Applications/MAMP/bin/php/php5.6.2/bin/php'

1 个答案:

答案 0 :(得分:5)

如上面发布的@TotalWipeOut,此命令有效:

curl -s http://getcomposer.org/installer | sudo /Applications/MAMP/bin/php/php5.6.2/bin/php

我能够使用MAMP PHP成功安装composer。