strange permissions problem?
Jared Carlson
jcarlson23 at yahoo.com
Sat May 10 08:18:14 EDT 2008
Hey David,
Thanks! That tip got me through it! Once I used the proc_open() function I got a more informative error message (convert: Postscript delegate failed '/...': No such File or directory). From there it was pretty easy to see that convert was having trouble finding ghostscript - I had a symbolic link from /usr/bin/convert -> /opt/local/bin/convert but ghostscript didn't have that same symbolic link so I created the symbolic link and everything worked! The key was getting the error message - great tip, thanks!
- Jared
----- Original Message ----
From: David Kramer <david at thekramers.net>
To: discuss at blu.org
Sent: Friday, May 9, 2008 11:03:32 PM
Subject: Re: strange permissions problem?
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 at blu.org
http://lists.blu.org/mailman/listinfo/discuss
____________________________________________________________________________________
Be a better friend, newshound, and
know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ
--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
More information about the Discuss
mailing list