PHP exec error, possibly MAMP using ghostscript
- by user1762526
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?