为什么会文件读取不到,路径 pdf文件权限都已设置
<code>$PDF = './22.pdf';
$IM =new imagick();
$IM->setResolution(120,120);
$IM->setCompressionQuality(100);
$IM->readImage($PDF);
foreach($IM as $Key => $Var){
$Var->setImageFormat('png');
$Filename = './'.md5($Key.time()).'.png';
if($Var->writeImage($Filename)==true){
$Return[]= $Filename;
}
}
</code>报错内容:Fatal error: Uncaught exception 'ImagickException' with message 'Failed to read the file' in
为什么会文件读取不到,路径 pdf文件权限都已设置
<code>$PDF = './22.pdf';
$IM =new imagick();
$IM->setResolution(120,120);
$IM->setCompressionQuality(100);
$IM->readImage($PDF);
foreach($IM as $Key => $Var){
$Var->setImageFormat('png');
$Filename = './'.md5($Key.time()).'.png';
if($Var->writeImage($Filename)==true){
$Return[]= $Filename;
}
}
</code>报错内容:Fatal error: Uncaught exception 'ImagickException' with message 'Failed to read the file' in
$PDF使用绝对路径呢
立即学习“PHP免费学习笔记(深入)”;
<code>try {
// read img
} catch (ImagickException $e) {
echo exception;
}</code>
全网最新最细最实用WPS零基础入门到精通全套教程!带你真正掌握WPS办公! 内含Excel基础操作、函数设计、数据透视表等
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号