I'm trying to use Imagick with PHP. I have installed the program, replaced the core dll files, loaded the dll extension with xampp, but now I get this error:
unable to open module file `C:\Users\sudom\AppData\Local\ImageMagick\IM_MOD_RL_png_.dll': No such file or directory @ warning/module.c/GetMagickModulePath/830
This is the line causing the problem: $image->setImageFormat('png');
. I took a look to the AppData/Local folder, but there's no ImageMagick folder. If I place it there manually, it throws another error. I use:
Downlod the latest version from here https://www.imagemagick.org/script/download.php
ImageMagick-7.0.7-12-Q16-x64-dll.exe
or
ImageMagick-7.0.7-12-Q16-x86-dll.exe
install, make sure adding the Imagick folder to the system PATH. Optionally you can tick legacy utilities (convert, mogrify) during installation. and check in cmd 'magick -version'
c:\convert --version Version: ImageMagick 7.0.7-12 Q16 x64 2017-11-29 http://www.imagemagick.org Copyright: Copyright (C) 1999-2015 ImageMagick Studio LLC License: http://www.imagemagick.org/script/license.php Visual C++: 180040629 Features: Cipher DPC Modules OpenMP Delegates (built-in): bzlib cairo flif freetype gslib jng jp2 jpeg lcms lqr openexr pangocairo png ps raw rsvg tiff webp xml zlib
Download php_imagick.dll from https://pecl.php.net/package/imagick/3.4.3/windows meets your php version requirments, put in to ext folder of php and add it to php.ini file.
extension=php_imagick.dll
Than, go to http://windows.php.net/downloads/pecl/deps/ find needed version
3/27/2016 5:32 PM 32707238 ImageMagick-6.9.3-7-vc11-x64.zip
3/27/2016 5:33 PM 31517070 ImageMagick-6.9.3-7-vc11-x86.zip
3/27/2016 5:34 PM 38717224 ImageMagick-6.9.3-7-vc14-x64.zip
3/27/2016 5:34 PM 37376244 ImageMagick-6.9.3-7-vc14-x86.zip
download package and put all the DLLs files from ImageMagick-6.9.3-7-vc1x-xxx.zip\bin\ except ImageMagickObject.dll to ...\apache\bin\ and restart the apache service.
MUST WORK!
P.S. You can also find all the stuff from mentioned above resources for PHP 7.2 except pecl library. Need to wait for a while.