Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ImageMagick Brew installation with PHP Module in Mac OS X

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

like image 493
Wouter Konecny Avatar asked Aug 08 '12 13:08

Wouter Konecny


People also ask

How do I enable imagick PHP?

To enable Imagick for your website, go to your Site Tools -> Dev -> PHP Manager. Click the PHP Extensions tab and find the entry for the “imagick” extension in the list that appears. Then click the Change value button (pencil icon), select the On radio button for Status and save the changes.

How do I add imagick to PHP?

Navigate to Home - Software - Module Installers, then click on the Manage button next to PHP Pecl. In the next screen, select the required PHP version, then click Apply. You can now enter “imagick” in the Install a PHP Pecl field, and click the Install Now button.


2 Answers

I just did this after a lot of experimenting. For now, this seems to be the way to do it for php 5.3:

brew tap josegonzalez/php brew tap homebrew/dupes brew install php53-imagick 

No idea who Jose Gonzalez is but apparently we are in his debt....

like image 173
Daniel Feder Avatar answered Oct 01 '22 23:10

Daniel Feder


php72-imagick is now deprecated as imagick is part of php binary itself. Use pecl to install imagick e.g.:

brew install php brew install imagemagick brew install pkg-config pecl install imagick 
like image 42
anytimecoder Avatar answered Oct 01 '22 23:10

anytimecoder