How to solve the problem of using composer install in OSX to prompt that the PHP version is too low?

in MACOSX11, the pre-installed version of PHP is 5.5. I installed PHP7, with brew myself. When using composer install, the PHP is required to be no less than 5.6. what should I do?
first of all, mac os is not as simple as linux to delete / usr/bin/php, and then build a soft link to the new version of PHP.
the core services pre-installed in the MAC OS system cannot be modified by root users. Unless the Rootless mechanism is turned off. But I don"t want to do that.
is there any other way to ask the god?

Mar.09,2021

method 1: composer partial installation
method 2: modify the PATH environment variable, corresponding to the PHP version you need
method 3: why delete / usr/bin/php? Rename and add a soft link to the PHP version you need. For the Rootless protection mechanism, please refer to Zhihu

.

method 2:

system comes with PHP, location / usr/bin
:

1 zsh .zshrc PATH export PATH=/Applications/XAMPP/xamppfiles/bin:$PATH; :


2:


3

Menu