shivammathur/homebrew-php

library libsodium missing, php will not start

ptheofan opened this issue · 1 comments

After upgrading to latest macos 14.2.1 (23C71), the icu library was missing. Unfortunately I did a brew upgrade which also upgraded php7.4. After this PHP can no longer find libsodium.

dyld[44415]: Library not loaded: @loader_path/../../../../opt/libsodium/lib/libsodium.23.dylib
  Referenced from: <E0C51ACC-ABA3-30EC-A3A3-B4019D27E066> /usr/local/Cellar/php@7.4/7.4.33_4/bin/php
  Reason: tried: '/usr/local/Cellar/php@7.4/7.4.33_4/bin/../../../../opt/libsodium/lib/libsodium.23.dylib' (no such file), '/usr/local/lib/libsodium.23.dylib' (no such file), '/usr/lib/libsodium.23.dylib' (no such file, not in dyld cache)

I have already tried the suggested fix with no luck.

brew reinstall $(brew deps shivammathur/php/php@7.4) shivammathur/php/php@7.4

Brew changed the libsodium version to

❯ ll /usr/local/opt/libsodium
lrwxr-xr-x  1 ptheofan  admin    26B Dec 21 13:14 /usr/local/opt/libsodium -> ../Cellar/libsodium/1.0.19

@ptheofan

Your build of php 7.4 is an old one and was built with libsodium.23 and since you updated the dependencies, it does not exist anymore.

Please run brew update, which should update the tap, and then reinstall php@7.4.

brew reinstall shivammathur/php/php@7.4