Cooking with ImageMagick installed in MAMP

Reading Time: 3 minutes

These was probably the longest journey ever to get something running on the development side . Just a note if some could help to find a faster way . there are several tutorial how to install Imagemagick on MAMP but most outdated or for tech experts . At the end you will find most resources that helped to finalize the puzzle . Getting Imagemagick to run in the Terminal was quite easy with homebrew but to make it accessible from MAMP its a bit a hassle as no where was fully documented. Several PHP versions installed make it not simpler. MAMP 1.9 running with PHP 5.4 

MakPorts removed don’t want to install it again just for Imagemagick. 

Wrong Phpsize : 

The creators of MAMP have not released the usual open source components package with the 2.1.1 release, so you’ll have to do the following. php.h, zend_modules.h and zend_extensions.h can be found in the source code for PHP 5.4.4. Here’s a link to the page with the source code:

You’ll want to extract that, and the move the folder to /Applications/MAMP/bin/php/php5.4.4/include, creating the include directory if needed. I believe you’ll need to run ./configure from within /Applications/MAMP/bin/php/php5.4.4/include/php as well to generate the Zend headers. Then, try the instructions you found again.

1.Copy new PHP 5.4.4 files to the MAMP

2.Set the Path 

export PATH=/Applications/MAMP/Library/bin:/Applications/MAMP/bin/php/php5.4.4/bin:/usr/local/bin:$PATH:/opt/local/bin 


Imagemagick and Ghostscript is installed ?

Terminal :

$ which convert

$ which gs


Compiling the ImageMagic Extension for MAMP

Download Imagic remember thats the part needed to make ImageMagic accessible from PHP.

Set the Flags for Mac OS 10.6 Snow Leopard

CFLAGS="-arch i386 -arch x86_64 -g -Os -pipe -no-cpp-precomp"
CCFLAGS="-arch i386 -arch x86_64 -g -Os -pipe"
CXXFLAGS="-arch i386 -arch x86_64 -g -Os -pipe"
LDFLAGS="-arch i386 -arch x86_64 -bind_at_load"

cd /imagick/
./configure --with-imagick=/opt/local
make install

 Copy the fresh modul to the related MAMP PHP version

for PHP 5.4.4

for PHP 5.3

for PHP 5.2.


Add Extension to MAMP php.ini

Error Debugging

terminal commands

ls -l /usr/local/bin

which phpize  ( MAMP have his own phpize version php 3.6  if you add MAMP to your path controll the order . make a copy of your $PATH

echo $PATH  

 to restore all $PATH take care some needed path will be washed away !

PATH=$(getconf PATH)

To fix the missmatch with the wrong phpize 

 Discussion on gitHub about wrong phpize version when you installed php via Homebrew 

If you run into php error like 

PHP Warning:  PHP Startup: imagick: Unable to initialize module
Module compiled with module API=20090626
PHP    compiled with module API=20100525
These options need to match

Your PHP version dont match check it with

php-config --version

and the PHP API Extension version

php -i | egrep “PHP (Extension|Version)”

<em id="__mceDel"><a title="MAMP SERVER Component" href="">
Donwnload MAMP Server components </a>+ Additional PHP versions for MAMP PRO
<em id="__mceDel"><a title="Install Image Magick for PHP on OSX" href="" rel="bookmark">Install Image Magick for PHP on OSX</a></em></em>


Install Image Magick for PHP on OSX 2012

Installing ImageMagick PHP into MAMP Pro 2.0.5/2012

Cooking ImageMagic terminal

ImageMagick with MAMP 2010

Getting MAMP 1.9 to work with Image Magick, and other flora

Build Compile Universal ImageMagic Extension for MAMP

Resources:<a title="PHP Homebrew version conflicts" href="">
Homebrew PHP Modul Version conflicts </a>


Notify of