dyld: Library not loaded: /usr/local/lib/libjpeg.8.dylib - homebrew php

后端 未结 15 2066
你的背包
你的背包 2020-12-07 09:34

PHP was not working for me as I was encountering this libpng issue, so I reinstalled a new version with Homebrew.

However, I\'m getting a similar error with

相关标签:
15条回答
  • 2020-12-07 10:13

    A dirty solution, that work fine for me.

    ln -s /usr/local/lib/libjpeg.9.dylib /usr/local/lib/libjpeg.8.dylib
    
    0 讨论(0)
  • 2020-12-07 10:15

    I had also this problem. I solved it in this way: Uninstall jpeg/8b:

    brew uninstall --ignore-dependencies libjpeg
    

    Uninstall jpeg/9b:

    brew uninstall --ignore-dependencies jpeg
    

    Re install jpeg/9b

    brew install jpeg
    

    0 讨论(0)
  • 2020-12-07 10:15

    I am sharing this as I had the same issue when using PHP5.4. Originally, I had PHP5.6 and it was working fine. Then I downgraded to php5.4 as my app only supports PHP5.4.

    Then this error came up. I noticed that I have libjpeg.9.dylib and PHP5.4 is looking for libjpeg.8.dylib.

    Doing the following sorted the issue:

    brew uninstall php54
    brew install --build-from-source php54
    
    0 讨论(0)
  • 2020-12-07 10:18

    I was getting a similar problem trying to upgrade composer:

    dyld: Library not loaded: /usr/local/opt/jpeg/lib/libjpeg.8.dylib
    Referenced from: /usr/local/bin/php
    Reason: image not found
    composer: PHP Phar support is required for this formula
    Error: An unsatisfied requirement failed this build.

    Problem was php couldn't find libjpeg library anymore. One way to fix this is to reinstall php and libjpeg. Here's how I reinstalled them:

    # find out which version of php is installed
    brew list | grep php
    
    # uninstall php
    brew uninstall php70 --ignore-dependencies
    
    # uninstall libjpeg
    brew uninstall libjpeg --ignore-dependencies
    
    # install libjpeg again
    brew install libjpeg
    
    # install php again
    brew install php70
    

    I was then able to upgrade everything again :)

    brew update && brew upgrade
    

    0 讨论(0)
  • 2020-12-07 10:18

    I was having the same problem and the only thing that helped was to use the --build-from-source parameter:

    brew install php70 --build-from-source
    
    0 讨论(0)
  • 2020-12-07 10:19

    I encountered the similar problem today. The cause of the problem was a newer version of libjpeg. And the solution that worked was building php bottle from source.

    Check available version of libjpeg:

    $brew info libjpeg
    jpeg: stable 9b (bottled)
    Image manipulation library
    http://www.ijg.org
    /usr/local/Cellar/jpeg/9b (20 files, 724KB) *
      Poured from bottle on 2017-08-07 at 12:06:42
    From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/jpeg.rb
    

    Install php from source:

    brew install --build-from-source php56
    

    Update:
    If you have already installed php you have to uninstall it prior to building from source. It also applies to extensions.

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