Library not loaded error after brew install php56

Try this

brew uninstall --ignore-dependencies node icu4c
brew install node

For me simply upgrading php helped.

brew upgrade php

The corresponding file dyld: Library not loaded: /usr/local/opt/icu4c/lib/libicui18n.<version>.dylib did not exist but a more recent one. So my php version was a bit behind compared to other dependents which probably upgraded icu4c when upgrading them. (Either node or postgresql?)


In my case, it was a symlink issue with the previous installation. Everything was fine after running

brew link --overwrite php56

P.S. Before running with --overwrite, try without. If you get the error below like I did, then go ahead.

Linking /usr/local/Cellar/php56/5.6.3...
Error: Could not symlink bin/pear
Target /usr/local/bin/pear
is a symlink belonging to php55. You can unlink it:
  brew unlink php55

To force the link and overwrite all conflicting files:
  brew link --overwrite php56

To list all files that would be deleted:
  brew link --overwrite --dry-run php56