PHP ImageMagick Extension (IMagick) with PHP 7.4

Yesterday, I got a warning on my blog dashboard, told me that one recommended plugins has not been installed/configured. It is Imagick plugins.

Imagick: The PHP ImageMagick Extension

The ImageMagick extension, called Imagick when referring to the PHP extension, is a native PHP extension to create and modify images using the ImageMagick API.

To install this extension, run the following commands as your server’s root user (I’m using Ubuntu server):

sudo apt-get -y install gcc make autoconf libc-dev pkg-config
sudo apt-get -y install libmagickwand-dev
sudo pecl7.4-sp install imagick

When prompted with:

Please provide the prefix of Imagemagick installation [autodetect] :

just press Enter; do not type a prefix (that is, allow autodetect).

Once installed, create a configuration file for the extension and restart PHP by running the following commands as root:

sudo bash -c "echo extension=imagick.so > /etc/php7.4-sp/conf.d/imagick.ini"
sudo service php7.4-fpm-sp restart

fIf you are using other PHP version, just replace all 7.4 with yours.

Leave a Reply

Your email address will not be published. Required fields are marked *