简体   繁体   中英

How to install PHP 7.4 on Apple M1?

I have a Apple M1 arm64

I tried to install PHP 7.4 via brew

brew install php@7.4                                                                                                                             ✔  19:28:52 
Error: php@7.4 has been disabled because it is a versioned formula!

Then i tried with valet

valet use php@7.4                                                                                                                           ✔  4s  19:28:30 
Installing php@7.4...
==> Tapping shivammathur/php
Cloning into '/opt/homebrew/Library/Taps/shivammathur/homebrew-php'...
remote: Enumerating objects: 16343, done.
remote: Counting objects: 100% (677/677), done.
remote: Compressing objects: 100% (155/155), done.
remote: Total 16343 (delta 553), reused 636 (delta 520), pack-reused 15666
Receiving objects: 100% (16343/16343), 2.29 MiB | 6.15 MiB/s, done.
Resolving deltas: 100% (12887/12887), done.
Tapped 20 formulae (73 files, 3.1MB).
[php@7.4] is not installed, installing it now via Brew... 🍻
Error: php@7.4 has been disabled because it is a versioned formula!


In Brew.php line 168:
                                         
  Brew was unable to install [php@7.4].  

Any ideas?

This worked for me:

brew install shivammathur/php/php@7.4

You can install it using:

brew install php@7.4-arm64

This will install the arm64 version of PHP 7.4 specifically for the Apple M1.

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