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
I had this error that wasn't solved by brew update && brew upgrade. For some reason I needed to install it from scratch:
brew update && brew upgrade
$ brew install libpng