Sublime Forum

Big Sur upgrade error dyld: Library not loaded: /usr/lib/libpq.5.dylib Referenced from: /usr/local/bin/php Reason: image not found

#1

Just upgraded to Big Sur, everytime I save a document, I keep getting this error:

dyld: Library not loaded: /usr/lib/libpq.5.dylib
Referenced from: /usr/local/bin/php
Reason: image not found

0 Likes

#2

Sounds like a PHP related plugin in unable to run PHP due to a missing library.

0 Likes

#3

When I run sudo find / -name libpq.5.dylib the file is located in:
/usr/local/Cellar/libpq/10.4/lib/libpq.5.dylib

0 Likes

#4

Disabled the package “PHP Syntax Checker” and this fixed the issue

0 Likes

#5

But your php executable is still broken right? you could get to the bottom of this and run

otool -L /usr/local/bin/php

This will print the shared libraries that the php executable depends on. If it’s just the PostgreSQL client library that’s missing, you could try

brew link libpq

and see if php works.

Probably something in brew is broken.

2 Likes

#6

Thank you rwols, the otool lists libpq.5.dylib that the executable depends on.
But when I try the “brew link” command it failed.
I had to update homebrew with the following command first:
brew update
then: brew link libpq --force

And now it works like magic… thank you!!!

3 Likes