philcook / brew-php-switcher

Brew PHP switcher is a simple shell script to switch your apache and CLI quickly between major versions of PHP. If you support multiple products/projects that are built using either brand new or old legacy PHP functionality. For users of Homebrew (or brew for short) currently only.
MIT License
961 stars 90 forks source link

icu4c PHP dependency #63

Closed bkdotcom closed 2 years ago

bkdotcom commented 5 years ago

I've been running PHP 5.6 (yes, I know it's way deprecated, but it's the version I must use for my day job)

brew install brew-php-switcher This appears to have run brew update.. or at least updated my PHP 7.x install... I believe this in turn updated a "icu4c" dependency

When running PHP 5.6 I now get:

php -v
dyld: Library not loaded: /usr/local/opt/icu4c/lib/libicui18n.62.dylib
  Referenced from: /usr/local/bin/php
  Reason: image not found

here's the fix: https://stackoverflow.com/a/56242725/1371433

However if I now brew-php-switcher 7.3

php -v
dyld: Library not loaded: /usr/local/opt/icu4c/lib/libicui18n.64.dylib
  Referenced from: /usr/local/bin/php
  Reason: image not found

PHP 5.6 requires icu4c 62.1 and PHP 7.3 requires icu4c 64.2 there seems to be no easy way to switch between the two..

supposedly brew switch icu4c 64.2 should work, but I get a "not in cellar" error

The only fix seems to be to reinstall icu4c

62.1: brew reinstall https://raw.githubusercontent.com/Homebrew/homebrew-core/575eb4bbef683551e19f329f60456b13a558132f/Formula/icu4c.rb 64.2: brew reinstall https://raw.githubusercontent.com/Homebrew/homebrew-core/master/Formula/icu4c.rb (I'm not sure how to find the direct link for 64.2.. It's likely that link will point to a newer ver in the future)

Anyone know how to get brew-php-switcher to also switch/update this dependency?

repeat commented 4 years ago

I bumped into same problem. In case anyone needs to manual switch icu4c to 64.2 version: brew reinstall https://raw.githubusercontent.com/Homebrew/homebrew-core/a806a621ed3722fb580a58000fb274a2f2d86a6d/Formula/icu4c.rb

thejas-fg commented 4 years ago

I bumped into same problem. In case anyone needs to manual switch icu4c to 64.2 version: brew reinstall https://raw.githubusercontent.com/Homebrew/homebrew-core/a806a621ed3722fb580a58000fb274a2f2d86a6d/Formula/icu4c.rb

Thank you :-) you saved my day.

nick322 commented 4 years ago

You can see https://github.com/eXolnet/homebrew-deprecated/issues/23 to solve a problem

philcook commented 2 years ago

Thanks guys seems like a Homebrew / MacOs upgrade issue therefore nothing for this project to fix.