nasrulhazim
5/10/2019 - 8:27 AM

Install imagick extension for PHP 7.2

Install imagick extension for PHP 7.2

Quick installation of imagick

$ brew install imagick
$ brew install pkg-config
$ brew install imagemagick
$ hash -r
$ pecl install imagick
$ php -m | grep imagick

In case of having following error:

Build process completed successfully
Installing '/usr/local/Cellar/php@7.2/7.2.13/include/php/ext/imagick/php_imagick_shared.h'
Installing '/usr/local/Cellar/php@7.2/7.2.13/pecl/20170718/imagick.so'
ERROR: Adding package pecl.php.net/imagick to registry failed

Copy the imagick.so to PHP Library:

$ cp /usr/local/Cellar/php@7.2/7.2.13/pecl/20170718/imagick.so /usr/local/Cellar/php@7.2/7.2.13/lib/php/20170718

Reference