How to Install the ImageMagick Executable
How to Install the ImageMagick Executable
If your app requires the ImageMagick executables (for example, your app's configuration page asks for a path to ImageMagick) rather than the ImageMagick PHP extension, you can install the ImageMagick package by logging in to your server as root and running this command:
sudo apt-get install imagemagick
You will then be able to run commands, such as convert, from the command line.
Using ImageMagick with PDF Files
ImageMagick was not designed to securely handle untrusted PDF files. Enabling PDF file handling as shown below is dangerous if any malicious PDF files are ever processed.
Additionally, attempting to work around ImageMagick's PDF security issues by using Ghostscript directly is also dangerous as Ghostscript is also vulnerable to exploitation when processing malicious PDF files.
Additionally, attempting to work around ImageMagick's PDF security issues by using Ghostscript directly is also dangerous as Ghostscript is also vulnerable to exploitation when processing malicious PDF files.
In order to allow ImageMagick to process PDF files, you must SSH into your server as root and edit the following file:
/etc/ImageMagick-6/policy.xml
Locate the line:
<policy domain="coder" rights="none" pattern="PDF" />
Comment out this line by replacing it with the following:
<!--<policy domain="coder" rights="none" pattern="PDF" />-->