Wednesday, February 2, 2022

[SOLVED] dyld: Library not loaded: /usr/local/php5/lib/libssh2.1.dylib

Issue

The problem in a nutshell:

curl --v

results into:

dyld: Library not loaded: /usr/local/php5/lib/libssh2.1.dylib 
Referenced from: /usr/local/bin/curl 
Reason: image not found

On MacOS Big Sur 11.2.1. So there are two questions:

  1. How can I fix it?
  2. (Just out of curiosity) How come a system installed curl depends on php5?

Solutions that didn't work:

  1. brew update && brew upgrade
  2. brew install curl & brew reinstall curl
  3. Everything from this thread and this comment in particular

Thanks in advance.


Solution

SOLUTION

brew install libssh2
brew link libssh2

which required

brew link --overwrite libssh2

in my case. But that did the trick.

Obviously, libssh2 link was outdated.



Answered By - CmajSmith
Answer Checked By - Gilberto Lyons (WPSolving Admin)