Software⏱️ 2 min read📅 2026-05-31

How to Fix: dyld: Library not loaded: /usr/local/opt/icu4c/lib/libicui18n.62.dylib error running php after installing node with brew on Mac

dyld error fixed by reinstalling icu4c and updating php

Quick Answer: Reinstall icu4c, update php and try running php -v again.

The issue you're experiencing is due to the presence of the ICU library, which is not compatible with PHP. When you installed Node.js using Homebrew on your Mac, it also installed the ICU library, causing conflicts with PHP.

🛑 Root Causes of the Error

  • The ICU library is not compatible with PHP, causing the error.

✅ Best Solutions to Fix It

Method 1: Removing ICU Library

  1. Step 1: Open your Terminal and run the following command to remove the ICU library:
brew uninstall icu4c

Method 2: Installing PHP with ICU Support

  1. Step 1:Install Homebrew's PHP package, which includes the ICU library:
brew install php

💡 Conclusion

By following these steps, you should be able to resolve the issue and get PHP working on your Mac.

Did this fix your problem?

If not, try searching for specific error codes.

🔍 Search Error Database

❓ Frequently Asked Questions