1

if i upload a image in my tool and click on next step then following error occurs:

ImagickException: not authorized `/tmp/comcard_NEgyzR.pdf' @ error/constitute.c/ReadImage/412
/vendor/spatie/pdf-to-image/src/Pdf.php in line 169

Any idea. This happend from one moment to another.

M-easy
  • 31
  • 2
  • 1
    Without any code, it's hard to help you. – Chris Ruskai Oct 11 '18 at 20:07
  • See https://stackoverflow.com/questions/52861946/imagemagick-not-authorized-to-convert-pdf-to-an-image/52863413#52863413 – fmw42 Oct 23 '18 at 15:41
  • Does this answer your question? [convert:not authorized \`aaaa\` @ error/constitute.c/ReadImage/453](https://stackoverflow.com/questions/42928765/convertnot-authorized-aaaa-error-constitute-c-readimage-453) – kenorb Jul 14 '20 at 16:14

2 Answers2

3

I had the same issue after PHP update, not upgrade. Was able to solve it with help from spatie git-hub page with below instruction.


It seems this error started happening for a lot of people last week. No real reason why though. To partially fix...

Step 1: sudo nano /etc/ImageMagick-6/policy.xml

Step2: Add/edit the following lines

<policy domain="coder" rights="read|write" pattern="PDF" /> <policy domain="coder" rights="read|write" pattern="LABEL" />

You may also need to comment out the MGV line if you have it. I did not.

Step3: Restart web server AND php-fpm. i.e. (on nginx/php7.2) sudo service nginx restart sudo systemctl restart php7.2-fpm

Follow the below link for more details if the above 3 steps does not work for you. https://github.com/spatie/laravel-medialibrary/issues/1268#issuecomment-429928562

DfKimera
  • 2,076
  • 2
  • 21
  • 39
Gabby
  • 116
  • 1
  • 7
0

I have face this issue solution change file path correctly change base path to FCPATH of the file where is the saving

[PHP ImagickException: not authorized][1]

Complete Solution link [1]: PHP ImagickException: not authorized

Ghulam Abbas
  • 515
  • 2
  • 10
  • 23