Troubleshooting Imagick Installation on Ubuntu 11.10
You are encountering a classic dependency mismatch when trying to get ImageMagick working with PHP on Ubuntu 11.10. The error message checking ImageMagick MagickWand API configuration program... configure: error: not found is the smoking gun here. It indicates that while you might have installed the core ImageMagick binaries, the PHP-Imagick extension specifically requires development headers and config scripts (MagickWand-config or Wand-config) that are often missing from a standard installation.
The quick fix using sudo apt-get install imagick-php5 often fails on this specific Ubuntu release because the package manager cannot resolve the necessary build dependencies automatically, or it installs a version of ImageMagick that lacks the required development libraries for the PECL extension to compile against. When you attempt the manual PECL installation via pecl install imagick, the build process expects these headers to exist in /usr/include and the config scripts to be accessible in your PATH, but Ubuntu 11.10's default repositories sometimes provide an incomplete set of tools for this purpose.
To resolve this, you must ensure the full ImageMagick development stack is present before attempting the PHP installation. Run the following command to install the base libraries, the shared library required by the extension, and crucially, the development headers:
sudo apt-get update
sudo apt-get install libmagickwand-dev imagemagick php5-pear
The libmagickwand-dev package provides the MagickWand-config script that your compiler is currently hunting for. Without this specific .dev package, the PECL build system cannot locate the ImageMagick API definition files. Once these dependencies are satisfied, you can proceed with installing the PHP extension using PEAR or directly via PECL:
sudo pecl install imagick
sudo php5enmod imagick
sudo service apache2 restart
If you are using a different PHP-FPM setup, ensure you update the respective configuration files to load the new module. You might need to add extension=imagick.so to your php.ini file if it wasn't automatically included after enabling the module.
A common pitfall on older Ubuntu versions like 11.10 is version incompatibility between the PHP binary and the ImageMagick library. If you have mixed libraries from different sources or upgraded ImageMagick manually without updating the development headers, you will continue to see configuration errors. Stick to the packages provided by the Ubuntu repositories for this specific release to ensure ABI compatibility.
If you find yourself needing a more modern version of ImageMagick that offers better performance or security updates than what is available in the 11.10 repositories, consider compiling from source using the ImageMagick package on GitHub or SourceForge. However, be aware that this introduces significant complexity regarding shared object libraries (.so) and may require updating your PHP configuration to point to the new library paths. For most standard web applications running on Ubuntu 11.10, sticking to the repository versions with the correct development headers installed is the most stable approach.
If you are working within a Laravel or Symfony ecosystem and need to integrate this functionality quickly, ensuring the underlying system packages are correctly resolved is just as critical as configuring your application's autoloaders. For developers managing legacy systems where upgrading the OS immediately isn't an option, verifying that libmagickwand-dev is present before running pecl install remains the single most effective troubleshooting step.