How do i install imagick on windows?

Published on Apr 09, 2020

In this article, I’m going to share how to install imagick PHP extension on Windows.

Table of Contents

  1. Find Info
  2. Download Files
  3. Configurations
  4. Check
  5. Example

Find Info

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.

Download Files

We need to download ImageMagick on Windows. Visit imagemagick website and download ImageMagick--Q16--dll.exe file & then install.

After installation, you can check the installed version from CMD:

magick -version

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 php_imagick----.zip.

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.

Configurations

After downloading all files:

  1. Extract php_imagick.dll file from php_imagick-….zip, and save it to the ext directory of your PHP installation. Example: xampp’s PHP location C:\xampp\php\ext.
  2. Extract the DLL files from ImageMagick-….zip located in the bin folder that start with CORE_RL and IM_MOD_RL, and save them to the PHP root directory [where you have php.exe], or to a directory in your PATH variable
  3. Add this line to your php.ini file: extension=php_imagick.dll
  4. Restart the Apache/NGINX Windows service.

Check

Now check the PHP info and search for imagick. If everything is correct, you’ll see these info:

Example

You can run this code to check imagick works or not:

The article is over. Thanks for reading. ?

Learn how to configure the Imagick extension in XAMPP for Windows.

Imagick is a native PHP extension to create and modify images using the ImageMagick API. The name causes some confusion as people think that ImageMagick and Imagick are the same thing, however they aren't. You can use ImageMagick without Imagick but you need both Imagick and ImageMagick installed to run it within your PHP code.

You can check with PHP code wheter the Imagick extension is installed or not using:

Bài mới nhất

Chủ Đề