I'm using Yosemite Server (Apache), Terascript , ImageMagick and Ghostscript in a web serving environment. I'm having issues creating JPGs from PDFs from a script. A bit of background. I have a development server running Lion Server, Apache 2.2, Terascript 6.21, ImageMagick (?.?) and Ghostscript (?.?) and the process works perfectly there. A client uploads a PDF and the combination of a shell script, ImageMagick and Ghostscript successfully creates a JPG. I've set up the production server with all newer versions of the software (Apache 2.4, Terascript 7, ImageMagick 6.9.3-8, Ghostscript 9.19. I can confirm that when I enter the commands from Terminal it generates a JPG from a PDF successfully: sudo -u username -p password /opt/local/bin/convert -thumbnail 215x300 /path/to/source.pdf -flatten /path/to/target.jpg When I generate the same from a script it fails with this error: 4/15/16 1:46:24.983 PM sudo: wayneirvine : TTY=unknown ; PWD=/Applications/TeraScript Server 7/log_TeraScript_Server_7 ; USER=username ; COMMAND=/opt/local/bin/convert -thumbnail 215x300 /path/to/source.pdf -flatten /path/to/target.jpg I tried adding the following lines to the sudoers file: Default:username !requiretty username ALL=(ALL) NOPASSWD: ALL Now I get no error, but no JPG either. Any help from the unix gurus would be appreciated.