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

后端 未结 11 1017
攒了一身酷
攒了一身酷 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

    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.

提交回复
热议问题