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

前端 未结 27 1406
孤城傲影
孤城傲影 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:43

    Seems like it is impossible to link icu4c using brew after latest OS X update. Which makes things more interesting. The only solution I found working for me:

    1. Download and compile icu4c 62.1 to /usr/local/icu4c/62.1
    mkdir ~/sources
    cd ~/sources
    wget http://download.icu-project.org/files/icu4c/62.1/icu4c-62_1-src.tgz
    tar xvzf icu4c-62_1-src.tgz
    cd icu/source/
    
    sudo mkdir /usr/local/icu4c/62.1
    ./configure --prefix=/usr/local/icu4c/62.1
    make
    sudo make install
    
    1. Link libs:
    ln -s /usr/local/icu4c/62.1/lib/*.dylib /usr/local/include/
    
    1. Set DYLD_LIBRARY_PATH in ~/.bash_profile:
    export DYLD_LIBRARY_PATH=/usr/local/include
    

提交回复
热议问题