Jared Carlson wrote:
> Evening,
>
> This might be an easy one, but I'm struggling a bit with a PHP script. The script simply converts a postscript file to a PNG using ImageMagick's convert...
>
> so:
>
> exec("/usr/bin/convert temp.ps temp.png");
>
>>From my local server this script isn't working, it just silently fails. However, from command line the script works just fine. So my conclusion is the www user doesn't have permission to execute convert whereas from the command line the user (jcarl) does...
>
> I can dump out CONVERT help from the PHP script (so the www user can) but I can't create the PNG file via the local server...
>
> Any ideas? Thanks - and have a good weekend...
The problem could also be the current directory. When you launch a
shell command inside of PHP, I believe the default directory is the
APACHE root, not the DOCUMENT root. Try specifying full paths for the
input and output files, too.
Also, consider using the more powerful proc_open() instead of exec(), so
you can capture stdout and stderr, as well as set up environment
variables. etc.
--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
_______________________________________________
Discuss mailing list
Discuss@...
http://lists.blu.org/mailman/listinfo/discuss