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 solved this by copying it over to the missing directory:
cp /opt/X11/lib/libpng15.15.dylib /usr/local/lib/libpng15.15.dylib
brew reinstall libpng kept installing libpng16, not libpng15 so I was forced to do the above.