ezzatron / brew-php

A Homebrew external command for managing multiple PHP installations.
MIT License
5 stars 0 forks source link

PHP not linked after homebrew formula name changes #3

Open aborigeno opened 6 years ago

aborigeno commented 6 years ago

After a brew update that changed formula names (php56 -> php@5.6) using the link command on older php version will not link, this message is printed instead:

$ brew php link php@5.6
Unlinking /usr/local/Cellar/php/7.2.3_2... 25 symlinks removed
Warning: php@5.6 is keg-only and must be linked with --force
ezzatron commented 6 years ago

Interesting. I've been on holiday so I haven't encountered that yet. I'll give it a go ASAP.

ezzatron commented 6 years ago

Okay, I have a fix incoming for this, but you're probably still going to run into this problem:

$ brew php link php@7.0
Linking /usr/local/Cellar/php@7.0/7.0.29...
Error: Could not symlink share/pear/.channels/.alias/pear.txt
Target /usr/local/share/pear/.channels/.alias/pear.txt
already exists. You may want to remove it:
  rm '/usr/local/share/pear/.channels/.alias/pear.txt'

To force the link and overwrite all conflicting files:
  brew link --overwrite php@7.0

To list all files that would be deleted:
  brew link --overwrite --dry-run php@7.0

Which I think is caused by homebrew/homebrew-core#25974. I don't really want to add --overwrite to the linking function as I'm not sure how dangerous that might be. There seems to be an open PR addressing the issue, so let's sit tight for a bit and see if that resolves the problem.

ezzatron commented 6 years ago

1.1.0 released with these fixes.