How to install ImageMagick?

Hi,

One of the nice little additions in Wordpress 4.7 is that PDF files uploaded to the media library now generate a preview image that can be used throughout wordpress natively.
This of course requires ImageMagick to work.

It’s easy enough to enable ImageMagick on MAMP (that I used to use), but how can I install ImageMagick on the Local by Flywheel server?

1 Like

Hey Anders,

Here are instructions on how to install it for PHP 5.6.20. It changes for other versions of PHP but I had this on hand :slight_smile:

imagick.so.zip (390.5 KB)

  1. Unzip and copy the attached file (imagick.so) to your site’s app folder
  2. Open SSH for the site. You can do so by right-clicking on the site then going to “Open Site SSH”
  3. Run: mv /app/imagick.so /opt/php/5.6.20/lib/php/extensions/no-debug-non-zts-20131226/imagick.so
  4. Run: echo -e ‘\n\nextension = /opt/php/5.6.20/lib/php/extensions/no-debug-non-zts-20131226/imagick.so’ >> /conf/php/5.6.20/php.ini
  5. Run: apt-get update && apt-get install -y imagemagick
  6. Run: service php-5.6.20-fpm restart

BTW, ImageMagick will be on by default for all PHP versions in an upcoming update.

2 Likes

Anyone that have install instructions for PHP7?

Most of the commands are like greek to me, so I can’t really figure out what to change…

I think you might just want to stick with 5.6 for now. I have read about issues with ImageMagick and 7, at least when it pertains to the PDF thumbnail functionality. My two cents, but not an expert on this.

This is actually crazy easy! Just run the commands. I downgraded 7 to 5.6, restarted the server and then followed the directions and it worked perfect…

Thanks @clay! Look forward to having it included in the future.

Still waiting for PHP ImageMagick to be on for all php versions… Thanks for your help on this clay, got it working on PHP 5.6.20 because of your post.

I’ve written some instructions for those who want to get this running on PHP 7.2

http://local.getflywheel.com/community/t/step-by-step-imagemagick-support-for-php-7/4375

1 Like

@clay Are there any plans to include the necessary support for PDF Thumbnails? ImageMagick is one of those things.

It would be nice if this could be given priority for the next release as Local is made for WordPress. It is a bit like a WordPress hosting company not supporting all of the WordPress features…

Thanks!