stalling PHP ImageMagick extension on Windows
 

PHP ImageMagick extension on Windows

 

Install the PHP ImageMagick extension on Windows, you will have the download links to your PHP version to install it.

 

logo imagimagick

In order to install the imagick PHP extension on Windows, you need to know the exact version of your PHP. To do this, open a command prompt and as “Administrator” enter these commands

 

Determines the PHP version:

php -i|find “PHP Version”

Determines if the php is in thread safety mode or not

php -i|find “Thread Safety”
If you have a 32-bit x86 PC or a 64-bit x64 PC

Determines the architecture if it is 32-bit or 64-bit

php -i|find “Architecture”
If you have a 32-bit x86 PC or a 64-bit x64 PC

Once you have downloaded the correct :

  1. Unzip the php_imagick file
  2. Search for the php_imagick.dll file,
  3. Save it in the ext directory of your PHP installation. For me it is in c:\php\ext\
  4. Copy all the other DLL files (they may start with CORE_RL, FILTER, IM_MOD_RL, or ImageMagickObject depending on the version)
  5. Save them in the PHP root directory. For me this is in c:\php\ (where you have php.exe).
Les différentes version de php_imagick
Version PHP thread safe Architechture extension
5.5 Oui x86 php_imagick-3.4.3-5.5-ts-vc11-x86.zip
5.5 Oui x64 php_imagick-3.4.3-5.5-ts-vc11-x64.zip
5.5 Oui x86 php_imagick-3.4.3-5.5-nts-vc11-x86.zip
5.5 Oui x64 php_imagick-3.4.3-5.5-nts-vc11-x64.zip
5.6 Oui x86 php_imagick-3.4.3-5.6-ts-vc11-x86.zip
5.6 Oui x64 php_imagick-3.4.3-5.6-ts-vc11-x64.zip
5.6 Oui x86 php_imagick-3.4.3-5.6-nts-vc11-x86.zip
5.6 Oui x64 php_imagick-3.4.3-5.6-nts-vc11-x64.zip
7.0 Oui x86 php_imagick-3.4.3-7.0-ts-vc14-x86.zip
7.0 Oui x64 php_imagick-3.4.3-7.0-ts-vc14-x64.zip
7.0 Oui x86 php_imagick-3.4.3-7.0-nts-vc14-x86.zip
7.0 Oui x64 php_imagick-3.4.3-7.0-nts-vc14-x64.zip
7.1 Oui x86 php_imagick-3.4.4-7.1-ts-vc14-x86.zip
7.1 Oui x64 php_imagick-3.4.4-7.1-ts-vc14-x64.zip
7.1 Oui x86 php_imagick-3.4.4-7.1-nts-vc14-x86.zip
7.1 Oui x64 php_imagick-3.4.4-7.1-nts-vc14-x64.zip
7.2 Oui x86 php_imagick-3.4.4-7.2-ts-vc15-x86.zip
7.2 Oui x64 php_imagick-3.4.4-7.2-ts-vc15-x64.zip
7.2 Oui x86 php_imagick-3.4.4-7.2-nts-vc15-x86.zip
7.2 Oui x64 php_imagick-3.4.4-7.2-nts-vc15-x64.zip
7.3 Oui x86 php_imagick-3.6.0-7.3-ts-vc15-x86.zip
7.3 Oui x64 php_imagick-3.6.0-7.3-ts-vc15-x64.zip
7.3 Oui x86 php_imagick-3.6.0-7.3-nts-vc15-x86.zip
7.3 Oui x64 php_imagick-3.6.0-7.3-nts-vc15-x64.zip
7.4 Oui x86 php_imagick-3.7.0-7.4-ts-vc15-x86.zip
7.4 Oui x64 php_imagick-3.7.0-7.4-ts-vc15-x64.zip
7.4 Oui x86 php_imagick-3.7.0-7.4-nts-vc15-x86.zip
7.4 Oui x64 php_imagick-3.7.0-7.4-nts-vc15-x64.zip
8.0 Oui x86 php_imagick-3.7.0-8.0-ts-vc16-x86.zip
8.0 Oui x64 php_imagick-3.7.0-8.0-ts-vc16-x64.zip
8.0 Oui x86 php_imagick-3.7.0-8.0-nts-vc16-x86.zip
8.0 Oui x64 php_imagick-3.7.0-8.0-nts-vc16-x64.zip
8.1 Oui x86 php_imagick-3.7.0-8.1-ts-vc16-x86.zip
8.1 Oui x64 php_imagick-3.7.0-8.1-ts-vc16-x64.zip
8.1 Oui x86 php_imagick-3.7.0-8.1-nts-vc16-x86.zip
8.1 Oui x64 php_imagick-3.7.0-8.1-nts-vc16-x64.zip

Configuring your php.ini file

Add this line to your php.ini file:
extension=php_imagick.dll

Restart the Apache service.

  1. Right click on the Windows button
  2. Computer Management

PHP ImageMagick extension - Service

Then you click right on Apache 2.4

 

PHP ImageMagick extension - restart service Apache

 

And you restart the Apache service

To test if the extension works, you can run this PHP code :

<?php
$image = new Imagick();
$image->newImage(1, 1, new ImagickPixel('#ffffff'));
$image->setImageFormat('png');
$pngData = $image->getImagesBlob();
echo strpos($pngData, "\x89PNG\r\n\x1a\n") === 0 ? 'Ok' : 'Failed';

Many thanks to https://mlocati.github.io/articles/php-windows-imagick.html

You can see other topics on Installing a web server.

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.