Search code examples
phplaravelmacoscomposer-phpmamp-pro

Could not find package laravel/laravel with version 6 in a version installable using your PHP version 5.6.30


I’m using mac os and install MAMP 5.7. when I run PHP -v on the terminal it says PHP version is 7.2 but when I try to create Laravel project I got this error. I don’t know why the composer recognizes that the PHP version in 5.6

this is the error


Solution

  • Please check the following this may fix the problem

    1. check the alias given to composer to point to appropriate version
    2. try uninstalling or upgrading your Mammp or your verserver and remove cache data.
    3. if you change php version in command line. check it after restart of your PC