phpmacoshomebrewmacos-mojave

Homebrew upgrade drops PHP: dyld: Library not loaded: /usr/local/opt/libpsl/lib/libpsl.5.dylib


Today I upgraded Homebrew and this causes PHP versions (7.2 - 7.3) to be dropped. the following error is shown whenever I try to reinstall them:

dyld: Library not loaded: /usr/local/opt/libpsl/lib/libpsl.5.dylib
Referenced from: /usr/local/opt/curl-openssl/bin/curl
Reason: image not found
Error: An exception occurred within a child process:
DownloadError: Failed to download resource "php"
Download failed: https://www.php.net/distributions/php-7.3.9.tar.xz

Any suggestions?


Solution

  • Okay, I've solved this by installing this library brew install libpsl

    then reinstall php brew reinstall php@7.2 --build-from-source

    also the same for php@7.3

    Be aware that reinstalling php will reset all php configurations