After upgrading to Node v.10.9.0 via Homebrew the following error message was thrown from PHP:
dyld: Library not loaded: /usr/local/opt/icu4c/lib/libicui18n.61.dylib
Referenced from: /usr/local/bin/php
Reason: image not found
Reinstall PHP to fix, for me that's:
brew reinstall php@7.1
Update Hopefully now I have a proper solution for this. @jv2222 you should also check this:
Icu4c reinstallation made me force reinstall PHP8, which broke the purpose for me. So, I have found some new repositories where you don't need to hassle with this icu4c stuff at all:
First, delete all php installations with a command something like
brew uninstall "php*"
andbrew unlink php@7.1
You may also need to
untap
other taps. I had to runto install properly.
Then, if you want, delete the
/usr/local/etc/php
folderthen install one of the packages I've linked above.
Worked Nicely for PHP 7.1:
You can also quickly switch between php versions with a command like:
etc.
The GitHub repository: https://github.com/shivammathur/homebrew-php
The source where I found these packages: here.
I also shared this answer back here in SO: https://stackoverflow.com/questions/60128044/error-while-installing-php-7-1-for-mac-with-homebrew/65438579#65438579