Note that there are some explanatory texts on larger screens.

plurals
  1. POResolved: MAMP Php can't exec ('convert') after Homebrew ImageMagick install
    primarykey
    data
    text
    <p>I installed Imagemagick using Homebrew on Lion, everything is fine except that it doesn't work at all when being called from php. Console:</p> <pre><code>$ convert -version Version: ImageMagick 6.7.1-1 2011-07-29 Q16 http://www.imagemagick.org Copyright: Copyright (C) 1999-2011 ImageMagick Studio LLC Features: OpenMP $ which convert /usr/local/bin/convert </code></pre> <p>PHP:</p> <pre><code>echo exec ('convert -version'); </code></pre> <p>or exec('convert -version', $output); var_dump($output);</p> <p>Produces nothing (or an empty array).</p> <pre><code>exec ('/usr/local/bin/convert') // works, but exec ('which convert') // doesn't </code></pre> <p>I need to test this locally to make sure I can detect convert in production environment. But I can't properly test it. The PATH is set and it works in Terminal, but not from PHP.</p> <p><strong>Resolved:</strong></p> <p>Turns out, for php to work <code>convert</code> should be in <code>/usr/bin/</code> so this solved it:</p> <pre><code>ln -s /usr/local/bin/convert /usr/bin/convert </code></pre> <p><strong>Update</strong></p> <p>It was becasue of MAMP, here is the fix: <a href="http://firedevcom.tumblr.com/post/22791937644/fix-for-homebrew-imagemagick-and-mamp" rel="noreferrer">http://firedevcom.tumblr.com/post/22791937644/fix-for-homebrew-imagemagick-and-mamp</a></p> <p>Open /Applications/MAMP/Library/bin/envvars</p> <p>And comment out the following lines:</p> <pre><code>DYLD_LIBRARY_PATH="/Applications/MAMP/Library/lib:$DYLD_LIBRARY_PATH" export DYLD_LIBRARY_PATH </code></pre> <p>Done.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload