Installing ImageMagick and imagick via MacPorts

Installing ImageMagick with MacPorts couldn’t be easier:


sudo port install ImageMagick

But getting it to work with your PHP installation is a bit harder. If you’ve installed PHP via MacPorts with the pear variant you can install the imagick extension via pecl:


sudo pecl install imagick

The trick to getting it to stop complaining about the Wand-config path, is by passing it the proper prefix for ImageMagick. When prompted, hit 1, then enter in:

/opt/local

Now just add this to the end of your php.ini file, and reboot apache:


[imagemagick]
extension=imagick.so

11 thoughts on “Installing ImageMagick and imagick via MacPorts

  1. Pingback: Imagick Stub « SiteOrigin

  2. Hi there. Ive been struggling to get Imagick installed for a few days now, im getting the error

    sudo: pecl: command not found

    How do i install PECL? Not found an easy to understand, clear solution for this, could you help? Im so close, have installed MacPorts and Xcode and ImageMagick, just need the php extension!!

    Many thanks in advance!

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>