Skip to content

Imagick for MAMP Pro installation guide

jdlx edited this page Jan 22, 2014 · 2 revisions

This a forked and slightly more detailed Version from 0xPr0xy’s original guide at https://github.com/0xPr0xy

requirements

  • You’ll need to use the command line (all terminal commands are prepended with the $ sign).
  • You’ll need to have Homebrew installed
  • This guide is tested with OSX 10.6 (other versions may vary)
  • This guide is tested with MAMP Pro 2.1.1 (other versions may vary)

Install Imagick

Using Homebrew, you’ll install a PHP53 compat version of Imagick.. first let Homebrew search the formula:

$ brew search php53-imagick

The above search should return something like josegonzalez/php/php53-imagick .. use this for the next step:

$ brew install josegonzalez/php/php53-imagick

“no formula” errors & taping

If you get errors alike:

Error: No available formula for XYZ
Please tap it and then try again: brew tap XYZ

Do as you’ve been told, and run the brew tap ... command exactly as the error told you.
After that, repeat the step which caused that error.

Add extension to MAMP Pro’s php.ini

In MAMP Pro go to the menubar, and choose File > Edit Templates > PHP > PHP x.x.x php.ini
A simple editor window will popup where you can edit the ini file.
A search for the term extension=, will lead you to a block with various lines of
extension=.... Now simply ad the following one and save the file:

extension="/usr/local/Cellar/php53-imagick/3.1.0RC2/imagick.so"

Copy libfreetype to MAMP lib

$ cp /usr/local/Cellar/freetype/2.4.10/lib/libfreetype.6.dylib /Applications/MAMP/Library/lib/

Fix library version incompatibilities

Open the file /Applications/MAMP/Library/bin/envvars in your editor, and comment out the following lines:

DYLD_LIBRARY_PATH="/Applications/MAMP/Library/lib:$DYLD_LIBRARY_PATH"
export DYLD_LIBRARY_PATH

Restart MAMP and check the phpinfo tab

A search for the term `imagick` should bring you to a section reading like so:

imagick module                            enabled
imagick module version                    3.1.0RC2
imagick classes                           Imagick, ImagickDraw, ImagickPixel, ImagickPixelIterator
ImageMagick version                       ImageMagick 6.7.7-6 2012-09-18 Q16 http://www.imagemagick.org
ImageMagick copyright                     Copyright (C) 1999-2012 ImageMagick Studio LLC
ImageMagick release date                  2012-09-18
ImageMagick number of supported formats:  191
Note

If you get an error while installing libxml2, verify that you have installed the latest version of Xcode command line tools (Xcode/Preferences/Downloads/Components)