How to run composer in MAMP php version?

I cannot start the linker because my php version on my OS is not updated sufficiently (5.5.36). So I tried to install the composer all over the world using MAMP php (5.6.10)

1) I am creating an alias for my MAMP php

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

2) Run this line to install the composer

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

3) Run this line to move the composer

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

Composer installed (composer works on terminals)

This is a tutorial.

But when I want to run composer install, the composer uses my php version ..

Any idea?

+4
source share
1 answer

. PHP PHP MAMP PHP.

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

, :

$ which php

@Andrew Patton

+1

Source: https://habr.com/ru/post/1662306/


All Articles