Page 1 of 1

Problem with Godaddy

Posted: 2009-11-06T01:31:18-07:00
by sanjeevk
Hi All,

I am running convert command on Godaddy using php script with the help of exec function of php.
<?php

$cmd = $this->convert ." ".$path." -format %c -depth 8 histogram:info:-";
$output = array();
exec($cmd, $output);
?>

It gives me empty array.

while when I am running the same command using command prompt or shell prompt, It's working.

" /usr/local/bin/convert /home/content/f/l/o/floordecor/html/app/webroot/img/admin/designs/103/103_Rectangle.png -format %c -depth 8 histogram:info:- "

while the same php script is working on my local Linux system.

Any one give me suggestion on the same.

Re: Problem with Godaddy

Posted: 2009-11-06T10:32:04-07:00
by fmw42
php requires the full path to convert, namely, /usr/local/bin/convert

To test try this:

<?php
exec("/usr/local/bin/convert -version",$out,$returnval);
print_r($out[0]);
?>


P.S. Godaddy's IM is ancient at 6.2.6. I have asked that they upgrade, but did not get any indication of any intention to do so. You might suggest the same. If enough people request it, perhaps they will do so.

Re: Problem with Godaddy

Posted: 2009-11-08T22:00:46-07:00
by sanjeevk
Hi

Thanks for you suggestion

This command .
<?php
exec("/usr/local/bin/convert -version",$out,$returnval);
print_r($out[0]);
?>

Run successfully . and gives output as
/*
*Version: ImageMagick 6.2.8 02/25/09 Q16 file:/usr/share/ImageMagick-6.2.8/doc/index.html;
*/


But when I am trying with
<?php
exec("/usr/local/bin/convert /home/content/f/l/o/floordecor/html/app/webroot/img/admin/designs/103/103_Rectangle.png -format %c -depth 8 histogram:info:-",$out);
print_r($out);
?>
I got empty array.
while when we run same command using shell prompt it gives me proper output.
please suggest on the same.

Re: Problem with Godaddy

Posted: 2009-11-08T22:16:15-07:00
by fmw42
try

exec("/usr/local/bin/convert /home/content/f/l/o/floordecor/html/app/webroot/img/admin/designs/103/103_Rectangle.png -format %c -depth 8 histogram:info:- 2>&1",$out);
print_r($out);

Re: Problem with Godaddy

Posted: 2009-11-08T22:46:15-07:00
by sanjeevk
No it's not working it still gives empty Array() .

Re: Problem with Godaddy

Posted: 2009-11-08T23:43:53-07:00
by sanjeevk
Hi ,
I have solved this problem. when I am using the same command as :-

<?php
exec("/usr/local/bin/convert /home/content/f/l/o/floordecor/html/app/webroot/img/admin/designs/103/103_Rectangle.png -format %c -depth 8 histogram:info: ",$out);
print_r($out);
?>
It's working.

while in my last command I am using as :-

<?php
exec("/usr/local/bin/convert /home/content/f/l/o/floordecor/html/app/webroot/img/admin/designs/103/103_Rectangle.png -format %c -depth 8 histogram:info:- ",$out);
print_r($out);
?>
It is not working see bold part of these command for diff.
But I am not getting exact why ???
Thanks.

Re: Problem with Godaddy

Posted: 2009-11-09T10:57:45-07:00
by fmw42
perhaps because the - is sending to stdout and not to php

Re: Problem with Godaddy

Posted: 2009-11-10T03:08:56-07:00
by sanjeevk
Thanks Fmw42.