雖然brew已支援m1,但安裝時仍會報錯,但其實解決辦法已很明顯的寫了出來


Error: Cannot install under Rosetta 2 in ARM default prefix (/opt/homebrew)!
To rerun under ARM use:
    arch -arm64 brew install ...
To install under x86_64, install Homebrew into /usr/local.

arch -arm64 brew install xxxx

例如平時安裝個php7.4:

brew install php@7.4

在m1上則需要:

arch -arm64 brew install php@7.4