I try to install [email protected] using brew. But, it return error because it is versioned formula. What is it?
command: brew install [email protected]
result: Error: [email protected] has been disabled because it is a versioned formula!
I try to install [email protected] using brew. But, it return error because it is versioned formula. What is it?
command: brew install [email protected]
result: Error: [email protected] has been disabled because it is a versioned formula!
6
Answers
You can only install supported versions of PHP with brew. However, there is the tap
shivammathur/php
which can be used to install unsupported version of PHP.brew tap shivammathur/php
brew install shivammathur/php/[email protected]
brew link [email protected]
The first step only needs to be done once. After adding the tap, you can install PHP version 5.6 – 8.2.
BTW,
brew install [email protected]
gives out same warning, but does install php7, so this could be an optionI applied the same instructions given by @derhansen and worked very well for [email protected]:
You can also edit the formula and re-enable it. These steps worked for me:
brew edit [email protected]
disable! date: "2022-11-28", because: :versioned_formula
. Change 2022 to 2023brew install [email protected]
The bottles still exist online, so installation was very fast, but I assume that they will eventually be deleted, forcing a slow compile instead.
For anyone having this issue 2023…
The accepted answer is an unnessercery step.
@Mike’s answer is the better one, but is missing one important step.
HOMEBREW_NO_INSTALL_FROM_API=1 brew install [email protected]
HOMEBREW_NO_INSTALL_FROM_API=1 brew install [email protected]
HOMEBREW_NO_INSTALL_FROM_API=1 brew install [email protected]
HOMEBREW_NO_INSTALL_FROM_API=1 brew install [email protected]
Brew tells you, when you edit the Formula:
This way, you still use the official formula.
This of course, works for any formula.
So, just remove the following two lines from the formula:
When you are using homebrew to install PHP you need to know the versions that are been supported by homebrew.
If you need to install an unsupported version you can do it by running these commands
And then if ypu need to check the current version and then shift between php version you can run