> ## Knowledge Base Index
> Fetch the complete knowledge base index at: https://helpdesk.gbnetwork.com/sitemap.xml
> Use this file to discover available pages before exploring further.
> Pure-Markdown content can be obtained by appending a '.md' suffix to the content URLs listed in the sitemap (without the trailing slash).

# How To Install ImageMagick and imagick PHP extension?

| Copy and paste the following command into SSH.

1. Installing ImageMagick
```
yum -y install ImageMagick-devel ImageMagick-c++-devel ImageMagick-perl
```

2. Installing the ImageMagick PHP extensions for PHP versions 5.4, 5.5, 5.6, 7.0 and 7.1
```
for phpver in $(ls -1 /opt/cpanel/ |grep ea-php | sed 's/ea-php//g') ; do
printf "\autodetect" | /opt/cpanel/ea-php$phpver/root/usr/bin/pecl install imagick
echo 'extension=imagick.so' >> /opt/cpanel/ea-php$phpver/root/etc/php.d/imagick.ini
done
/scripts/restartsrv_httpd
/scripts/restartsrv_apache_php_fpm
```
3. Test to make sure ImageMagick is installed:
```
usr/bin/convert --version
```

4. Test to make sure the PHP extensions loaded:

```
for phpver in $(ls -1 /opt/cpanel/ |grep ea-php | sed 's/ea-php//g') ; do
echo "PHP $phpver" ; /opt/cpanel/ea-php$phpver/root/usr/bin/php -m |grep imagick done
```

```
PHP 54 imagick
PHP 55 imagick
PHP 56 imagick
PHP 70 imagick
PHP 71 imagick
```