laravel 5 - MAMP incorrect PHP version -
i have mamp installed , when start server choose php 5.6.1, when run php -v in terminal in mamp/htdocs/project folder shows 5.5.36 , if run composer install throws error 
doctrine/annotations v1.3.0 requires php ^5.6 || ^7.0 -> php version (5.5.36) not satisfy requirement.
moreover, if run in mamp/htdocs shows 5.6.31.
what doing wrong , should update php?
mamp uses different version of php system. mamp version of php installed to:
/applications/mamp/bin/php/php5.6.1/bin/php so, if do:
/applications/mamp/bin/php/php5.6.1/bin/php -v you correct version displayed.
if edit ~/.bash_profile file on machine add following lines (and reopen terminal):
alias php='/applications/mamp/bin/php/php5.6.1/bin/php' export mamp_php=/applications/mamp/bin/php/php7.1.1/bin export path=$mamp_php:$path (if have path setup in ~/.bash_profile, append :$mamp_php end)
you can do:
php -v get correct version. , can run composer install or composer update correct version of php.
this have setup in .bash_profile reference.

Comments
Post a Comment