How to Install ImageMagick PHP Extension on Windows
In this article, I’m going to share how to install imagick PHP extension on Windows.
Table of Contents
We need to find PHP version, thread safety and architecture. We can find these info in some ways. We can get these info from
phpinfo(); very easily.
Please take a look at the red marks. We’ve found the three info.
We need to download ImageMagick on Windows. Visit imagemagick website and download
ImageMagick-<version>-Q16-<architecture>-dll.exe file & then install.
After installation, you can check the installed version from CMD:
Now, we have to download Imagick for PHP and select the DLL from the latest available version.
Click on the DLL link. You’ll be redirected to the new page. Scroll down the page and you’ll find the DLL List.
From the above list, please match with your PHP version, architecture and thread safe info and download the file. The downloaded file will look like
Lastly, we have to download required Imagick binaries. From the page, download the binaries according to your php & architecture info.
Note: You can easily download Imagick for PHP & Binaries from this link.
After downloading all files:
php_imagick-….zip, and save it to the
extdirectory of your PHP installation. Example: xampp’s PHP location
- Extract the DLL files from
ImageMagick-….ziplocated in the
binfolder that start with
IM_MOD_RL, and save them to the PHP root directory (where you have
php.exe), or to a directory in your
- Add this line to your
- Restart the Apache/NGINX Windows service.
Now check the PHP info and search for imagick. If everything is correct, you’ll see these info:
You can run this code to check imagick works or not:
The article is over. Thanks for reading. ?
<?php // Create an Imagick object $image = new Imagick(); // Use newImage function to create new image $image->newImage(650, 400, '#FF0000'); // Set the image format $image->setImageFormat('png'); header('Content-type: image/png'); // Display the output image echo $image; ?>
Preview may take a few seconds to load.
Below you will find some common used markdown syntax. For a deeper dive in Markdown check out this Cheat Sheet
Bold & Italic
Bold **double asterisks**
Three back ticks and then enter your code blocks here.
# This is a Heading 1
## This is a Heading 2
### This is a Heading 3
> type a greater than sign and start typing your quote.
You can add links by adding text inside of  and the link inside of (), like so:
To add a numbered list you can simply start with a number and a ., like so:
1. The first item in my list
For an unordered list, you can add a dash -, like so:
- The start of my list
You can add images by selecting the image icon, which will upload and add an image to the editor, or you can manually add the image by adding an exclamation !, followed by the alt text inside of , and the image URL inside of (), like so:
To add a divider you can add three dashes or three asterisks:
--- or ***