0

I have followed the directions to install drupal-project with drupal-composer. I keep getting this error and it doesn't make sense to me.

[InvalidArgumentException]
Could not find package drupal-composer/drupal-project with version 8.x-dev in a version installable using your PHP version 5.5.38.

I am using MAMP and the php version is 7.1.22. I even tried the template download for drupal-composer/drupal-project and I still get the same error. Composer is installed, verified with the checking the version in terminal.

I have searched and cannot find anything to assist me in solving. Yes, I am new to composer and trying to get a local environment setup with composer versus just downloading etc. Any help or direction would be appreciated.

  • 1
    Sounds like the CLI is using the PHP installed on the host OS and not the one in MAMP. – Kevin Feb 20 at 16:48
  • Is there a way to change that? any idea what to search for to help me... Thanks!!! – timwhelan Feb 20 at 16:52
  • 2
    Basically, you need to inform where it is via setting $PATH: io.serendipityhq.com/experience/… – Kevin Feb 20 at 16:55
  • OMG - Thank you so much!!! That is exactly what I needed. Thank you! – timwhelan Feb 20 at 17:04
1

Despite not technically being a Drupal question, this gets asked a lot. The answer, for anyone coming across this using various local dev stacks - you need to inform your command line of where PHP ($PATH variable) is that you want to use. Otherwise it will default to what is installed on your machine, likely very out of date.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.