在centOs 7服务器上使用php Imagick转换pdf文件时出错

在centOs 7服务器上使用php Imagick转换pdf文件时出错,php,imagick,Php,Imagick,当我想使用Imagick在php中转换pdf时,在centos 7服务器上出现以下错误: Fatal error: Uncaught ImagickException: PDFDelegateFailed `[ghostscript library 9.25] -sstdout=%stderr -dQUIET -dSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=2

当我想使用Imagick在php中转换pdf时,在centos 7服务器上出现以下错误:

 Fatal error: Uncaught ImagickException: PDFDelegateFailed `[ghostscript library 9.25] 
-sstdout=%stderr -dQUIET -dSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 
-dAlignToPixels=0 -dGridFitTT=2 '-sDEVICE=pngalpha' -dTextAlphaBits=4 -dGraphicsAlphaBits=4
'-r72x72' '-sOutputFile=/tmp/magick-17313lqGPVXzwlu7%d' '-f/tmp/magick-1731u2enlnnoWk86' '
-f/tmp/magick-1731axoH7ck7ZoM6': 
**** Error: Cannot find a 'startxref' anywhere in the file.
Output may be incorrect. 
**** Error: An error occurred while reading an XREF table. 
**** The file has been damaged. This may have been caused 
**** by a problem while converting or transfering the file. 
**** Ghostscript will attempt to recover the data. 
**** However, the output may be incorrect. 
**** Error: Trailer dictionary not found. Output may be incorrect. 
No pages will be processed (FirstPage > LastPage). ' @ error/pdf.c/ReadPDFImage/659 in /var/www/pdf.php:8
我的代码(在本地成功运行):

我试着和终端通话。但同样的错误也发生了

命令:

convert -quality 60 -density 200 test.pdf foo.jpg
错误:

**** Error: Cannot find a 'startxref' anywhere in the file.
           Output may be incorrect.
**** Error:  An error occurred while reading an XREF table.
**** The file has been damaged.  This may have been caused
**** by a problem while converting or transfering the file.
**** Ghostscript will attempt to recover the data.
**** However, the output may be incorrect.
**** Error:  Trailer dictionary not found.
            Output may be incorrect.
No pages will be processed (FirstPage > LastPage).
convert: Postscript delegate failed `test.pdf': No such file or directory @ error/pdf.c  /ReadPDFImage/678.
convert: no images defined `foo.jpg' @ error/convert.c/ConvertImageCommand/3046.
**** Error: Cannot find a 'startxref' anywhere in the file.
           Output may be incorrect.
**** Error:  An error occurred while reading an XREF table.
**** The file has been damaged.  This may have been caused
**** by a problem while converting or transfering the file.
**** Ghostscript will attempt to recover the data.
**** However, the output may be incorrect.
**** Error:  Trailer dictionary not found.
            Output may be incorrect.
No pages will be processed (FirstPage > LastPage).
convert: Postscript delegate failed `test.pdf': No such file or directory @ error/pdf.c  /ReadPDFImage/678.
convert: no images defined `foo.jpg' @ error/convert.c/ConvertImageCommand/3046.