# Fatal error: Uncaught Error: Class 'Imagick' not found in /var/www/app/src/Image/ThumbnailGenerator.php:25

- **ID:** `php/imagick-extension-missing`
- **Domain:** php
- **Category:** install_error
- **Verification:** ai_generated
- **Fix Rate:** 90%

## Root Cause

The Imagick PHP extension is not installed or enabled on the server, so PHP cannot load the Imagick class for image manipulation.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| php:8.1.0 | active | — | — |
| php:8.2.0 | active | — | — |
| php:8.3.0 | active | — | — |

## Workarounds

1. **Install the Imagick extension on Ubuntu/Debian: 'sudo apt-get install php-imagick' or for a specific PHP version 'sudo apt-get install php8.2-imagick'. Then restart the web server: 'sudo systemctl restart apache2' or 'sudo systemctl restart php8.2-fpm'.** (95% success)
   ```
   Install the Imagick extension on Ubuntu/Debian: 'sudo apt-get install php-imagick' or for a specific PHP version 'sudo apt-get install php8.2-imagick'. Then restart the web server: 'sudo systemctl restart apache2' or 'sudo systemctl restart php8.2-fpm'.
   ```
2. **If using a Docker container, add to your Dockerfile: 'RUN apt-get update && apt-get install -y libmagickwand-dev && pecl install imagick && docker-php-ext-enable imagick'** (90% success)
   ```
   If using a Docker container, add to your Dockerfile: 'RUN apt-get update && apt-get install -y libmagickwand-dev && pecl install imagick && docker-php-ext-enable imagick'
   ```
3. **Verify installation by creating a PHP file with '<?php phpinfo(); ?>' and searching for 'imagick' in the output, or run 'php -m | grep imagick' from the command line.** (85% success)
   ```
   Verify installation by creating a PHP file with '<?php phpinfo(); ?>' and searching for 'imagick' in the output, or run 'php -m | grep imagick' from the command line.
   ```

## Dead Ends

- **** — Installing the imagick package via Composer (e.g., 'composer require imagick/imagick') does not install the underlying C extension; it only provides a PHP wrapper that still requires the extension to be installed at the system level. (90% fail)
- **** — Adding 'extension=imagick.so' to php.ini without first installing the ImageMagick libraries (libmagickcore-dev, libmagickwand-dev) results in a PHP startup warning and the extension fails to load. (80% fail)
- **** — Running 'php -m | grep imagick' to check if the extension is loaded, but the check may show it's missing even if the system has ImageMagick installed, because the PHP extension is a separate package. (50% fail)
