yum install ghostscript
yum install ImageMagick ImageMagick-devel
yum install gcc php-devel php-pear
pecl install imagick
sudo apt-get install ghostscript
sudo apt-get install imagemagick
sudo apt-get install php-imagick
IMPORTANT: After completing the steps above you may need to add the following to the end of your php.ini file:extension=imagick.so
After all the above, ensure you've restarted Apache, PHP-FPM and/or Nginx.
Uncaught ImagickException: attempt to perform an operation not allowed by the security policy `PDF' @ error/constitute.c/IsCoderAuthorized/408Fix: