php imagemagic cannot use Ghostscript to render PDF

Asked

Viewed 45 times

1

In my hosting, Imagemagic renders PDF to JPEG normally. But I need to make it work on my MAMP test site - making websites without a test site 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 Terminal, I tested with "Gs /Library/Webserver/Documents/www/sintran/apitaco/edicao-03-005-12-2013.pdf" and the file was opened in X11 window normally. But I don’t know much about the UNIX command line, and I don’t know how to do more complex tests with Ghostscript.

After some research, I am wary of permissions problems, since Imagemagic uses an X11 application that is "outside" of php. It looks like Ghostscript would use the folder specified in php.ini: upload_tmp_dir = /Applications/MAMP/tmp/php. Is that it? This folder has only 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’t add a "system" user through the Information window, it doesn’t appear in the user list. How do I do this?

Any other possibility?

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.