The stable imagick package in pecl won't currently build with PHP 5.4.x. The latest beta will, so to install:
sudo pecl install imagick-beta
Having installed ImageMagick with MacPorts, when prompted for the prefix of my ImageMagick installation, the answer is:
However, the build fails because apparently MacPorts names the ImageMagick header file directory
ImageMagick-6 instead of
ImageMagick. The fix is to make a symlink:
cd /opt/local/include sudo ln -s ImageMagick-6/ ImageMagick
Now the imagick extension will build. Hooray!