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
In my case it was libjpeg. All I had to do was run brew reinstall libjpeg and everything just worked!
libjpeg
brew reinstall libjpeg