简体   繁体   中英

Composer not running good php version MAC-OS

I have 2 Php versions on my MAC

1 - 5.4.40: Installed and configured via MAMP PRO

2 - 8.1: Configured and installed via homebrew.

I stopped the Mamp pro version and I want to work on version 8. From a terminal point of view everything is fine I have my correct version but as soon as I use composer I see that it is attached to version 5.6 even after uninstalling/reinstalling. My composer diagnose write: PHP version: 5.6.40 - Package overridden via config.platform, actual: 8.1.2

I absolutely don't see how to change the default php configuration of composer. Did someone had the same problem?

which php will return you the path of the default php. For example /usr/bin/php .

Check this version /path/to/php -v .

Homebrew install packages under /usr/local/Cellar/

brew info php@YOUR.VERSION will show you the path.

You can run composer with a specific php version /path/to/php/8 /path/to/composer...

Yous can also make aliases to make it easier.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM