October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsClean PCRecommendedOne scan can reveal what keeps slowing WindowsLook for cleanup and repair opportunities.Run ScanOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
VGSources
Blog

How to Install ImageMagick and the PHP Imagick Extension on Linux

A practical Linux guide to installing ImageMagick and the PHP Imagick extension, choosing packages or source builds, using the official AppImage, and fixing SAPI and library errors.
Length11 min Posted Quest giverVGSources Team
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Install ImageMagick and PHP Imagick as two related but separate components. ImageMagick provides the magick image-processing program and libraries; Imagick is the PHP extension that calls those libraries. On most Linux systems, start with the distribution package manager, then verify the command-line tool and the PHP runtime independently. Use a source build only when repository versions, delegates, or installation prefixes do not meet your requirements.

ImageMagick and Imagick are not the same package

ImageMagick is the native image-processing suite. Its command-line entry point is magick, and its libraries provide operations such as reading, resizing, compositing, and writing images. A successful ImageMagick installation can therefore be tested without PHP:

As an Amazon Associate I earn from qualifying purchases.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
magick identify -version

Imagick is a native PHP extension that exposes the ImageMagick API to PHP code. The PHP manual describes it as a PECL extension that is not bundled with PHP. Installing ImageMagick alone does not make new Imagick() available, and installing a PHP package alone does not replace the ImageMagick libraries and executable.

The extension name is imagick. Do not use the names of command-line utilities such as convert as a PHP module name. The two layers must be compatible at build time and at runtime.

#1 Best Overall
Sale
Gaoye Blue Light Blocking Glasses
  • BLUE LIGHT BLOCKING GLASSES: Our blue light glasses for women boast UV400 protection, blocking harmful blue rays from computer screens. With these bluelight glasses women, you can enjoy gaming, reading, or watching TV with no worries of eye strain.
  • EYE RELIEF: Our blue light glasses are engineered to reduce blurry vision or strain caused by prolonged screen time. These womens blue light glasses aid in better sleep by preventing blue light from disrupting your natural sleep cycle, helping you fall asleep faster and enjoy a more restful night's sleep, making them the perfect christmas present.
  • COMFORTABLE: Crafted from durable material, our trendy blue light glasses for woman or blue light glasses men ensure long-lasting comfort. The high-transmittance lenses accessories, gamer gifts for men, help keep your eyes relaxed. Perfect stocking stuffers, gifts for gamers men, christmas gifts for men, halloween costumes.
  • LIGHTWEIGHT: These clear blue light glasses feature a lightweight frame, meaning they’ll stay comfy for long-term wear. Perfect as blue blockers glasses for women or mens blue light glasses, these non-prescription fake glasses for men can be worn throughout the day. The blue light blocking glasses women feature polycarbonate HD lenses, which are anti-reflective and restore true color.
  • WORRY-FREE PURCHASE: If you experience any issues, our support team is ready to assist you quickly. These are the perfect costume glasses for cosplay dressing up.
  • ImageMagick layer: the magick executable, shared libraries, delegates, and security policy.
  • PHP layer: imagick.so, the PHP configuration entry that loads it, and the PHP SAPI (CLI, PHP-FPM, or Apache) that executes your application.

PECL metadata lists ImageMagick 6.5.3-10 or newer and PHP 5.6.0 or newer as minimum requirements. Those figures are package metadata, not a promise that every current Imagick release works with every combination of ImageMagick and PHP. The Imagick 3.8.1 stable release is dated November 26, 2025; check the package or source version available for your distribution before selecting a build.

Choose an installation method

Method Repository maintenance and updates Version and delegate control PHP-SAPI matching Portability Policy control
Distribution packages Managed by your Linux distribution, including security updates when the repositories provide them Limited to repository versions and enabled build options Usually easiest because the package manager supplies the matching PHP module Specific to the distribution and release Uses the distribution configuration; review it before exposing services
Source builds You must track releases, rebuilds, and security fixes Highest control over version, prefix, and optional delegates Requires matching phpize, headers, compiler, and ImageMagick development metadata Can be installed under a controlled prefix, but is not a self-contained binary You control the installed policy files and delegates
Official AppImage (ImageMagick only) You download and replace the application yourself Provides the packaged ImageMagick build supplied in the AppImage Does not install imagick.so; PHP integration is a separate task Portable across compatible Linux systems without a traditional install Inspect the policy with magick -list policy before enabling risky formats or delegates

The Imagick project says that the best installation route is a package manager such as apt, yum, or brew, because it installs ImageMagick as well. For a normal server or development workstation, use that route first. Choose source when a repository is too old, you need a particular delegate or codec, or you must control the installation prefix. Choose an AppImage when you need a portable ImageMagick executable but do not want to replace system packages.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Prepare by identifying the PHP runtime that matters

Installing into the wrong PHP version is the most common reason that php -m and a web application disagree. Before changing packages, record the CLI binary, its version, and its configuration files:

command -v php
php -v
php --ini

Then determine how the application runs. A command-line script uses the PHP binary shown above. A web application may use PHP-FPM behind a web server or an Apache PHP module, potentially with a different version and a different php.ini. Inspect the PHP-FPM pool configuration and service name used by your distribution rather than assuming that the CLI settings apply to the web process.

Plan a service restart after enabling Imagick. PHP-FPM workers, Apache processes, queue workers, and other long-running processes keep the old module list until they are restarted.

Install on Debian and Ubuntu-family systems

1. Check the available PHP package

Debian and Ubuntu repositories commonly provide a generic php-imagick package and, on some releases, a versioned package such as one tied to a specific PHP branch. The package name and repository availability depend on the release. Check what your enabled repositories offer:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
apt-cache policy php-imagick
apt-cache search imagick

Use the package matching the PHP version that your application actually runs. Do not install a module for one PHP branch and expect another branch to load it.

2. Install ImageMagick and Imagick

sudo apt update
sudo apt install imagemagick php-imagick

If your release uses a versioned PHP package, substitute that package for php-imagick. The package manager should pull the corresponding ImageMagick libraries and any required dependencies.

Rank #2
Windex Gaming Cleaning Wipes, Pre-Moistened Wipes to Instantly Clean all Gaming Gear and Electronics, Resealable Packaging for a Freshness Lock, 25 count (Pack of 1)
  • WINDEX GAMING WIPES: effortlessly clean all your gaming gear and gaming electronics in one easy step with our new Windex Gaming Wipes
  • AMMONIA FREE: our ammonia-free formula is safe to use on all of your favorite gaming equipment like consoles, headsets, controllers, screens, keyboards, and more
  • PRE-MOISTENED WIPES: each wipe instantly removes dust, dirt, and stubborn smudges and fingerprints leaving a streak-free shine
  • ANTI-STATIC: great for cleaning and wiping down your gaming gear and electronics leaving behind no visible residue
  • COMPACT RESEALABLE PACKAGE: store your pack of Windex Gaming Wipes anywhere in your home for whenever a quick and easy wipedown is needed

3. Verify both layers

magick identify -version
php -m | grep -i imagick
php --ri imagick

The first command confirms that the executable is present. The second shows whether the active CLI PHP loaded a module named imagick; the third displays the extension’s compiled and runtime information. If the first command succeeds but the latter commands do not, troubleshoot PHP configuration rather than reinstalling ImageMagick.

4. Restart the service used by the application

Restart the PHP-FPM service, Apache, or another relevant worker after package installation. Service names vary by release and PHP branch, so use the service name installed on your machine. Reloading a web server without restarting its PHP-FPM pool may leave old workers in place.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Install on RPM-based systems

1. Confirm the repository package names

Fedora, RHEL-compatible distributions, and other RPM-based systems use package names that vary by release and enabled repositories. Search before installing:

dnf search ImageMagick
 dnf search imagick

Older systems may use yum instead of dnf. The usual pattern is an ImageMagick package plus the repository’s PHP Imagick package (often named along the lines of php-pecl-imagick), but confirm the exact name for your release.

2. Install the packages

sudo dnf install ImageMagick php-pecl-imagick

Replace the second name if your repository uses a different package. Keep the ImageMagick and PHP packages from compatible repositories; mixing independently built libraries with a distribution PHP module can produce loader errors.

3. Verify and restart

magick identify -version
php -m | grep -i imagick
php --ri imagick

Restart the PHP-FPM or Apache service that serves the application. Run the checks again as the same user and with the same PHP binary used by the service where possible.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Use the official ImageMagick AppImage when portability matters

The official ImageMagick download page lists a pre-built Linux AppImage. It is a complete portable ImageMagick application and does not require a traditional package installation. Download the file from that page, place it in a controlled directory, and make it executable:

chmod +x ImageMagick-*.AppImage
./ImageMagick-*.AppImage identify -version

The exact filename depends on the release you downloaded. Running it from its directory avoids accidentally selecting a different system binary. You can also invoke the AppImage with the arguments normally passed to magick.

Rank #3
Sale
LISEN Cell Phone Stand Phone Holder for Desk, Office Decor Gadgets for Men
  • Ergonomic & Adjustable Design: Fight "text neck" and improve your posture. Designed for comfort, it offers an adjustable height (7.1in-8.5in) (1.4in adjustable range) and angle (5°-85°) Please note: cell phone stand is only 9 inches tall—the length of a standard pencil
  • Without blocking subtitles Perfect for office desk Tiktok Face Time Zoom video—this is the ultimate kitchen desk essential for phones! Perfect viewing experience while reducing neck back strain, A must-have for gamers streamers desk, and anyone who values both style and support!
  • Sleek & Stable Design fits Otterbox Case: Say goodbye to bent cables, tangles, and tip-overs! LISEN’s stylish adjustable desk phone holder features a built-in charging hole and smart cable management, keeping your phone secure and your workspace clutter-free cool gadgets for men
  • ANTI-SLIP DESIGN free hands: The under 10.00 items easy gadgets back and the bottom of this kitchen essentials for women are fully covered by anti-skid silicone, which LISEN stand up desk decor can provide maximum protection device from any scratches and slides
  • Your Perfect Viewing Companion:If your product arrives damaged or breaks within 365 days, reach out to LISEN for a quick and hassle-free solution. Struggling with assembly, like tightening the screw? We’ve got your back! Your experience matters to us. (Product including: phone Holder stand*1, screw*1, hexagon screwdriver*1, specification*1)

An AppImage supplies ImageMagick only. It does not install a PHP extension, modify php.ini, or make php --ri imagick succeed. Install Imagick separately through a distribution package or a source/PECL build. If the extension was compiled against a system ImageMagick while your application invokes the AppImage, the two installations are still separate; ensure that the libraries used at build and runtime are the ones you intend.

Review the security policy before processing untrusted files or enabling formats that invoke delegates. Inspect the active policy with:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
./ImageMagick-*.AppImage -list policy

Depending on how the AppImage is invoked, the command may be magick -list policy when the AppImage is integrated into your path. Policies commonly restrict formats such as PDF and PostScript or external delegates for good reason. Do not weaken those restrictions without assessing the files and users your service accepts.

Build ImageMagick from source

A source build is justified when the distribution version is too old, a required delegate or codec is missing, or you need a controlled prefix such as /opt or /usr/local. It also transfers responsibility for upgrades and security fixes to you.

1. Install development prerequisites

Install a compiler toolchain, make, pkg-config, and the ImageMagick development package supplied by your distribution. The development package contains MagickCore and MagickWand headers and the metadata that later builds use to locate them. Package names differ: Debian-family systems use a -dev convention, while RPM systems commonly use -devel. Add development packages for any delegates or codecs you explicitly need.

2. Configure and compile

Obtain a released ImageMagick source archive from the official source guide, unpack it, and run the build from the unpacked directory:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
tar xf ImageMagick-<version>.tar.xz
cd ImageMagick-<version>
./configure --prefix=/usr/local
make -j"$(nproc)"
sudo make install
sudo ldconfig

The --prefix value controls where files are installed. If you choose a nonstandard prefix, ensure that its bin directory is on PATH and its library directory is visible to the dynamic linker. A successful build does not automatically mean that an existing shell or service will select the new binary; verify the path explicitly:

command -v magick
magick identify -version

Keep the source build’s major version consistent with the libraries against which Imagick will be compiled. If you later remove or replace those libraries, the PHP extension may fail to load even though its file remains present.

Rank #4
Ledagic IC+RGBW USB Powered Led Light Bar with App & Remote Control, 2 Pack
  • Easy Installation: Our gaming lights have been designed to enhance your entertainment experience. Simply position the led light bar next to your TV or game console to create a game room environment with ease. They come with USB power and a 60 inch cord for direct mounting and mobility
  • Audio Syncing & Extensive Mode: The built-in high-sensitivity music sensor allows you to sync the TV led lights to your favorite music. Lights react and move to the beat of music, film and game audio, creating an incredible immersive sound and light experience – and all without the need for an additional hub. You can choose from 64+ patterns, including strobe, illusion, jump, energy, gradient, running, chasing, fluttering mode etc. Each mode can be applied to different scenes
  • 64+ Chasing IC+RGB & W Effect: The independent control design of IC+RGB and white all-in-one multifunctional rgbw led bar lights monitor backlight allows you to easily switch the led lights for desk between IC+RGB and white to enjoy a variety of lighting effects, you can choose white lighting mode with high brightness for better illumination when working, etc. Choose IC+RGB lighting mode when you need to create an entertaining atmosphere for the light show, 16 million colours of Color changing rgb light bar let you dance to the beat and create a dynamic party atmosphere
  • Dynamic and Dimmable Lights: 1%-full brightness free brightness adjustment gives you the flexibility to adjust dimmable led light bar for room decorations or a variety of occasions
  • USB Powered: USB light bars for room can be powered by powernank, usb charger, TV, Monitor, laptop PC mainframe, making behind TV led lighting bar easy to install in any location.TV led lights are powered by the TV usb interface / PC mainframe, can be turned on/off synchronously with TV / PC

Build and enable Imagick from source

Use this route when no compatible distribution package exists or when you need to pair Imagick with a custom ImageMagick installation. The PHP development headers and build tools must correspond to the exact PHP binary that will load the extension.

1. Check PHP build tooling and ImageMagick metadata

php -v
phpize --version
pkg-config --modversion MagickWand

phpize must target the same PHP branch as the runtime. If pkg-config cannot find MagickWand or MagickCore, install the ImageMagick development package or point PKG_CONFIG_PATH at the .pc files under your chosen prefix. A successful command-line ImageMagick installation alone is not sufficient for compiling a PHP extension.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

2. Fetch and compile the Imagick extension

git clone https://github.com/Imagick/imagick
cd imagick
phpize
./configure
make -j"$(nproc)"
sudo make install

The configure step should report the ImageMagick headers and libraries it will use. Read warnings carefully; proceeding after a missing MagickWand detection usually produces an extension that cannot be linked correctly.

3. Add the extension to the PHP configuration

Installing imagick.so does not necessarily enable it. Find the configuration files read by the target SAPI with php --ini, then add this directive to an appropriate additional ini file:

extension=imagick.so

On distributions with a module helper, use that helper only after confirming that it points to the PHP branch used by the application. For a custom prefix or a separately installed PHP, place the directive in the configuration directory reported by that PHP binary. Do not edit a CLI-only file and assume PHP-FPM will read it.

4. Verify and restart

php --ri imagick
php -m | grep -i imagick

Restart PHP-FPM, Apache, or the relevant worker after enabling the directive. The first successful CLI check proves only that the CLI SAPI loaded the module; verify the web SAPI separately.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Verify the web runtime, not just the shell

Create a temporary diagnostic script in a protected development location and serve it through the same virtual host and PHP-FPM pool as the application:

<?php
if (class_exists('Imagick')) {
    $image = new Imagick();
    echo "Imagick loadedn";
} else {
    echo "Imagick is not loadedn";
}
?>

Remove the diagnostic file after testing; a public PHP information endpoint can disclose paths and build details. If the script says that Imagick is missing while the CLI check succeeds, compare the web pool’s PHP version, php.ini path, extension directory, and enabled ini files with the output from php --ini. Restart the pool after every configuration change.

Best Value
Sale
HUANUO FlowLift™ Dual Monitor Stand, Fully Adjustable Gaming Monitor Desk Mount for 13–32″ Computer Screens, Full Motion VESA 75x75/100x100 with C-Clamp & Grommet Base, Each Arm Holds 4.4 to 19.8 lbs
  • Compatible with Wide Screens - To ensure compatibility with the dual monitor mount, your each monitor must meet three conditions at the same time: First, computer screens size range: 13 to 32 inches. Second, screen weight range: 4.4 to 19.8 lbs. Third, the back of the monitor screen must have VESA mounting holes with a pitch of 75x75mm or 100x100mm.
  • Regarding the compatibility with desks - Your desk must meet three conditions at the same time: First, desk material: Only wooden desks are recommended, plastic or glass desks cannot be used. Second, desk thickness range: 0.59" - 3.54". Third, the bottom of the desk should not have any cross beams or panels, as this will interfere with installation. We recommend carefully checking that your desk and monitors meets all above conditions before purchasing.
  • Dual C-Clamp Hold - Worried your dual monitors might wobble or slip? Our upgraded base uses a larger platform plus a dual C-clamp structure to lock the dual monitor arm firmly to your desk. Each arm safely keeps your screens steady while you type, click and game—no shaking, no sliding, just a clean and secure setup you can trust every day. It also provides Grommet Mounting installation choice, both options ensure stable and secure fixation for your 0.59" - 3.54" desk.
  • Full-Motion Adjustment For Comfortable View - Pull the screen closer when you’re deep in a spreadsheet, push it back to watch videos, or rotate to portrait for coding — moving everything smoothly with just one hand. The monitor stand offers +85°/-50° tilt, ±90° swivel and 360° rotation. Raise your monitor up to 15.75″ to support a healthy sitting posture. Whether you’re working from home, gaming through the night, or switching between video calls and documents, getting the screens to your natural line of sight helps relieve neck, shoulder and back strain so you can stay focused longer with less fatigue.
  • Keep Your Desk Organized: By lifting both screens off the desktop, this dual monitor stand opens up valuable space for your keyboard, notebook, docking station or a simple, clutter-free work area. Built-in cable management guides wires along the arms, keeping cords out of sight and out of the way. Enjoy a tidy, modern workstation that looks as good as it feels to use.

For command-line applications, run the test with the exact interpreter used by the job. A cron entry, supervisor-managed worker, container, or virtual environment may call a different php binary than the interactive shell.

Troubleshoot common failures

php -m does not show imagick

  • Run command -v php, php -v, and php --ini to confirm the interpreter and configuration path.
  • Check that an ini file read by that interpreter contains extension=imagick.so or that the distribution’s module helper enabled it.
  • Confirm that the extension was installed into this PHP’s extension directory, not another version’s directory.
  • Run php --ri imagick; its error output often identifies a missing shared library or an ini-loading problem.

The build cannot find MagickWand or MagickCore

Install the ImageMagick development headers and pkg-config metadata. If ImageMagick is under a custom prefix, export a PKG_CONFIG_PATH containing that prefix’s package files and ensure the compiler and linker can see the same prefix. Re-run ./configure after correcting the paths; changing them only at link time can leave an inconsistent build.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

PHP reports an undefined symbol or cannot load imagick.so

This usually indicates that the extension was built against a different ImageMagick major version or library path than the one available at runtime. Compare magick identify -version and the ImageMagick libraries selected by the dynamic linker with the versions used during the Imagick configure step. Rebuild Imagick against the runtime libraries, or restore the matching ImageMagick installation, then restart every PHP worker.

The CLI works but the website fails

CLI PHP and the web SAPI can use different PHP versions, ini directories, extension directories, and environment variables. Inspect the PHP-FPM pool configuration, confirm its executable and loaded ini files, and restart the pool. Test with a minimal script through the actual web application path rather than relying on a shell command.

ImageMagick works but a format is blocked

Inspect the policy with magick -list policy. PDF, PostScript, and external delegates may be intentionally disabled. Treat policy changes as a security decision: review the input trust boundary, limit service permissions, and enable only the formats and delegates required by the application.

The AppImage is ignored

Check which executable is being selected with command -v magick. Invoke the AppImage by its explicit path or adjust PATH for the service that needs it. Remember that this changes ImageMagick selection only; it does not alter the PHP extension already loaded by PHP.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Operational checks after installation

  • Record the ImageMagick version, Imagick version, PHP version, and installation prefix so future upgrades can reproduce the environment.
  • Apply distribution security updates when using packages; for source and AppImage installations, monitor releases and replace them deliberately.
  • Run magick identify -version and php --ri imagick after upgrades or library changes.
  • Keep ImageMagick policy restrictive for untrusted uploads, especially when PDF, PostScript, or external delegates are not required.
  • Restart PHP-FPM, Apache, queue workers, and other persistent processes after changing extensions or shared libraries.

For most Linux installations, the package-manager route gives the least fragile combination of ImageMagick, Imagick, and PHP-SAPI configuration. Source builds and AppImages remain useful when you need version or portability control, but they require you to manage library paths, policy, compatibility, and updates explicitly.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More quests from Patch Notes

  1. How to Set Up a RedM (RDR2) Server in 2026: License Key, txAdmin and server.cfg, Step by StepBlog11min
  2. Best RedM (RDR2) Server Hosting in 2026: Comparing Four Hosts on Slots, Memory and PriceBlog10min
  3. How to Host a Mindustry Server in 2026: server-release.jar, Port 6567 and the Commands That MatterBlog7min
Recommended PC Tool
Recommended PC Tool
Windows Errors? Fix Them Before They SpreadFree repair scan
Crashes, No Sound, or Screen Glitches?Free driver scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.