Install Imagick for WordPress on CPanel WHM Server

A quick how-to Install Imagick for WordPress on CPanel WHM Server.

Running Site Health check within and updated wordpress site shows:

One or more recommended modules are missing

PHP modules perform most of the tasks on the server that make your site run. Any changes to these must be made by your server administrator.
The WordPress Hosting Team maintains a list of those modules, both recommended and required, in the team handbook (opens in a new tab).

Warning The optional module, imagick, is not installed, or has been disabled.

Following many of the search links to resolve this leads to using the Module Installer PECL via the WHM console, but for me I got this error:

WARNING: channel “pecl.php.net” has updated its protocols, use “pecl channel-update pecl.php.net” to update Warning: popen() has been disabled for security reasons in OS/Guess.php on line 241 Warning: fgets() expects parameter 1 to be resource, null given in OS/Guess.php on line 242 Warning: pclose() expects parameter 1 to be resource, null given in OS/Guess.php on line 251 downloading imagick-3.4.4.tgz … Starting to download imagick-3.4.4.tgz (253,434 bytes) ……………………………………………..done: 253,434 bytes 19 source files, building running: phpize Warning: popen() has been disabled for security reasons in PEAR/Builder.php on line 465 ERROR: failed to run `phpize’

Continuing my search ended up at the CPanel forums and a resolution for installing imagick from cPanelMichael and a command line option – noting that I modified my command line to use ea-php73 which is the target version of php for this WordPress site.

/opt/cpanel/ea-php70/root/usr/bin/pecl install imagick

Reviewing my own setup, I had already used the following script.

/scripts/installimagemagick”
before proceeding with the “imagick” PECL installation

Running the Site Health check again showed the same issue. So I restarted Apache and the PHP-FPM services and tested again. Issue resolved.

One reply

Leave a Reply

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