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

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e45973-27084.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e45973-27084.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?