简体   繁体   中英

Can i update to the latest version of PHP with macOS High Sierra

I have tried to update PHP on my iMac with MacOS High Sierra, but I can't find how to do it. I intend to run Laravel 7. Is my MacOS version compatible with the most recent version of PHP?

My current PHP version is the following:

Last login: Wed Nov 18 17:19:54 on ttys000
Albert-iMac:~ admin$ php -v
PHP 7.1.33 (cli) (built: Jan 18 2020 13:49:07) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.1.0, Copyright (c) 1998-2018 Zend Technologies
Albert-iMac:~ admin$ brew install php@7.3
Updating Homebrew...
==> Auto-updated Homebrew!
Updated 1 tap (homebrew/core).
==> New Formulae
aerc            cargo-edit      cfn-format      giza            gping
==> Updated Formulae
Updated 124 formulae.

Warning: php@7.3 7.3.24 is already installed and up-to-date
To reinstall 7.3.24, run `brew reinstall php@7.3`
Albert-iMac:~ admin$ 

Similar to what I have answered in here , you need some environment setup to have it work for your favor:

  • brew install php@7.3
  • brew link --force php@7.3
  • brew services start php@7.3
  • export PATH="/usr/local/opt/php@7.3/bin:$PATH"
  • export PATH="/usr/local/opt/php@7.3/sbin:$PATH"

Right now you can still have the bottle for php@7.3, but it might go away with the next release as homebrew dropped the high-sierra bottle support recently.

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