6

I can't run composer install because my php's version on my OS is not enough updated (5.5.36). So i tried to install composer globally with my MAMP's php(5.6.10)

1) I create alias for my MAMP's php

nano ~/.bash_profile
alias phpmamp='/Applications/MAMP/bin/php/php5.6.10/bin/php'

2) Run this line to install composer

curl -sS https://getcomposer.org/installer | phpmamp

3) Run this line to move composer

sudo mv composer.phar /usr/local/bin/composer

Composer is installed (run composer on terminal works)

This is a the tutorial.

But when i want to run composer install, composer uses my OS php.

Any idea ?

Adrien Castagliola
  • 881
  • 2
  • 9
  • 29

1 Answers1

3

Those lines worked for me. I override the OS PHP path to my MAMP PHP path.

PHP_VERSION=`ls /Applications/MAMP/bin/php/ | sort -n | tail -1`
$ export PATH=/Applications/MAMP/bin/php/${PHP_VERSION}/bin:$PATH
$ source ~/.bash_profile

You can check the version by running :

$ which php

The complete solution

Thanks to @Andrew Patton

Community
  • 1
  • 1
Adrien Castagliola
  • 881
  • 2
  • 9
  • 29