SuperGeekery: A blog probably of interest only to nerds by John F Morton.

A blog prob­a­bly of inter­est only to nerds by John F Mor­ton.

Installing Imagick in Valet

When­ev­er I update to new ver­sions of PHP in my local instal­la­tion, I need to rein­stall Imag­ick. Since I look up these steps every time, I’m doc­u­ment­ing them here so future me can remem­ber this.

Is Imag­ick real­ly not installed? #

First you might have it installed on your machine. Does this return a ver­sion num­ber?

convert -version

If so, you have it installed but it might not be wired up for your PHP ver­sion. Check that out with this com­mand.

php -i | grep Imagick

If you see ref­er­ences to Imag­ick, you’ve already got it installed and con­fig­ured for PHP to use it. If not, let’s install it.

If you didn’t have Imag­ick installed at all, install it with Home­brew like this: #

brew install imagemagick

Now the fol­low­ing should return a ver­sion num­ber:

convert -version

You now have it but it’s not hooked up” to your PHP instal­la­tion. We use pecl to do that.

pecl install imagick

Now you’ll need to restart Valet.

valet restart

Check your work #

php -i | grep Imagick

Do you see ref­er­ences to Imag­ick? If so, you’ve done it.

Let the image mag­ic begin.

QR code for the Installing Imagick in Valet

Link to this page