Skip to content

Instantly share code, notes, and snippets.

@chrismo
Forked from sshymko/install_pecl_imagick_amzn2.sh
Last active October 12, 2021 14:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chrismo/6e0f0ffb4691d8d5bbc448a26033435a to your computer and use it in GitHub Desktop.
Save chrismo/6e0f0ffb4691d8d5bbc448a26033435a to your computer and use it in GitHub Desktop.
Install latest ImageMagick 7.x and imagick PHP extension from PECL on Amazon Linux 2
#!/bin/sh
# Uninstall ImageMagic library and imagick PHP extension using it (installed previously)
yum remove -y php-pecl-imagick ImageMagick
# Install libraries for JPG, PNG, GIF, WebP, and TIFF image formats
yum install -y libpng-devel libjpeg-devel openjpeg2-devel libtiff-devel libwebp-devel giflib-devel
# Install latest ImageMagick library compiled from downloaded sources
yum install -y tar gzip gcc make
curl -OL https://www.imagemagick.org/download/ImageMagick.tar.gz
tar xzf ImageMagick.tar.gz
cd ImageMagick*
./configure --prefix=/ \
--with-bzlib=yes \
--with-fontconfig=yes --with-freetype=yes \
--with-gslib=yes --with-gvc=yes \
--with-jpeg=yes --with-openjp2=yes \
--with-png=yes \
--with-tiff=yes \
--disable-dependency-tracking
make && make install
# Output installed versions
convert --version
@chrismo
Copy link
Author

chrismo commented Oct 12, 2021

You can curl a specific version with links like https://download.imagemagick.org/ImageMagick/download/ImageMagick-6.9.12-25.tar.gz

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment