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
A dirty solution, that work fine for me.
ln -s /usr/local/lib/libjpeg.9.dylib /usr/local/lib/libjpeg.8.dylib
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
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
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
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
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.