PHP exec error, possibly MAMP using ghostscript
Posted
by
user1762526
on Stack Overflow
See other posts from Stack Overflow
or by user1762526
Published on 2012-10-21T03:52:32Z
Indexed on
2012/10/21
23:01 UTC
Read the original article
Hit count: 178
I have been trying to use ghostscript in PHP to convert pdf files to images (png, jpg).
I don't really care as long as they are images. This is the code that I used.
exec("gs -sDEVICE=jpeg -sOutputFile=/Applications/Mamp/htdocs/cover.jpg -r144 /Applications/Mamp/htdocs/test.pdf");
When I enter the exact same thing, without the exec and quotes obviously, into the command line it does exactly what I want. However, when I run the php file nothing happens. I am using a MAMP server and the server seems to work fine, whenever I run another file with it I have no issues. Anyone have any ideas why it might not execute right?
© Stack Overflow or respective owner