Reputation: 11
I have a problem when I want to convert a pdf file using a simple php script like:
<?php
shell_exec("convert pdf.pdf image.png");
?>
The conversion works fine when converting from terminal (SSH connection), but only if I'm logged in as myself. The following will give no error nor an output file 'image.png'.
sudo su www-data
<enters password>
convert pdf.pdf image.png
Upvotes: 0
Views: 1006
Reputation: 982
Your file/folder permissions are wrong, imagemagick (convert) needs write permissions:
sudo chmod g+w folder
check out http://www.tuxfiles.org/linuxhelp/filepermissions.html for a good help/explanation what the file/folder "modes" are and how they work.
Upvotes: 2