Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

chubbard216's avatar

How to fix PHP after brew update && brew upgrade (Library not loaded)

I did the unthinkable and brew update && brew upgrade a local environment that was working perfectly fine and now I'm missing a PHP library and Laravel Valet has stopped working.

php -v

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

Output from latest brew update && brew upgrade attempt

Error: Could not remove [email protected] keg! Do so manually:
sudo rm -rf /usr/local/Cellar/[email protected]/7.3.16

My brew list command contains both php and [email protected]

How do I solve this Library not loaded error that's preventing php from running?

Thanks!

0 likes
1 reply

Please or to participate in this conversation.