How to install Imagick extension on Windows PHP 7.0

Viewed 12972

I need to install Imagic extension on my Apache - PHP 7.0 server. I followed very nice guide located here: https://herbmiller.me/2016/06/16/installing-imagick-php-7/. Based on "php -i" out:

PHP Version => 7.0.13
Compiler => MSVC14 (Visual C++ 2015)
Architecture => x86
Thread Safety => enabled
extension_dir => D:\Program Files (x86)\PHP7\ext => D:\Program Files (x86)\PHP7\ext

I downloaded file

php_imagick-3.4.3rc4-7.0-ts-vc14-x86.zip

from http://windows.php.net/downloads/pecl/releases/imagick/3.4.3rc4/. I coppied all DLL files to D:\Program Files (x86)\PHP7\ext and I added

extension=php_imagick.dll

to my PHP.INI. When I restarted my Apache, Imagic extension was not loaded and Event viewer showed 2 same errors:

The description for Event ID 4 from source PHP-7.0.13 cannot be found. Either the component that raises this event is not installed on your local computer or the installation is corrupted. You can install or repair the component on the local computer.

If the event originated on another computer, the display information had to be saved with the event.

The following information was included with the event: 

php[11628]
PHP Warning: PHP Startup: Unable to load dynamic library 'D:\Program Files (x86)\PHP7\ext\php_imagick.dll' - The specified module could not be found.
 ("d:\Program Files (x86)\Apache24\bin\httpd.exe" -k runservice)

Please, could anybody tell me, what I am doing wrong?

4 Answers

This step worked perfectly for me. First of all, download from below link.

-Install the ImageMagick PHP extension in Windows

enter image description here

  • Extract from php_imagick-….zip to the ext directory the php_imagick.dll file of your PHP installation
  • Extract from ImageMagick-….zip to the root PHP directory (where php.exe resides) the DLL files that start with (and there are a TON):

    CORE_RL_

    IM_MOD_RL_

Add this line to your php.ini file

extension=imagick

And then to run a simple test (should output a 1):

php -r "print(class_exists('imagick'));"


References:

https://github.com/Imagick/imagick/issues/224#issuecomment-367532736

Related