dyld: Library not loaded: /usr/local/opt/icu4c/lib/libicui18n.62.dylib error running php after installing node with brew on Mac

前端 未结 27 1335
孤城傲影
孤城傲影 2020-11-27 09:02

I installed node using homebrew (Mojave), afterwards php stoped working and if I try to run php -v I get this error:

php -v
dyld: Library not lo         


        
27条回答
  •  春和景丽
    2020-11-27 09:48

    Rather than install an old version of icu4c that the older (precompiled) php can link to, it's better to recompile the old php to link to the more recent library.

    brew uninstall php@7.2
    brew install --build-from-source php@7.2
    

    This will build php and link it to the newer library. I found reinstall didn't quite work; the new install choked when the destination folder already existed.

    I also did brew link --force php@7.2 for my environment.

提交回复
热议问题