azure上托管的laravel应用程序中imagick中的安全策略pdf错误

lf5gs5x2  于 2021-10-10  发布在  Java
关注(0)|答案(0)|浏览(279)

下面是读取pdf文件的imagick代码。

$img = new Imagick();
    $img->setResolution(300,300);
    $img->readImage($pdffile);

以下错误出现在日志中->

production.ERROR: attempt to perform an operation not allowed by the security policy `PDF' @ error/constitute.c/IsCoderAuthorized/408 {"userI
d":1,"exception":"[object] (ImagickException(code: 499): attempt to perform an operation not allowed by the security policy `PDF' @ error/constitute.c/IsCoderAutho
rized/408 at /home/site/wwwroot/app/Http/Controllers/Sample.php:2812)
[stacktrace]

# 0 /home/site/wwwroot/app/Http/Controllers/Sample.php(2812): Imagick->readimage('/tmp/phpPPIrAu')

我在中添加了策略代码 /etc/ImageMagick-6/policy.xml 但没有效果。

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题