I have Ghostscript, ImageMagick, and IIS 5.0 installed on a Windows 2008 Server box.
I also have a PHP script that runs a conversion script to generate thumbnails for a PDF that is uploaded to a directory:
<?php $output = array(); $ret = 0; echo exec('convert D:\content\myfile.pdf D:\content\myfile_thumb_1.jpg', $output, $ret); var_dump($ret); ?>
I've determined the issue is that the script, when called from the web browser, runs as user IUSR_[COMPUTERNAME].
As my administrator account, the command successfully executes from the CMD line (duh).
What permissions do I have to change to allow for the thumbnail to be generated by the script/IUSR user?
I've tried changing the permissions on the following:
- The GhostScript Program Files directory (allowing execute, write, read)
- The ImageMagick directory (allowing execute, write, read)
- The upload directory where the thumbnails reside (allowing read, write)
All through Windows Explorer, right clicking the directory, properties, and then the Security tab. I add the permissions to [COMPUTERNAME]/Guests, because IUSR_[COMPUTERNAME] is under the Guests group.
I'm not familiar enough with IIS or Windows to know this, but do you have to reboot the box to update permissions or should it just work after I apply the changes? I have restarted the IIS service.
Note: I've removed the full computer name and replaced it with [COMPUTERNAME] in the above post