Column 1
Skip to content
Column 1

Install Imagick on Linux: Match PHP and Verify WordPress

Imagick logo with AlmaLinux, Ubuntu, RockyLinux, and CloudLinux logos, symbolizing compatibility and installation.

To install Imagick on Linux, match the extension to the PHP runtime that serves your website. Ubuntu packages, AlmaLinux or Rocky Linux system PHP, cPanel EA-PHP, and CloudLinux Alt-PHP are different installation paths. Installing a module for the server's command-line PHP does not prove that WordPress can use it.

This guide helps you choose the right path, enable the extension without replacing an unrelated PHP installation, and verify image processing in WordPress. Use your hosting provider's supported packages and maintenance process; the operating-system name alone is not enough to choose a package.

Before Installing: Identify the Website's PHP

  1. Open the affected WordPress site's Tools > Site Health > Info. Record its PHP version under Server and inspect Media handling for the active image editor, Imagick version, and ImageMagick version.
  2. In the hosting panel, identify the PHP version assigned to that domain and whether it uses system PHP, EA-PHP, or Alt-PHP. If PHP-FPM is enabled, identify the runtime serving that site.
  3. Confirm who owns package maintenance. A shared-hosting customer should use the available extension selector or ask the host; installing a WordPress plugin does not install a server-level PHP extension.
  4. For an administrator-managed server, confirm a recent usable backup and note the current PHP package source and extension configuration. Arrange a maintenance window if loading the extension requires restarting a shared PHP service.

The WordPress Site Health documentation explains these read-only diagnostics. Do not post a complete diagnostic export publicly or leave a public PHP information page behind.

Imagick and ImageMagick Are Not the Same Component

ImageMagick supplies image-processing libraries and tools. Imagick is the PHP extension that exposes the library to PHP applications. Their version numbers differ, and the PHP extension's presence does not establish that every image format is supported. The PHP Imagick requirements explain that format support depends on the underlying ImageMagick build and its dependencies.

Check the library and extension versions separately. A working command-line image tool is not a substitute for checking the PHP runtime behind your website.

Ubuntu: Use the Package for the Website's PHP Version

  1. Check the installed Ubuntu release and the repository that supplies the site's PHP. For distribution PHP, look up the Imagick package in Ubuntu's package catalogue for that same release.
  2. Review the package dependencies before installation. Ubuntu 22.04's php-imagick package depends on php8.1-imagick; Ubuntu 24.04's php-imagick package depends on php8.3-imagick. Those defaults are not instructions to change a website that uses another PHP version.
  3. Install the matching extension through the package manager. When PHP comes from a different maintained repository, use that provider's matching extension package and instructions. Stop if the proposed transaction replaces the site's PHP unexpectedly.
  4. Confirm the module is enabled for the web runtime, then have the administrator reload or restart the relevant PHP service as required. For PHP-FPM, restarting Nginx alone does not reload PHP extensions.

The extension package supplies PHP bindings and library dependencies; do not assume it also installs the ImageMagick command-line tools. There is no need to combine an extension install with an unplanned full-server upgrade.

AlmaLinux and Rocky Linux: Keep the PHP Package Source Consistent

First determine whether the site uses the operating system's PHP, a third-party PHP repository, or a hosting-panel runtime. Do not install a second generic PHP stack just to obtain Imagick.

  1. Review the active PHP stream and package provider for the website. Check that provider's supported Imagick package and ImageMagick dependencies for the exact distribution release and PHP version.
  2. If your server already uses Remi packages, consult the maintainer's repository configuration guidance and linked configuration wizard. Repository requirements differ by release; enabling a new PHP stream is a separate migration decision.
  3. Prefer a maintained extension package that matches that runtime. If the provider requires a source build, follow its instructions with the matching PHP development tools. The PHP installation documentation identifies Imagick as an extension distributed through PECL.
  4. Verify how the package enables the extension before adding configuration manually. Duplicate module-loading entries can create warnings. Reload the affected PHP runtime using your normal service-management process.

For a cPanel-managed server, use the EA-PHP path below instead of applying generic system-PHP instructions.

WHM/cPanel: Select the Correct EA-PHP Version

cPanel's ImageMagick installation procedure for EA-PHP separates operating-system libraries from the PHP extension. The administrator installs the appropriate library prerequisites, then uses WHM > Software > Module Installers > PHP PECL.

Select the PHP version used by the domain, apply that selection, and install Imagick for that version. Repeat only for other runtimes that actually need it. Follow cPanel's CageFS skeleton update and PHP-FPM restart steps when those components are in use. Do not edit cPanel's own internal PHP configuration to enable an extension for a customer website.

CloudLinux: Check Alt-PHP and the Account's Extension Selection

  1. Confirm whether the affected domain actually uses Alt-PHP or EA-PHP. CloudLinux on the server does not mean every domain uses the same runtime.
  2. For a PHP Selector-managed account, open Select PHP Version, confirm the selected version, and enable Imagick in the available extensions. If it is missing or unavailable, ask the host to check the matching Alt-PHP packages and account configuration.
  3. Have the host verify CageFS visibility and the PHP handler's compatibility. An extension installed outside the account's runtime may still be unavailable to the site.
  4. Recheck the affected website after applying the change. Do not reset all customers' PHP versions or extension selections to troubleshoot a single account.

The CloudLinux PHP Selector documentation describes its runtime and module-loading behavior. Avoid a fixed loop that installs packages for old PHP versions regardless of what the server currently uses.

Verify Imagick in WordPress

  1. Return to Tools > Site Health > Info > Media handling on the affected site. Confirm the reported Imagick and ImageMagick versions and which image editor is active.
  2. Upload a small, non-sensitive test image through the Media Library. Check its thumbnail and a page that displays it. Test the specific format your workflow needs, rather than assuming that a successful JPEG proves PDF or WebP support.
  3. For WooCommerce, test a non-live product image or staging product gallery. Check the image sizes used by the theme before regenerating a large media library.
  4. Review the relevant PHP error log privately. Confirm there are no new extension-loading errors or failures in scheduled image-processing work.

Success means the correct runtime loads the module and the website's real image workflow works. It does not mean installing Imagick will automatically improve search rankings or every performance metric.

Troubleshooting: Start With the Failing Layer

Imagick Works in the Terminal but Is Missing in WordPress

Compare the site's PHP version and handler with the command-line runtime. Check the extension selection for that domain, the active PHP configuration, and whether its PHP workers were reloaded. Do not keep installing the same module into a different PHP tree.

Ubuntu Reports That the ImageMagick Command Is Missing

Separate command-line-tool availability from PHP extension availability. ImageMagick 7 uses the magick command as described in its version 7 migration documentation; a version 6 installation may expose the older tools instead. Check the installed package and library version before treating a missing command name as a broken WordPress extension.

One Image Format Fails but Others Work

Review the format support of the installed library, required delegates, and the host's resource limits. An ImageMagick policy may intentionally prohibit an operation. Use the ImageMagick security-policy guidance with the administrator; do not disable protective policies wholesale to make an upload succeed.

The Website Breaks After Enabling the Extension

Undo the specific extension or configuration change through the same package or panel workflow, then reload the affected runtime and retest. Do not remove shared image libraries without reviewing their dependants. Keep the maintenance window open until both the website and other services sharing that runtime have passed their checks.

Need Help With WordPress Image Processing?

For WordPress support with missing Imagick, failed uploads, or thumbnail generation, collect the PHP version, hosting runtime, a sanitized error description, and the image format that fails. Share diagnostic details privately. For the wider performance picture, see our WordPress performance guide; for server administration, browse the hosting guides.