如何在Amazon Linux上安装PHP 7的imagick?

I'm trying to install Imagick extension for PHP 7 on Amazon Linux Server.

I typed the following command,

sudo yum install php70-php-pecl-imagick

and I get lots of error messages.

Error: Package: ImageMagick-last-libs-6.9.4.4-1.el6.remi.x86_64 (remi-safe)
       Requires: libgdk_pixbuf-2.0.so.0()(64bit)
Error: Package: ImageMagick-last-libs-6.9.4.4-1.el6.remi.x86_64 (remi-safe)
       Requires: libHalf.so.6()(64bit)
Error: Package: ImageMagick-last-libs-6.9.4.4-1.el6.remi.x86_64 (remi-safe)
       Requires: libImath.so.6()(64bit)
Error: Package: ImageMagick-last-libs-6.9.4.4-1.el6.remi.x86_64 (remi-safe)
       Requires: libgvc.so.5()(64bit)
Error: Package: ImageMagick-last-libs-6.9.4.4-1.el6.remi.x86_64 (remi-safe)
       Requires: libIex.so.6()(64bit)
Error: Package: ImageMagick-last-libs-6.9.4.4-1.el6.remi.x86_64 (remi-safe)
       Requires: libcdt.so.4()(64bit)
Error: Package: ImageMagick-last-libs-6.9.4.4-1.el6.remi.x86_64 (remi-safe)
       Requires: librsvg-2.so.2()(64bit)
Error: Package: ImageMagick-last-libs-6.9.4.4-1.el6.remi.x86_64 (remi-safe)
       Requires: libgraph.so.4()(64bit)
Error: Package: ImageMagick-last-libs-6.9.4.4-1.el6.remi.x86_64 (remi-safe)
       Requires: libIlmImf.so.6()(64bit)
Error: Package: ImageMagick-last-libs-6.9.4.4-1.el6.remi.x86_64 (remi-safe)
       Requires: libIlmThread.so.6()(64bit)

I tried to 'yum install' those required libraries but it says no packages available, so I googled but no clues.

Anybody knows how to install imagick extension for php 7 or how can I install those required libraries?

Fist remove the remi-repo for el6 (which you don't use) and will cause serious troubles to your OS if you continue using it.

rm -rf /etc/yum.repos.d/remi-safe.repo

Then add the correct remi-repo for el7:

wget http://rpms.famillecollet.com/enterprise/remi-release-7.rpm
rpm -Uvh remi-release-7.rpm

Now try running yum again:

sudo yum install php70-php-pecl-imagick

Running PHP 7.0 on Amazon Linux: This is the correct package name. You added an addition "-php-" in the name which wasn't valid.

$ sudo yum install php70-pecl-imagick

PHP 7.1X

sudo yum install php71-pecl-imagick

PHP 7.0X

sudo yum install php70-pecl-imagick