ImageMagick with MAMP
Many web designers and front-end developers use MAMP due to its ease of use. However, MAMP unfortunately doesn’t come pre-installed with the very popular and wide spread image manipulation library ImageMagick. My fellow internet super talent Mario Lončarić recently clarified the steps for installing the ImageMagick library to your Mac installed with MAMP.
This article is probably not one for the Terminal savvy programmers, but rather for the rest of us using drag and drop web server packages such as MAMP.
Prior to getting started, I’m assuming you already have MAMP installed on your local computer, most likely in
/Applications/MAMP. If not, install it before you move on to the next step.
First, download ImageMagick for Mac OS X and unarchive it to
Next, open up Terminal.app (don’t be afraid, it won’t bite you), and enter line by line:
$yourmacname> export MAGICK_HOME="/Applications/MAMP/bin/ImageMagick/ImageMagick-6.6.1" $yourmacname> export PATH="$MAGICK_HOME/bin:$PATH" $yourmacname> export DYLD_LIBRARY_PATH="$MAGICK_HOME/lib"
Test if everything works up to this point:
$yourmacname> cd /Applications/MAMP/bin/ImageMagick/ImageMagick-6.6.1 $yourmacname> convert logo: logo.gif $yourmacname> identify logo.gif $yourmacname> display logo.gif
Last: browse to
/Applications/MAMP/Library/bin and open
envvars file with your text editor. Change the two uncommented lines, i.e.
DYLD_LIBRARY_PATH="/Applications/MAMP/bin/ImageMagick/ImageMagick-6.6.1/lib:/Applications/MAMP/Library/lib:$DYLD_LIBRARY_PATH" export DYLD_LIBRARY_PATH
If you are using ImageMagick in your server-side application, be sure to set the correct path. For instance in PHP:
Restart Apache in MAMP and you’re done.
Some users have reported that the correct
DYLD_LIBRARY_PATH for their particular setup was:
DYLD_LIBRARY_PATH="/Applications/MAMP/bin/ImageMagick/ImageMagick-6.6.1/lib:$DYLD_LIBRARY_PATH" export DYLD_LIBRARY_PATH
Update for Mac OS X Yosemite users
If you had problems with starting Apache after updating to Yosemite, one of the proposed fixes was to rename
envvars file to
_envvars or to comment out lines containing
DYLD_LIBRARY_PATH. That works if you don’t need to use ImageMagick, but
DYLD_LIBRARY_PATH is required for it to function properly.
The solution is to rename
DYLD_FALLBACK_LIBRARY_PATH in the
DYLD_FALLBACK_LIBRARY_PATH ="/Applications/MAMP/bin/ImageMagick/ImageMagick-6.6.1/lib:$DYLD_FALLBACK_LIBRARY_PATH" export DYLD_FALLBACK_LIBRARY_PATH