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

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

    I followed the above (never a bad idea to keep up to date with brew anyhow) and still had the same exact issue:

    LAPTOP:folder Username$ php -v
    dyld: Library not loaded: /usr/local/lib/libpng15.15.dylib
      Referenced from: /usr/local/bin/php
      Reason: image not found
    Trace/BPT trap: 5
    

    Then figured out a simpler way:

    Search for your libpng version(s) on your box:

    # Requires locate & updatedb for mac os x
    # See Link [1] 
    LAPTOP:folder Username$ locate libpng15.15.dylib
    /Applications/GIMP.app/Contents/Resources/lib/libpng15.15.dylib
    /usr/X11/lib/libpng15.15.dylib
    /usr/local/Cellar/libpng/1.5.14/lib/libpng15.15.dylib
    

    Make a symlink:

    LAPTOP:folder Username$ ln -s /usr/local/Cellar/libpng/1.5.14/lib/libpng15.15.dylib /usr/local/lib/libpng15.15.dylib
    

    Try again:

    LAPTOP:folder Username$ php -v
    PHP 5.3.26 (cli) (built: Aug 25 2013 16:07:23) 
    Copyright (c) 1997-2013 The PHP Group
    Zend Engine v2.3.0, Copyright (c) 1998-2013 Zend Technologies
        with Xdebug v2.2.3, Copyright (c) 2002-2013, by Derick Rethans
    

    1) Mac OS X equivalent of locate

提交回复
热议问题