valet-plus icon indicating copy to clipboard operation
valet-plus copied to clipboard

Bug: Library not loaded: /usr/local/opt/icu4c/lib/libicui18n.66.dylib

Open rav-redchamps opened this issue 4 years ago • 13 comments

  • [x] I've checked the issue queue and could not find anything similar to my bug.
  • [x] I'm on the latest version of valet-plus (valet --version): <Valet-Plus-Version>
  • [x] I've run valet fix and valet install after updating and before submitting my issue/feature.

What is the problem? Receiving 502 bad gateway error while accessing any site

log file: /usr/local/var/log/php-fpm.log

contains error

dyld: Library not loaded: /usr/local/opt/icu4c/lib/libicui18n.66.dylib Referenced from: /usr/local/opt/[email protected]/sbin/php-fpm Reason: image not found

Directory /usr/local/opt/icu4c/lib seems to be containing version 67 instead but [email protected] seems to be referencing version 66

content of folder "/usr/local/opt/icu4c/lib" are:

icu libicuio.67.1.dylib libicutu.67.dylib libicudata.67.1.dylib libicuio.67.dylib libicutu.a libicudata.67.dylib libicuio.a libicutu.dylib libicudata.a libicuio.dylib libicuuc.67.1.dylib libicudata.dylib libicutest.67.1.dylib libicuuc.67.dylib libicui18n.67.1.dylib libicutest.67.dylib libicuuc.a libicui18n.67.dylib libicutest.a libicuuc.dylib libicui18n.a libicutest.dylib pkgconfig libicui18n.dylib libicutu.67.1.dylib

rav-redchamps avatar May 31 '20 14:05 rav-redchamps

I'm also encountering this problem which has arisen since running brew install node. It appears Node depends on icu4c which is at 67.1 and therefore 66.1 is replaced by 67.1

I'm thinking reinstalling php should do the job. Being new to Valet+, I'm not sure the safest update procedure. brew upgrade valet-php@<your-version> ?

dannylepage avatar May 31 '20 15:05 dannylepage

I think icu4c 67.1 is released recently and [email protected] and other version depends on version 66.1 that is creating problem

I am trying icu4c version revert to 66.1

You may try below commands

cd $(brew --prefix)/Homebrew/Library/Taps/homebrew/homebrew-core/Formula

git checkout -b icu4c 22fb699a417093cd1440857134c530f1e3794f7d

brew reinstall ./icu4c.rb

rav-redchamps avatar May 31 '20 15:05 rav-redchamps

Hi thanks for the idea @rav-redchamps, I did try this already but then node is broken as it's looking for 67.1. Not sure if there's a way around this?

dannylepage avatar May 31 '20 15:05 dannylepage

@rav-redchamps This happened to me and I reverted it, now it works.

I'm on node 12 and it works for me (and yarn which is using the icu4u lib).

I've opened an issue in the repo for the valet PHP, hopefully, this will be fixed somehow upstream.

dingo-d avatar May 31 '20 16:05 dingo-d

@rav-redchamps @dannylepage try another way

brew uninstall [email protected]
brew install --build-from-source [email protected]
brew link --force [email protected]

And reboot your Mac.

ityetti avatar May 31 '20 22:05 ityetti

Hi, has anyone got a definite fix for this? I've tried all the above and, as @dannylepage states, reverting to 66.1 breaks node, which is still asking for 67.1 after fixing Valet v66 requirement.

alexryans avatar Jun 01 '20 10:06 alexryans

Hi @all,

The problem is with the valet-php bottles, i rebuilding them now within 3 hours all php versions are working again.

henkrehorst avatar Jun 01 '20 13:06 henkrehorst

I can confirm that it's working. I've reinstalled icu4c to latest version, removed [email protected] and did

brew uninstall [email protected]
brew install --build-from-source [email protected]
brew link --force [email protected]

And it works 🙂

dingo-d avatar Jun 01 '20 14:06 dingo-d

While installing [email protected] or 7.3

It is stuck here & cpu gets 100%

==> Patching
patching file acinclude.m4
Hunk #1 succeeded at 446 (offset 5 lines).
Hunk #2 succeeded at 461 (offset 5 lines).
Hunk #3 succeeded at 496 (offset 5 lines).
Hunk #4 succeeded at 508 (offset 5 lines).
patch unexpectedly ends in middle of line
Hunk #5 succeeded at 2529 with fuzz 1 (offset 110 lines).
==> ./buildconf --force
==> ./configure --prefix=/usr/local/Cellar/[email protected]/7.2.30_3 --localstatedir=/usr/local/var --sysconfdir=/usr/local/etc/valet-php/7.2 --with-config-file-pa
==> make

And then this error

Last 15 lines from /Users/macist/Library/Logs/Homebrew/[email protected]/03.make:
      __php_iconv_strpos in iconv.o
      __php_iconv_mime_decode in iconv.o
      ...
  "_iconv_open", referenced from:
      _do_convert in gdkanji.o
      _zif_iconv_substr in iconv.o
      _zif_iconv_mime_encode in iconv.o
      _php_iconv_string in iconv.o
      __php_iconv_strlen in iconv.o
      __php_iconv_strpos in iconv.o
      __php_iconv_mime_decode in iconv.o
      ...
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [sapi/phpdbg/phpdbg] Error 1

If reporting this issue please do so at (not Homebrew/brew or Homebrew/core):
  https://github.com/henkrehorst/homebrew-php/issues

These open issues may also help:
[email protected] update 7.2.31 https://github.com/henkrehorst/homebrew-php/pull/75

macist-m avatar Jun 01 '20 16:06 macist-m

How to run valet fix with prefix --build-from-source for php?

serhii-chernenko avatar Jun 02 '20 06:06 serhii-chernenko

@Inevix you don't need to run valet with prefix. You'll must to delete php and build it from the source, look to the my comment above.

ityetti avatar Jun 02 '20 11:06 ityetti

Followed @dannylepage's advice and fixed it quickly:

brew upgrade valet-php@<version> #<version> being 5.6, 7.1, 7.2, or 7.3

valet restart

complexthings avatar Jun 17 '20 12:06 complexthings

Confirming that upgrading the php package solves the issue (in my case for php 7.0).

stefan-h-singer avatar Jun 18 '20 08:06 stefan-h-singer