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

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

    I also had this problem, and none of the solutions in this thread worked for me. As it turns out, the problem was that I had this line in ~/.bash_profile:

    alias php="/usr/local/php/bin/php"
    

    And, as it turns out, /usr/local/php was just a symlink to /usr/local/Cellar/php54/5.4.24/. So when I invoked php -i I was still invoking php54. I just deleted this line from my bash profile, and then php worked.

    For some reason, even though php55 was now running, the php.ini file from php54 was still loaded, and I received this warning every time I invoked php:

    PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/Cellar/php54/5.4.38/lib/php/extensions/no-debug-non-zts-20100525/memcached.so' - dlopen(/usr/local/Cellar/php54/5.4.38/lib/php/extensions/no-debug-non-zts-20100525/memcached.so, 9): image not found in Unknown on line 0
    

    To fix this, I just added the following line to my bash profile:

    export PHPRC=/usr/local/etc/php/5.5/php.ini
    

    And then everything worked as normal!

提交回复
热议问题