Install ImageMagick on CentOS / cPanel/WHM for an Older PHP Version 5.3

Install ImageMagick on CentOS / cPanel/WHM for an Older PHP Version 5.3

 

The standard way of installing any PHP pecl extension would be to run pecl install NAME-OF-EXT .

However this does not always work for some outdated PHP version. This is due to the fact that pecl would try to download and install the newest version of the extension that you are trying to install.

In our case PHP 5.3 would not work with the newest imagick release and you would get an error that the extension requires a newer PHP version.

What you would need to do in this case is to go to http://pecl.php.net/ and check which version is compatible with your PHP installation.

In our case we could go ahead and run the following:

 
pecl install imagick-3.1.2 

This would basically install Imagick 3.1.2 which is compatible with the PHP 5.3 version.

This applies for any other pecl extension that you would like to install on an older PHP version.

If you get an error during the compilation you would need to install the following:

yum install -y ImageMagick ImageMagick-devel

Hope that this helps and saves you time.

Materialize

The Real-Time Data Platform for Developers

Buy me a coffeeBuy me a coffee