Dyld: Library Not Loaded: /usr/local/opt/icu4c/lib/libicui18n.62.dylib Error Running Php After Installing Node With Brew On Mac

The error message suggests that the ICU library required by the PHP binary is not found at the specified location.

To resolve the issue, you can try the following steps:

  1. Check if the ICU library exists at the expected location by running the command:

    ls /usr/local/opt/icu4c/lib/
    
  2. If the library is not found, you may need to reinstall or update the icu4c package using Homebrew:

    brew reinstall icu4c
    
  3. If the library is present, but the PHP binary is still unable to find it, you can set the DYLD_LIBRARY_PATH environment variable to the library path.
    Open the terminal and run the command:

    export DYLD_LIBRARY_PATH=/usr/local/opt/icu4c/lib/
    
  4. Try running PHP again to see if the issue is resolved:

    php -v
    

If none of the above steps work, you may have to investigate further, such as checking the PHP configuration or seeking help from the PHP or Homebrew community.

About the Author Rex

I'm a passionate tech blogger with an insatiable love for programming! From my early days tinkering with code, I've delved into web dev, mobile apps, and AI. Sharing insights and tutorials with the world is my joy, connecting me to a global community of like-minded tech enthusiasts. Python holds a special place in my heart, but I embrace all challenges. Constantly learning, I attend tech conferences, contribute to open-source projects, and engage in code review sessions. My ultimate goal is to inspire the next generation of developers and contribute positively to the ever-evolving tech landscape. Let's code together!