簡體   English   中英

如何在 2020 年使用 brew 安裝 php7.1

[英]How can I install php7.1 using brew in 2020

我參考了谷歌的一些教程,但它們不起作用,我猜這些方法已經過時了。

例如https://developerjack.com/blog/2016/installing-php71-with-homebrew/

運行“brew install php@7.1”時出錯

macOS 卡塔利娜 10.15.4

executed
brew install

brew tap
caskroom/cask
homebrew/bundle
homebrew/cask
homebrew/core
homebrew/services
mongodb/brew

brew -v
Homebrew 2.2.12
Homebrew/homebrew-core (git revision 53ccd; last commit 2020-04-08)
Homebrew/homebrew-cask (git revision 322a2; last commit 2020-04-08)

brew install php@7.1
Updating Homebrew...
==> Auto-updated Homebrew!
Updated 1 tap (homebrew/core).
No changes to formulae.

Error: No available formula with the name "php@7.1" 
==> Searching for a previously deleted formula (in the last month)...
Warning: homebrew/core is shallow clone. To get complete history run:
  git -C "$(brew --repo homebrew/core)" fetch --unshallow

Error: No previously deleted formula found.
==> Searching for similarly named formulae...
Error: No similarly named formulae found.
==> Searching taps...
==> Searching taps on GitHub...
Error: No formulae found in taps.

直到 2018 年 3 月,所有與 PHP 相關的 brews 都由Homebrew/php選項卡處理,但已被棄用,所以現在我們使用Homebrew/core package 中可用的內容。 這應該是一個更好的維護,但是一個不太完整的包集。

PHP 5.6 , PHP 7.0 , and PHP 7.1 have been deprecated and removed from Brew because they are out of support , and while it's not recommended for production , there are legitimate reasons to test these unsupported versions in a development environment.

Remember only PHP 7.2 through 7.4 are officially supported by Brew so if you want to install PHP 5.6 , PHP 7.0 , or PHP 7.1 you will need to add this tap:

$ brew tap exolnet/homebrew-deprecated

參考這里

PHP@7.1 已棄用https://www.php.net/supported-versions.php

所以嘗試使用其他 repo 安裝

brew install openldap libiconv
brew tap exolnet/homebrew-deprecated
brew install php@7.1

https://devhoi.com/threads/install-brew-deprecated-php-version-php-7-1-5-6-7-0-on-brew-macos.25/

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM