Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to install Image Magick for MAMP (Pro) on Mountain Lion (10.8.2)

I've been searching for a way to install Image Magick on my Mountain Lion setup (where I use MAMP Pro). I did find this article, but it isn't specific to ML. Also found a couple other similar questions here on SO but they were too specific I think. Doesn't help that I'm not great at this sort of thing. Can anyone point me to a good resource?

like image 316
A Herrera Avatar asked Nov 02 '12 18:11

A Herrera


People also ask

How do I enable ImageMagick?

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 install imagick?

Install ImageMagick extension: Now install the ImageMagick PHP extension by using the following command. Install Imagick extension: After completion of ImageMagick package, the Imagick PHP extension will install. Restart Apache Server: Restart the apache server by using the following command.

Is imagick the same as ImageMagick?

ImageMagick is a PHP utility, a command line tool for image manipulation. For further details, see this. Imagick is an API or a class that performs the function same as ImageMagick. It provides numerous functions for image manipulation in PHP.


3 Answers

As was pointed out in erwinheiser's comment, MAMP 3 now comes with imagemagick pre-installed. I checked MAMP's User Guide (PDF) and found this:

The ImageMagick PHP module is included by default, but you must enable it inside the php.ini template file. Remove the ‘;’ from the following line.

;extension=imagick.so

And how do you find and change the (right) php.ini file for MAMP Pro?

  • From MAMP's menu choose FileEdit TemplatePHP › [the latest version]
    • or use the keyboard shortcut: ⌘4
  • Make the edit. (Imagick was was at line 542 in mine.)
  • Save and close the file.
  • MAMP asks if you want to restart the servers now, choose yes.

And you're done!

like image 151
Joel Farris Avatar answered Oct 16 '22 00:10

Joel Farris


Make sure you check out Joel Farris' answer if you're using an up-to-date version of MAMP


I finally managed to get it installed properly using Homebrew and the instructions here: http://egoco.de/post/23167969231/installing-imagemagick-for-php-and-mamp

I did have to run brew doctor and brew link a couple of times to fix dependencies (and change permissions on a file or two), and use

brew install php54-imagick

rather than the one mentioned at the url.

The extension he mentions at the end (the bit you have to paste in your different ini files) is:

[imagick]
extension="/usr/local/Cellar/php54-imagick/3.1.0RC2/imagick.so"

Hope it helps!

like image 15
erwinheiser Avatar answered Oct 15 '22 23:10

erwinheiser


MAMP comes with Imagick installed. I have MAMP v3.2.1 (not MAMP Pro) running on OS X 10.10.3 (Yosemite).

I enabled imagick by editing php.ini file which comes with MAMP.

php.ini file is available on the following path:

/Applications/MAMP/bin/php/php5.6.7/conf/php.ini

Replace 5.6.7 with your php version number.

php.ini file will contain the following line:

;extension=imagick.so

Change that line to:

extension=imagick.so

Now restart the MAMP servers and you are good to go.

like image 6
haris Avatar answered Oct 16 '22 01:10

haris