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.
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 :
- Unzip the php_imagick file
- Search for the php_imagick.dll file,
- Save it in the ext directory of your PHP installation. For me it is in c:\php\ext\
- Copy all the other DLL files (they may start with CORE_RL, FILTER, IM_MOD_RL, or ImageMagickObject depending on the version)
- Save them in the PHP root directory. For me this is in c:\php\ (where you have php.exe).
Configuring your php.ini file
Add this line to your php.ini file:
extension=php_imagick.dll
Restart the Apache service.
- Right click on the Windows button
- Computer Management
Then you click right on Apache 2.4
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