dyld: Library not loaded: /usr/local/lib/libpng16.16.dylib with anything php related

后端 未结 11 961
攒了一身酷
攒了一身酷 2020-11-28 05:01

Using any php application results in:

dyld: Library not loaded: /usr/local/lib/libpng15.15.dylib
Referenced from: /usr/local/bin/php
Reason: image not found
         


        
相关标签:
11条回答
  • 2020-11-28 05:27

    Just in case someone else runs into this problem I solved it by the following

    brew update && brew upgrade # installs libpng 1.6
    

    This caused an error with other packages requiring 1.5 which they were built with, so I linked it:

    cd /usr/local/lib/
    ln -s ../Cellar/libpng/1.5.18/lib/libpng15.15.dylib
    

    Now they are both living in harmony and side by side for the different packages. It would be better to rebuild the packages that depend on 1.5, but this works as a quick bandage fix.

    0 讨论(0)
  • 2020-11-28 05:27

    I had very hard time with this error :

    Reason: Incompatible library version: php requires version 44.0.0 or later, but libpng16.16.dylib provides version 42.0.0 Trace/BPT trap: 6

    I did all the above things with brew and much more ... but it wasn't this !

    Check where your library is :

    sudo find / -name libpng16.16.dylib

    In my case here was the relevant result :

    • /usr/local/lib/libpng16.16.dylib
    • /usr/local/Cellar/libpng/1.6.34/lib/libpng16.16.dylib
    • /Applications/MAMP/Library/lib/libpng16.16.dylib
    • /opt/X11/lib/libpng16.16.dylib

    So as I'm a MAMP user it turn out that the error appeared while I was trying to update from PHP 7.1.0 to 7.1.8 (last MAMP php available) as Symfony4 require at least 7.1.3

    At the end I instaled the new version of MAMP and it worked (4.1 to 4.2). However be carreful when you're doing this, you need to backup first everything in your MAMP/htdoc folder. Also keep a backup of your custom compiled php version than can live in MAMP/bin/php. (In my case I had a special PHP version with Oracle drivers).

    Also if you configured the MAMP php version to be your CLI php interpreter, you'll need to update the PATH in your .bash_profile

    It should look something like this :

    export PATH=/Applications/MAMP/bin/php/php7.1.8/bin:$PATH

    I hope this can help.

    0 讨论(0)
  • 2020-11-28 05:32

    I got this problem after updating MAMP, and the custom $PATH I had set was wrong because of the new php version, so the wrong version of php was loaded first, and it was that version of php that triggered the error.

    Updating the path in my .bash_profile fixed my issue.

    0 讨论(0)
  • 2020-11-28 05:33

    In my case it was libjpeg. All I had to do was run brew reinstall libjpeg and everything just worked!

    0 讨论(0)
  • 2020-11-28 05:37

    I suggest you run:

    $ brew update && brew upgrade
    

    Until couple of minutes ago I had this problem, too. Because I have an up to date PHP version, I solved it with:

    $ brew reinstall php55
    

    Hope that helps.

    0 讨论(0)
提交回复
热议问题