Home >Backend Development >PHP Tutorial >Why Does PHP Fail to Load After Installing Node via Homebrew: 'dyld: Library not loaded: /usr/local/opt/icu4c/lib/libicui18n.62.dylib'?

Why Does PHP Fail to Load After Installing Node via Homebrew: 'dyld: Library not loaded: /usr/local/opt/icu4c/lib/libicui18n.62.dylib'?

Linda Hamilton
Linda HamiltonOriginal
2024-11-09 09:33:021038browse

Why Does PHP Fail to Load After Installing Node via Homebrew:

PHP Fails to Load After Installing Node via Homebrew: "dyld: Library not loaded: /usr/local/opt/icu4c/lib/libicui18n.62.dylib"

Problem:

After installing Node.js using Homebrew on macOS Mojave, PHP encounters an error when attempting to load a library:

dyld: Library not loaded: /usr/local/opt/icu4c/lib/libicui18n.62.dylib
Referenced from: /usr/local/bin/php
Reason: image not found

Uninstalling both Node.js and icu4c does not resolve the issue.

Solution:

To address this error, the following steps have been recommended:

Homebrew Version Mismatch:

  • Run brew cleanup to resolve any version mismatches in Homebrew packages.

Package Upgrade:

  • Upgrade specific packages, including icu4c, using brew upgrade icu4c.
  • Alternatively, upgrade all installed packages by running brew upgrade.

Cleanup:

  • Once the upgrade is complete, run brew cleanup to remove any outdated or unnecessary files.

Cautions:

  • Upgrading all packages may affect other applications or configurations.
  • Ensure that you have backed up any critical data before performing these actions.

The above is the detailed content of Why Does PHP Fail to Load After Installing Node via Homebrew: 'dyld: Library not loaded: /usr/local/opt/icu4c/lib/libicui18n.62.dylib'?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn