ImageMagick and Imagemagick PECL extension

webbouk

Well-known member
Has anybody successfully managed to install a working version of ImageMagick with the Imagemagick PECL extension on a Windows Server 2012?

If Google charged for search use I'd have to remortgage my house to pay the bill :D

In a nutshell, I've tried various routes, various downloads, numerous combinations, and spent far too much time trying to get this to work.

PHP 7.1.12
Architecture x64
Thread Safety enabled
VC14

I don't like giving up and refused to be beaten but on this occasion I might just have to.
 
Yes, a standalone installation.

That's one guide I'd read and followed earlier

Would it be better to install XAMPP for Windows and if so would that cause any issue with the present installation of PHP or is it a case of simply removing the present PHP files?
 
I've just been informed that it would not be possible to install XAMPP without causing conflicts as our server is running IIS
 
I have it running on Windows 2012 and 2016. PHP 7.1 and 7.2. The trick is to make sure you reboot after you upload all the DLL's. They are in memory and need to be cleared to load the new.

Quick and easy install:

One note. I use 64bit versions so the install steps are for the 64bit version of PHP using non-thread safe (NTS) version of PHP.
  1. Download ImageMagick zip. Don't use the installer.
  2. Download the PCL extension for 7.2 from the Windows PHP site
  3. Download PHP ImageMagick dependencies for PHP 7.2.
  4. Unzip ImageMagick to C:\ImageMagick.
  5. Unzip the PHP dependencies and upload all the .dll files in the bin folder to the ImageMagick folder overwriting any files with the same name.
  6. Unzip the PHP extension and copy it to the PHP ext folder.
  7. Go to start My Computer, right click and select properties.
  8. Go to advanced system settings from left menu.
  9. Click Environment Variables.
  10. At the bottom select New.
  11. For variable name input MAGICK_HOME
  12. For variable value input C:\ImageMagick\. If you put it in a different folder adjust the path and make sure to add the trailing /.
  13. Click OK.
  14. In the same area double the click the path variable.
  15. Add ;C:\ImageMagick\ to the end of the path. Make you sure you add the ; before the path.
Open up php.ini and add this to the bottom of it:
Code:
[PHP_IMAGICK]
extension=php_imagick.dll
MAGICK_HOME C:\ImageMagick\
Lastly reboot the server to load the new DLL's to memory.

You should now see ImageMagick enabled in PHP info.

If you want to install for PHP 7.1 then download the 7.1 deps and PHP extension.
 
Last edited:
RESULT :D

I followed the guide above by AWS and still could not get ImageMagick to show in phpinfo.php
I went back through everything, checked the environment variables, php.ini, etc, etc and still it did not show.
Nothing showing in the php error logs

And then..... Within IIS Manager> [select website]> PHP Manager there is a link to 'enable or disable an extension'
Looking in here showed 'php_imagick.dll' as disabled
Enabling it and then rechecking phpinfo.php and Result, all is good :D


imagick module enabled imagick module version @PACKAGE_VERSION@ imagick classes Imagick, ImagickDraw, ImagickPixel, ImagickPixelIterator, ImagickKernel Imagick compiled with ImageMagick version ImageMagick 7.0.7-11 Q16 x64 2017-11-23 http://www.imagemagick.org Imagick using ImageMagick library version ImageMagick 7.0.7-11 Q16 x64 2017-11-23 http://www.imagemagick.org ImageMagick copyright Copyright (C) 1999-2015 ImageMagick Studio LLC ImageMagick release date 2017-11-23 ImageMagick number of supported formats: 238 ImageMagick supported formats 3FR, 3G2, 3GP, AAI, AI, ART, ARW, AVI, AVS, BGR, BGRA, BGRO, BIE, BMP, BMP2, BMP3, BRF, CAL, CALS, CANVAS, CAPTION, CIN, CIP, CLIP, CLIPBOARD, CMYK, CMYKA, CR2, CRW, CUR, CUT, DCM, DCR, DCX, DDS, DFONT, DJVU, DNG, DOT, DPS, DPX, DXT1, DXT5, EMF, EPDF, EPI, EPS, EPS2, EPS3, EPSF, EPSI, EPT, EPT2, EPT3, ERF, EXR, FAX, FILE, FITS, FLIF, FPX, FRACTAL, FTP, FTS, G3, G4, GIF, GIF87, GRADIENT, GRAY, GROUP4, GV, HALD, HDR, HISTOGRAM, HRZ, HTM, HTML, HTTP, HTTPS, ICB, ICO, ICON, IIQ, INFO, INLINE, IPL, ISOBRL, ISOBRL6, J2C, J2K, JBG, JBIG, JNG, JNX, JP2, JPC, JPE, JPEG, JPG, JPM, JPS, JPT, JSON, K25, KDC, LABEL, M2V, M4V, MAC, MAP, MASK, MAT, MATTE, MEF, MIFF, MKV, MNG, MONO, MOV, MP4, MPC, MPEG, MPG, MRW, MSL, MSVG, MTV, MVG, NEF, NRW, NULL, ORF, OTB, OTF, PAL, PALM, PAM, PANGO, PATTERN, PBM, PCD, PCDS, PCL, PCT, PCX, PDB, PDF, PDFA, PEF, PES, PFA, PFB, PFM, PGM, PICON, PICT, PIX, PJPEG, PLASMA, PNG, PNG00, PNG24, PNG32, PNG48, PNG64, PNG8, PNM, PPM, PS, PS2, PS3, PSB, PSD, PTIF, PWP, RADIAL-GRADIENT, RAF, RAS, RAW, RGB, RGBA, RGBO, RGF, RLA, RLE, RMF, RW2, SCR, SCREENSHOT, SCT, SFW, SGI, SHTML, SIX, SIXEL, SPARSE-COLOR, SR2, SRF, STEGANO, SUN, SVG, SVGZ, TEXT, TGA, THUMBNAIL, TIFF, TIFF64, TILE, TIM, TTC, TTF, TXT, UBRL, UBRL6, UIL, UYVY, VDA, VICAR, VID, VIFF, VIPS, VST, WBMP, WEBP, WMF, WMV, WPG, X3F, XBM, XC, XCF, XPM, XPS, XV, YCbCr, YCbCrA, YUV

Many thanks AWS

Edit: I changed the PHP Version to 7.2.4 prior to installing ImageMagick
 
  • Like
Reactions: AWS
Glad you got it working.

Isn't PHP manager a great tool. So easy to add other versions of PHP or run a different version for each site if you want to.
 
Yes, I've used it for a while and never paid much attention to the 'enable or disable and extension' link and there were no references to it and this issue anywhere in my Google searches.

One advantage of PHP manager was I've recently updated one site that had several softwares dependent on PHP5.5/5.6 and would not work with 7+
Being able to do the upgrades and then switch the live site to 7+ with the click of a couple of buttons certainly made the whole process easy and also allowed me to roll back to the earlier version quickly, working a stage at a time.
 
Here's a quick gotcha that I ran into while getting imageMagick installed on my managed server. I asked the support folks to enable the extension and they did so very quickly. I knew to enable it in the ACP, but found the selection to be unselectable, grayed out. I added that to the ticket.

Of course, a different tech responded and asked a bunch of questions that were answered in an earlier ticket. While that was going on, I turned here to the Xenforo forums and researched everything I could find about the issue. This led me to the 'Select PHP Version' page in my Cpanel on the server. I learned about creating a php file to run the phpinfo command. It showed imagick installed correctly. It still did not work.

Finally, I realized that my rvpics.com account, where I needed imagick installed is actually a second account under my main account on this server. I pointed the (new) tech to that fact and he duplicated the installation where I wanted it in the first place. Now it works.

So the lesson here, if you are not running your own server, is to listen carefully to what the techs are asking in the ticket and get involved in troubleshooting the problem yourself. It was my realization that they were working on the wrong account that led to the final resolution. Hope this helps someone else in a similar situation.
 
Top Bottom