-
-
Notifications
You must be signed in to change notification settings - Fork 12.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot brew link --force [email protected] out of the box #25974
Comments
So if I understand correctly your request is to have the PEAR directory versioned? |
I think it should be either fully versioned or fully not-versioned. I'm not sure which is best generally though. As it stands now, it's half-and-half with some files showing up in both places. |
A fully versioned PEAR repository seems unnecessary, but may come with a future pull request.
|
Why was PHP renamed and why is it keg-only? Can't find any documentation or discussion on that. |
There has been a caveat and an issue announcing this in the php tap since January. |
@mmelvin0 can you be more specific about this?
I'm just trying to get [email protected] working and am seeing the same error when running On a related note, is this the recommended way to use Homebrew's PHP instead of the one that ships with MacOS? Running |
which returns only the first instance of an executable in your path so this is something in your setup then. |
Well, there's no PHP alias in /usr/local/bin, so I guess I need to get [email protected] linked? If so, I'll need to figure this out first:
|
You can't have 2 php versions linked at the same time, you'll have to unlink your current one first. |
I do not have a currently linked version. [email protected] is the first that I'm trying. |
can you do |
|
curious, I guess I'd just copy the offending file to a safe place and remove the original then. |
Looks to be many more than just the pear.txt file:
|
Ok I went ahead and ran Thanks for your help, @SMillerDev. I'm going to try installing [email protected] and figuring out the switching process. |
Couldn't get this working with all that's suggested here but found another work around.
Create #export PATH="/usr/local/opt/[email protected]/bin:$PATH"
#export PATH="/usr/local/opt/[email protected]/sbin:$PATH"
#export PATH="/usr/local/opt/[email protected]/bin:$PATH"
#export PATH="/usr/local/opt/[email protected]/sbin:$PATH"
export PATH="/usr/local/opt/[email protected]/bin:$PATH"
export PATH="/usr/local/opt/[email protected]/sbin:$PATH" Comment out all but the version of php you want active with hashes. Edit # PHP Version
source ~/.php-version Reload the new config or open a new terminal window and confirm the switch is done with I also had to remove all my configs for older installations as to not conflict with the new pecl module stuff so went into |
@subtlegusto @kabel The fact that Hence why I think the PEAR directory should be either entirely versioned and entirely unversioned. I'm leaning towards unversioned, since users likely would want to share PEAR libraries between versions and the PECL build directory is already versioned with the Zend ABI date, but I realize that it's a bit weird to install stuff directly into |
I see the error in my thinking. Pear and pecl share a meta repo. Pull request to follow. |
I have php56, php70, and php71 installed from the homebrew-php tap. This morning I updated php71 to [email protected] in core.
What I was doing previously was linking /usr/local/bin/php71 -> /usr/local/opt/php71/bin/php for all relevant PHP tools so I could access multiple versions of PHP simultaneously while also "brew linking" (usually 7.1) to have a "default PHP".
This worked wonderfully for me with the tiny exception that when upgrading I needed to do some brew link juggling, but the whole process seemed pretty idiot-proof to me.
Now with [email protected], I noticed that, as with all versioned formula, it is keg-only and requires brew link --force. This is OK, but, with the addition of PEAR, it seems the the install processes has pooped some files directly into /usr/local/share/pear that conflict with
Basically my issue is that brew link --force is not a viable option out of the box with the new [email protected] formula. I do NOT want to do $PATH arithmetic in my .bashrc. The brew link (--force) option is a far better match to my needs/
I read up on why PEAR was added by default to [email protected] and agree with the rationale as it gives more flexibility and is more defers to pear.php.net and pecl.php.net.
The PEAR directory structure at /usr/local/share/pear is a bit of a mess of mutable config vs. static files. A bit more care needs to be taken to ensure any files placed there don't conflict with the formula's installed files.
I'm not sure exactly how to solve this in a general way. For me personally, I use a minimum set of officially supported PHP extensions and I never use PEAR, so a --without-pear option would be ideal for me, but I realize there are tons of other use cases the makes difficult or impossible.
I can easily workaround this by moving /usr/local/share/pear out of the way, but if you aren't intimately familiar with the ancient horror that is PEAR, doing this might easily break your installation.
Let me know if you need more info. Basic steps to reproduce are:
brew upgrade
brew link --force [email protected]
The text was updated successfully, but these errors were encountered: