title: dyld: Library not loaded: /usr/local/lib/libpng16.16.dylib with anything php related
body: <p>Using any php application results in:</p>
  
  <pre><code>dyld: Library not loaded: /usr/local/lib/libpng15.15.dylib
  Referenced from: /usr/local/bin/php
  Reason: image not found
  [1]    4494 trace trap  php
  </code></pre>
  
  <p>Most of my php applications were installed using homebrew with the exception of composer (installed using curl)</p>
  
  <p>I tried removing the the libpng and reinstalling with homebrew to no avail.</p>
  
  <p>Next was to switch to latest version of libpng 1.5 as stated in the error message:</p>
  
  <pre><code>$ brew info libpng
  libpng: stable 1.6.10 (bottled) 
  http://www.libpng.org/pub/png/libpng.html
  /usr/local/Cellar/libpng/1.5.17 (15 files, 1.0M)
  Poured from bottle
  /usr/local/Cellar/libpng/1.5.18 (15 files, 1.0M)
  Poured from bottle
  /usr/local/Cellar/libpng/1.6.10 (17 files, 1.3M) *
  
  $ brew switch libpng 1.5.18
  Cleaning /usr/local/Cellar/libpng/1.5.17
  Cleaning /usr/local/Cellar/libpng/1.5.18
  Cleaning /usr/local/Cellar/libpng/1.6.10
  16 links created for /usr/local/Cellar/libpng/1.5.18
  </code></pre>
  
  <p>Now the error has changed to:</p>
  
  <pre><code>dyld: Library not loaded: /usr/local/lib/libpng16.16.dylib
  Referenced from: /usr/local/lib/libfreetype.6.dylib
  Reason: image not found
  [1]    6993 trace trap  phpunit
  </code></pre>
  
  <p>Im running Mavericks (10.9.2) and PHP 5.5.1.</p>
  
  <p>Thanks in advance!</p>