I installed node using homebrew (Mojave), afterwards php stoped working and if I try to run php -v I get this error:
php -v
php -v dyld: Library not lo
I've tried many of the suggestions here, and at the end brew upgrade php is what did the trick for me, but seems the issue is all over the place
brew upgrade php