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:
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.
Choose a version that is stable and matches your PHP version. In this case, my PHP version is 8.1+.
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.
Step 4
Paste the php_imagick.dll
file in the ext folder where your PHP folder is located.
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.
Step 6
Paste all the .dll
files you copied into your PHP folder.
Step 7
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.
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:
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)