php ImageMagic can not use GhostScript to render PDF

1

In my hosting, ImageMagic renders PDF to JPEG normally. But I need to make it work in my local MAMP testing - making sites without local testing sucks! ImageMagic is apparently OK on my MAMP running on Mac OS X Lion. The error appears as follows:

PHP Fatal error:  Uncaught exception 'ImagickException' with message 'Postscript delegate failed '/Library/WebServer/Documents/www/sintran/apitaco/edicao-03-005-12-2013.pdf': No such file or directory @ error/pdf.c/ReadPDFImage/713' in /Library/WebServer/Documents/www/sintran/conteudo_apitaco_jpeg.php:10

In the Terminal, I tested with "gs /Library/WebServer/Documents/www/sintran/apitaco/edicao-03-005-12-2013.pdf" and the file was opened in an X11 window normally. But I do not handle much of the UNIX command line, and I do not know how to do more complex tests with GhostScript.

After some research, I suspect permissions issues, since ImageMagic uses an X11 application that is "outside" of php. It looks like GhostScript would use the folder indicated in php.ini: upload_tmp_dir = / Applications / MAMP / tmp / php. It is? This folder has only the common users (I, admin and everyone), unlike other system folders (the usr folder, for example, has system, wheel and everyone), possibly GhostScript could not write there. But you can not add a user "system" through the Information window, it does not appear in the user list. How do I do this?

Any other possibility?

    
asked by anonymous 14.05.2015 / 15:19

0 answers