我试图将PDF文件转换为PNG文件。它从命令行很好(我的GhostScript 8.64已经安装)。但是,从PHP我有一个问题:ImageMagick/Imagick使用原生PHP API将PDF转换为JPG
代码:
$im = new Imagick($pdf_file); // this is where it throws the exception below
输出:
Fatal error: Uncaught exception ‘ImagickException’ with message ‘Postscript delegate failed `23_1235606503.pdf’: No such file or directory @ pdf.c/ReadPDFImage/612′ in get_thumbnail.php:93
Stack trace:
\#0 get_thumbnail.php(93): Imagick->__construct(’…’)
等等,等等
我不知道我在做什么这里错了,但我怀疑它与我的服务器配置有关。我运行: 的Apache 2.2.11 PHP 5.2.8 的ImageMagick 6.4.8-9 GhostScript的8.64
如何知道apache环境路径是什么? – 2013-06-19 15:53:02
非常好!只需要添加,像这样创建符号链接:sudo ln -s/usr/local/bin/gs/usr/bin/gs – Ondrej 2014-02-07 17:47:28
保持获取`无法读取文件错误`并且解决了这个问题。多谢兄弟。 – 2015-06-02 22:10:06