composer scripts use older php version composer scripts use older php version bash bash

composer scripts use older php version


Well, Composer doesn't use your alias to execute PHP.

You could use php70 -v in composer.json, but its better to symlink the newer PHP version to /bin/php, so that Composer can pick it up:


Create a ~/bin folder

mkdir ~/bin

Then symlink the newer PHP version /usr/local/bin/php70 to just~/bin/php

ln -s /usr/local/bin/php70 ~/bin/php

Finally, add this line to .bash_profile to append this folder to your environment variable PATH.

export PATH="$HOME/bin:$PATH"