Posted by

How to install ImageMagick in Laragon

So, you're all set to create your image, but you've hit a snag - the library you're using relies on the Imagick PHP module. No worries, though! Here's a simple guide on how to get Imagick up and running with Laragon (these steps are pretty similar for other applications like XAMPP and WAMP too).

Start off by grabbing the right version of the module from this page: https://pecl.php.net/package/imagick/3.7.0/windows.

Let's say your PHP version is 8.1; in that case, go ahead and download the 8.1 Thread Safe (TS) x64 version.

Once it's downloaded, extract it to a directory of your choice. For this example, let's use "C:\php-imagick-3.7.0".

Now, copy the "php_imagick.dll" to Laragon's PHP extension directory, which typically is something like "D:\laragon\bin\php\php-8.1.28-Win32-vs16-x64\ext".(note that this depends on php version installed in your laragon)

Next up, copy all the DLL files from "C:\php-imagick-3.7.0" to "D:\laragon\bin\php\php-8.1.28-Win32-vs16-x64".

After that, crack open "php.ini" and manually add "extension=php_imagick.dll" to it.

Finally, give Laragon a quick restart - stop it and then fire it up again. And voilà, you're good to go!

To double-check everything's in order, create a PHP file, toss in a phpinfo(); function, and see if Imagick shows up.

That's all there is to it! Happy coding!