I'm trying this code in PHP to create a preview image of a PDF file and I'm getting this error.
if ($imgfiletype == 'pdf'){
$im = new imagick($file_path.'[0]');
$im->setImageFormat('jpg');
header('Content-Type: image/jpeg');
echo $im;
}
Fatal error : Uncaught ImagickException: FailedToExecuteCommand `'gs' -q -dQUIET...
I know it's something with ghostscript, but it is installed on the server.