Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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 gcc
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
make && make install
# Install imagick PHP extension from PECL
yum install -y php-pear php-devel
yes | pecl install imagick
echo 'extension=imagick.so' > /etc/php.d/40-imagick.ini
# Output installed versions
convert --version
php --ri imagick
@nobel6018
Copy link

nobel6018 commented Feb 1, 2022

Thank you for sharing your experience.
It was helpful for me.

./configure needs ' --disable-dependency-tracking' option (ImageMagick-7.1.0-22)
./configure --disable-dependency-tracking
(for amazonlinux:2 env)

related issue link

Thank you!!

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