How to Install Imagick Extension for PHP 8.3 on a cPanel/WHM Server? Print

  • 0

This guide explains how to correctly install ImageMagick and the Imagick PHP extension on a cPanel server using EasyApache (EA-PHP 8.3).

Follow each step carefully to avoid compilation or dependency errors.

1. Prerequisites

Before installing the Imagick extension, make sure your server has the required tools:

Install OS dependencies

yum install -y ImageMagick ImageMagick-devel gcc make autoconf automake

Install PECL dependencies (optional but recommended)

yum install -y libtool

Verify EA-PHP 8.3 available

/opt/cpanel/ea-php83/root/usr/bin/php -v
2. Install ImageMagick (Server Level)

If ImageMagick is not installed or showing an older version:

 
yum reinstall -y ImageMagick ImageMagick-devel

You can check the installed version using:

convert --version
3. Download & Compile Imagick Module (PHP 8.3)

Imagick from PECL may not support PHP 8.3 yet, so compiling from GitHub source is required.

Run the below commands:

cd /usr/local/src git clone https://github.com/Imagick/imagick.git cd imagick /opt/cpanel/ea-php83/root/usr/bin/phpize ./configure --with-php-config=/opt/cpanel/ea-php83/root/usr/bin/php-config make make install

If the build succeeds, it will show a message similar to:

Installing shared extensions: /opt/cpanel/ea-php83/root/usr/lib64/php/modules/

4. Enable Imagick Extension for PHP 8.3

Create the .ini file

echo "extension=imagick.so" > /opt/cpanel/ea-php83/root/etc/php.d/20-imagick.ini

Restart Apache

systemctl restart httpd

Was this answer helpful?

« Back

Powered by WHMCompleteSolution