I'm working on a Apple computer. Mac mini 2015 or later, MacOS Mojave (up-to-date), MAMP Pro (up-to-date) with php 7.3.7 as module for the Apache server. Trying to install (latest) Varbase distro with composer (self update up-to-date) results in an error) Version 7.1.23 not good, need 7.2 or higher.
7.1.23 is the Apple-Mojave version not the MAMP, Brew or other version.

Comments

JayBeeDutch created an issue. See original summary.

metalbote’s picture

I don't know much about mac, but if you just type composer <command> into your shell, it will probably use the composer/php version set in $PATH

Try composer diagnose, as output you will get which composer/php version is being used and the according paths:

Checking platform settings: OK
[...]
Checking composer version: OK
Composer version: 1.9.0
PHP version: 7.3.8
PHP binary path: /usr/bin/php

I'm assuming you're reading 7.1.23. If so, use something like:
export PATH=/Applications/MAMP/bin/php/php7.3.7/bin/:$PATH
to set the right php version, here php7.3.7.
Look into /Applications/MAMP/bin/php/ for the php version you like to use, and change accordingly

metalbote’s picture

Priority: Major » Minor
JayBeeDutch’s picture

Just some additional information.
@Metalbote thanks for the tip on composer diagnose. It reads the php 7.1.23 version. But on the command line "php -v" shows the "MAMP"-version. Will check why MAMP and terminal/$PATH are showing different versions. Will work-around with adjusting $PATH. Thanks for the help.

metalbote’s picture

Okay, so I assume your installed composer uses the wrong php version.
Use one of the solutions:

  1. You can run composer explicitly with a given php executable:
    /Applications/MAMP/bin/php/php7.3.7/bin/php composer install
  2. Change your php with alias for current user by editing ~/.bash_profile and add:
    alias php="/Applications/MAMP/bin/php/php7.3.7/bin/php"
    alias composer="/Applications/MAMP/bin/php/php7.3.7/bin/php composer"
     
  3. fake your php environment for composer runs(See docs):
    At your global composer config in /Users/<user>/.composer/config.json add something like:
    "config": {
        "platform": {
            "php": "7.3.7"
        }
    }
    
metalbote’s picture

Status: Active » Closed (works as designed)
JayBeeDutch’s picture

@metalbote,
tnx for the solutions.
It's ICT so it is not logical (but everything is possible). You have to study for it, haha!
Why can't it be simple. Set a php-version at one place and use it anywhere? Because even a chimp would understand.
There goes our income.
Thanks for your suggestions. Just hit the wall thinking it would be simple....
Kind regards and gratitude.

mmjvb’s picture

Category: Bug report » Support request

Problems in the infrastucture don't qualify as bug report, they are considered support requests.