[magick-users] strange prob with convert and php as frontend
zentara
zentara1 at sbcglobal.net
Sun Dec 21 05:09:33 PST 2008
On Sat, 20 Dec 2008 18:22:58 -0800 (PST)
cuongvt <freebsd at vuhanhnhu.com> wrote:
>cuongvt wrote:
>>
>> I'm in freebsd 7.0, imagemagick 6.4.7, php 5.2.8.
>> If I execute below very simple php script (named 'convert.php') from
>> web-base: http://localhost/convert.php, it not converted image at all,
>> but if I execute from shell: 'php convert.php', it converted original
>> image for me.
>> Very strange. Could anyone tell me where's I'm wrong?
>> Below is my simple php script:
>> <?php
>> $im_path="/usr/local/bin";
>> system("$im_path/convert image.JPG hello.jpg ");
>> ?>
>Could anyone know do I missed something?
>regards
Hi, I don't use php, but similar problems arise in Perl CGI, where
you can run a script as a user from a shell, but not from the web.
The problem is most likely a permissions problem, where your
web server is running with the absolute lowest permissions, and
it can't run things in /usr/local/bin. This is done, so that anyone coming
from the outside web, has no permissions except in specially defined
directories which are mode 777. /usr/local/bin is probably 755
Check your web logs for errors. You probably can run convert from
the web server's cgi directory, but it all depends on the web server configuration
file. You can also do things with "sudo" to allow the nobody:nogroup webserver
to run things, but it can be dangerous.
Thats my guess, :-)
zentara
--
I'm not really a human, but I play one on earth.
http://zentara.net/Remember_How_Lucky_You_Are.html
More information about the Magick-users
mailing list