Homebrew安装特定的PHP次要版本

huangapple go评论56阅读模式
英文:

Homebrew install specific minor php version

问题

When installing brew install php@8.1, it automatically installs the latest version, which is 8.1.15. Due to development purposes, I need to install another minor version, such as 8.1.7. Since minor versions are hardcoded in formulas, it's not possible to install a specific minor version out of the box. What is the easiest way to use an old formula if I could find it in the repository's commit history? I tried this, as was advised in a different Stack Overflow thread:

brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/83b80f3b76c9cbd79e914f927a45a083b1d047e1/Formula/php.rb

But it literally won't let me:

Error: Installation of php from a GitHub commit URL is unsupported! `brew extract php` to a stable tap on GitHub instead.

Any ideas?

英文:

When installing brew install php@8.1 it automatically installs latest version 8.1.15. Due to the development purposes I need to install another minor version (e.g. 8.1.7). Since minor versions are hardcoded in formulas, it's not possible to install specific minor version out of the box. What is the easiest way to use an old formula if I could find it in the repo's commit history? I tried this as was advised in different SO thread:

brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/83b80f3b76c9cbd79e914f927a45a083b1d047e1/Formula/php.rb

But it literally won't let me to:

Error: Installation of php from a GitHub commit URL is unsupported! `brew extract php` to a stable tap on GitHub instead.

Any ideas?

答案1

得分: 1

你需要执行重置提交的黑客操作,以将其重置为这个提交

就像这篇帖子中的选项3一样。

英文:

You need to do hack of resetting the commit to this one.

Like the option 3 in this post.

huangapple
  • 本文由 发表于 2023年2月18日 11:43:06
  • 转载请务必保留本文链接:https://go.coder-hub.com/75491030.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定