Install PHP imagick on Windows, MacOS with Laragon and Laravel Herd

- Andrés Cruz

En español

In this entry, we will explain how to install the Imagick DLL on Windows and MacOS, in the Laragon and Laravel Herd environments; this is an extension used for image manipulation in PHP and is used internally by many PHP packages as QR code generators.

Add Imagick in Laragon

Let's see the steps on how to generate the DLL in Windows with Laragon; the first thing we must do is go to the official website whose link I leave at the end of the post and download the version that satisfies your version of PHP and that is not thread safe for Laragon. Once downloaded, we must unzip the zip and copy the DLL called php_imagick.dll into the php folder called ext and make sure to right click on the file, properties and unlock it.

The next step is to go to your Laragon and enable it:

DLLs extensiones en Laragon

In case you cannot enable it or Apache does not recognize the process, you can add the extension directly to your php.ini:

PHP ini laragon

In php.ini, find where extensions are defined by searching for extension= and add the line:


You should see something like:

extension=exif      ; Must be after mbstring as it depends on it
;extension=oci8_12c  ; Use with Oracle Database 12c Instant Client
;extension=oci8_19  ; Use with Oracle Database 19 Instant Client

If it still does not recognize the DLL, you can edit the environment variables, the PATH, and the Imagick extension.

Right click on computer, open "Edit system environment variables", click Environment variables, select PATH, edit and add the path to the final Imagick folder.

If you don't add the PATH of the Imagick folder to your system environment path, php will throw an extension not found error even if the dll is there.

Add extensions in Laravel Herd

Installing additional extensions requires you to install PHP through Homebrew in order to compile them.

You can do this by running:

brew install php

Once PHP is installed via Homebrew, you can install the extension:

pecl install [extension-name]


In this entry, we saw some fundamental steps to be able to install the Imagick DLL in our system in various environments. The steps are generally the same but, depending on the environment, you may have to make some variants like those presented in this entry.

Recommended links:

Andrés Cruz

Develop with Laravel, Django, Flask, CodeIgniter, HTML5, CSS3, MySQL, JavaScript, Vue, Android, iOS, Flutter

Andrés Cruz In Udemy

I agree to receive announcements of interest about this Blog.