2021.02
As You probably know, we still wait for official release of imagick for php8.
So at this moment we need not official releases.
- Mac
For MAC installation is relay simple with homebrew
brew tap shivammathur/extensions
brew install imagick@8.0
- Windows
PHP | Architecture | Thread Safe | Non Thread Safe | ImageMagick |
---|---|---|---|---|
8.0.2 | x64 | php_imagick-3.4.4-dev x64 ts | php_imagick-3.4.4-dev x64 nts | ImageMagick-7.0.11 x64.zip |
8.0.2 | x86 | php_imagick-3.4.4-dev x86 ts | php_imagick-3.4.4-dev x86 nts | ImageMagick-7.0.11 x86.zip |
Once you downloaded the correct files:
- Extract from
php_imagick-….zip
thephp_imagick.dll
file, and save it to the ext directory of your PHP installation - Extract from
ImageMagick-….zip
files and directory and save them to the PHP root directory (where you have php.exe), or to a directory in your PATH variable - Add this line to your
php.ini
file:extension=php_imagick.dll
- Restart the Apache/NGINX Windows service (if applicable)
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';
Versions for older PHP version as available on https://mlocati.github.io/articles/php-windows-imagick.html
Thanks for great article with examples: https://jite.eu/2021/2/21/imagick-on-php8/