In this article, I will show you step-by-step how to install ImageMagick PHP extension in Windows. Make sure you follow the steps carefully so that you can successfully install it.
Based on imagemagick.org, ImageMagick is a free, open-source software suite, used for editing and manipulating digital images. It can be used to create, edit, compose, or convert bitmap images, and supports a wide range of file formats, including JPEG, PNG, GIF, TIFF, and PDF.
Before you install Imagick, you must first check the PHP version, PHP architecture, and whether your PHP is Thread Safety or not.
You can check this by creating a PHP program that runs the
After that, you have to download the Imagick package at https://pecl.php.net/package/imagick
Choose a version that is stable and matches your PHP version. In this case, my PHP version is 8.1+.
You should also download the Imagick Visual C++ package at https://windows.php.net/downloads/pecl/deps
Look for a package with the name ImageMagick and select it according to your Windows architecture.
Copy the file with the name
php_imagick.dll that is in the php_imagick folder that you have downloaded in the second step.!
Copy all the files with
.dll format in the bin folder belonging to the Imagick Visual C++ folder that you have downloaded in the third step.
Change the contents of the file named php.ini in the PHP folder by adding
extension=imagick and save it.
In some cases, you have to type it like this
extension=php_imagick.dll, it depends if the other listed extensions include the
.dll format or not.
Restart your apache and check whether the imagick extension is installed or not using the
If successfully installed then you will find an extension with the name imagick when you run the
See the image below:
Notes: If you use Laragon, you must check the imagick extension first. The method is by right-clicking on Laragon, select PHP then go to the extensions menu and search for imagick.
These are the step-by-step how to install ImageMagick PHP extension in Windows. Hopefully the article is useful for you and don't forget to leave a comment on the article.