DEV Community

Cover image for How to install Imagick PHP extension in Windows (Updated)
Muhamad Rizki
Muhamad Rizki

Posted on • Updated on

How to install Imagick PHP extension in Windows (Updated)

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.

About ImageMagick

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.

How to install

Step 1
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 phpinfo() function.

See the image below:
PHP Version You can see that the PHP version I'm using is version 8.1.10, the architecture is x64, and the thread safety is enabled.

Step 2
After that, you have to download the Imagick package, you can download it from this link Imagick For Windows, select the DLL option for Windows.
PHP PECL Choose a version that is stable and matches your PHP version. In this case, my PHP version is 8.1+.
Imagick for Windows

Step 3
Extract and copy the file with the name php_imagick.dll that is in the php_imagick folder that you have downloaded in the second step.
PHP Imagick Folder

Step 4
Paste the php_imagick.dll file in the ext folder where your PHP folder is located.
PHP Folder Ext In this case, I'm using Laragon.

Step 5
Copy all the files with .dll format (except php_imagick.dll) in the php_imagick folder that you have downloaded in the second step.
PHP Imagick Folder

Step 6
Paste all the .dll files you copied into your PHP folder.
PHP Folder

Step 7
Change the contents of the file named php.ini in the PHP folder by adding extension=imagick and save it.
php.ini 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.

Step 8
Restart your apache and check whether the imagick extension is installed or not using the phpinfo() function.

If successfully installed then you will find an extension with the name imagick when you run the phpinfo() function.

See the image below:
php info() 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.

Closing

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.

Top comments (0)