Skip to content
Advertisement

dyld library not loaded – PHP, Laravel, Composer command line commands not working

I updated my PHP version to 7.2 via homebrew and now any laravel,php, and composer command brings this error. I’ve googled the error though no luck! What do I need to install? Why has this now became an error?

libldap-2.4.2.dylib

dyld: Library not loaded: /usr/local/opt/openldap/lib/libldap-2.4.2.dylib
  Referenced from: /usr/local/bin/php
  Reason: image not found
Abort trap: 6

Advertisement

Answer

I fixed it – I ran….

  echo 'export PATH="/usr/local/opt/openldap/bin:$PATH"' >> ~/.bash_profile
  echo 'export PATH="/usr/local/opt/openldap/sbin:$PATH"' >> ~/.bash_profile
  export LDFLAGS="-L/usr/local/opt/openldap/lib"
  export CPPFLAGS="-I/usr/local/opt/openldap/include"

Then after words a similar error came up that libiconv was not loaded and did not match the PHP version I had, so I ran…

brew install libiconv
User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement