I have installed ImageMagick using brew install imagemagick
. This all worked fine and I can run any ImageMagick command from the Terminal / Command line.
Now when I try to use the ImageMagick classes in PHP, I get an error Class 'Imagick' not found in ...
. I guess this is because the ImageMagick module is not loaded.
Could anyone help me to get this thing working in PHP? Thanks!
Additional info:
Mac OS X Version: 10.8: Mountain Lion
PHP Version: 5.3.13
php72-imagick
is now deprecated as imagick is part of php binary itself. Usepecl
to install imagick e.g.:Ok after 1 hour at this I have figured it out. The mac is not giving the pecl script permissions to make a PHP directory. To resolve do as follows.
The install will be complete. Then, to test run:
Your ImageMagick installation is not enough. You also need the Imagick package (possibly called
php72-imagick
or similar for home brew).Imagick doesn't do the work itself, it is a native PHP extension for creating and modifying images using the ImageMagick API.
Try to search for the exact name of the package via
brew search imagick
.I just did this after a lot of experimenting. For now, this seems to be the way to do it for php 5.3:
No idea who Jose Gonzalez is but apparently we are in his debt....
this one worked for me:
here
I'm using Yosemite. For me, the solution is a combination of the answer and comment already listed here.
Edit /etc/php.ini to include imagick
Example: