ext-imagick * -> the requested PHP extension imagick is missing from your system

ext-imagick * -> the requested PHP extension imagick is missing from your system

  1. Blog
  2. 15 November 2026
  3. 4 min read

Stefan Bogdanescu

Founder & Senior Architect

ext-imagick * -> the requested PHP extension imagick is missing from your system

When you encounter the Composer error ext-imagick * -> the requested PHP extension imagick is missing from your system, it often feels like a contradiction. You have verified that the Imagick extension is installed, enabled in both CLI and FPM contexts via php.ini, and confirmed functionality using test scripts. Yet, when running composer update on a Laravel project requiring devisephp/cms 1.4.*, Composer insists the dependency is unmet.

This discrepancy arises because Composer's dependency resolver operates within a specific context defined by your composer.json. The error message indicates that the package manifest explicitly demands the Imagick extension, but Composer cannot detect it in its current environment state relative to the lock file or the platform requirements specified during installation.

Understanding Composer's Platform Requirements

Composer determines whether an extension is available by inspecting the PHP runtime at the moment the command is executed. It does not simply check if the binary exists; it checks if the Zend engine has successfully loaded the specific C extension module and registered the symbols required for reflection or direct usage.

In your scenario, you likely performed a test using php -m or a standalone script in an interactive shell. While this confirms the extension works in CLI mode, Composer might be running under different environmental constraints. For instance, if your project is being installed in a specific directory or via a Docker container (common with Homestead), the PHP binary path used by Composer must align exactly with the one where Imagick is enabled.

If you have separate php.ini files for CLI and FPM, ensure that the environment variables, specifically PHPRC, are not causing Composer to pick up a configuration file that lacks the extension=imagick directive. Even if your main application runs perfectly on FPM, Composer resolves dependencies against the active PHP binary in the shell where you invoke it. If that specific binary doesn't see the extension, the resolver fails immediately, regardless of your application's actual runtime configuration.

Resolving the Mismatch in Homestead

Since you are working with Homestead and PHP 7, the environment is typically containerized or managed via Vagrant. The most common pitfall here is a mismatch between the PHP version Composer detects and the one where Imagick is actually installed.

To resolve this, verify the exact PHP binary Composer is using:

composer diagnose

Run this command in your Homestead VM to see if it reports any missing extensions or path issues. If php -m lists imagick but Composer does not, try forcing Composer to re-evaluate the platform by clearing its cache and re-running the update with explicit platform requirements:

composer clear-cache
composer update --platform-reqs=php/7.0@ext-imagick

However, a more robust solution involves ensuring that the imagick extension is explicitly enabled in the php.ini file located at the path Composer uses. Check the output of php -i | grep imagick to see if it appears in the loaded modules list for the specific binary you are invoking.

The Case of devisaPHP CMS 1.4

The package devisephp/cms 1.4.0 has a hard dependency on ext-imagick. This is not optional; the library relies on ImageMagick's C++ bindings directly from PHP. If you are cloning the bootstrap version and it works there, it is likely because that specific codebase does not trigger Composer to check for this extension, or the environment was manually configured without strict dependency enforcement.

Once you add another package that triggers a full composer update, the resolver scans all require statements in your root composer.json. If devisephp/cms is listed there with version 1.4.*, it strictly enforces the extension requirement. The fact that image handling works in your cloned bootstrap suggests that PHP itself has access to Imagick, but the Composer resolver failed to map that capability to the package's requirements during the update process.

Final Verification Steps

If re-enabling the extension and clearing caches does not resolve the issue, check for conflicting php.ini configurations within the Homestead box. Sometimes, Vagrant boxes have multiple PHP installations or legacy configuration files that interfere with new extensions. Ensure that extension=imagick.so (or .so equivalent for your OS) is uncommented in the active configuration file used by the CLI binary running Composer.

Additionally, verify that you are not running Composer inside a Docker container that has a different base image than the one where Imagick was installed. If Homestead uses a specific PHP version per project, ensure that version matches the requirements listed in the composer.json for devisephp/cms.

By aligning the PHP binary path, ensuring the extension is loaded in the correct configuration file, and clearing Composer's internal state, you can resolve the ext-imagick * error and successfully update your dependencies.

Our network