views:

9

answers:

0

I'm trying to convert a PDF file to a PNG file using PHP and ImageMagick, the small testcase looks like this:

echo exec('/usr/bin/convert test.pdf test.png');

When I'm running this from the command line (php5 pdftest.php) it works just fine, however, when I'm running the request from the webserver, the script echos Last OS error: 12, the error log contains

GPL Ghostscript 8.62: Unrecoverable error, exit code 1
convert: Postscript delegate failed `test.pdf': No such file or directory

OS error 12 is Cannot allocate memory, however raising the memory limit to 256MB didn't work.
Running convert -debug "All" doesn't help me either, as ghostscript doesn't print more information.
How can I get more information (short of using strace, etc.)?