dyld: Library not Loaded MacOS High Sierra

November 26, 2017

MacOS High Sierra problem when executing php command through terminal. Problem? An error statingĀ dyld library not loaded.

dyld: Library not loaded: /usr/local/opt/jpeg/lib/libjpeg.9.dylib
Referenced from: /usr/local/bin/php
Reason: image not found
Abort trap: 6

According to this stackoverflow post, I need to uninstall current version of libjpeg. Use --ignore-dependencies to force uninstallation since libjpeg is needed by other library dependencies.

brew uninstall libjpeg --ignore-dependencies

Reinstall with: brew install libjpeg

dyld library not loaded /usr/local/opt/jpeg/lib/libjpeg.9.dylib

The command will produce warning since latest version of libjpeg has already installed Warning: jpeg 9b is already installed, it's just not linked.

Simply we can shoot brew link jpeg command into Terminal, and all our problem should be solved.

MORE READINGS