Reputation: 6840
I'm running OSX Leopard with MAMP (a sandbox consisting of Apache/MySQL/PHP). I installed ImageMagick using MacPorts by following this tutorial: http://www.brybot.ca/archives/getting-imagemagick-and-more-to-work-with-mamp-on-os-x/
Then I added extension=imagick.so to the php.ini But PHP won't recognize it. It keeps telling me:
Fatal error: Class 'imagick' not found
Any idea how to fix this?
Upvotes: 6
Views: 14453
Reputation: 135
Watch out: Imagemagick and Imagick are not the same! While Imagemagick is a CLI suite/lib to manipulate images, Imagick is a PHP Wrapper class to use Imagemagick in PHP natively (read as without using exec() or alike..).
A imho good guide on installing both Imagemagick and Imagick @ OSX is this one.
UPDATED
Give this guide a try: Imagick for MAMP-Pro installation guide (which is my slightly more detailed fork of: Mamp-Imagick-Manual )
Upvotes: 3
Reputation: 2122
This question is old but I had the problem today and it seems to be easier than before.
This solution uses OSX 10.13 with MAMP 4 and Homebrew.
brew install imagemagick
. /Applications/MAMP/bin/php/[yourPhpVersionThere]/conf/php.ini
.;extension=imagick.so
, and delete the ';' at the beginning of the line.You are done.
Upvotes: 10
Reputation: 7131
You may need to follow the macports installation instructions for adding /opt/local and /opt/local/bin to your PATH variable.
If you've already done that, then find out where MacPorts has put the imagemagic library and copy it to your PHP installation's extension dir (or create a link from your extension dir to the file).
By default, MacPorts will compile and install things to work with other MacPorts libraries, so when compiling to work with non-MacPorts libraries, you may need to move files around and tweak paths a bit.
Upvotes: 1
Reputation: 36840
(Is case php case-sensitive? If I google around a bit, it's Imagick
with a capital i.)
Is it enough to download image-magick? If I read this correctly, you need a php wrapper for image-magick also.
Upvotes: 0