Problem with Godaddy

Questions and postings pertaining to the development of ImageMagick, feature enhancements, and ImageMagick internals. ImageMagick source code and algorithms are discussed here. Usage questions which are too arcane for the normal user list should also be posted here.
Post Reply
sanjeevk
Posts: 26
Joined: 2009-08-26T02:17:36-07:00
Authentication code: 8675309
Location: India
Contact:

Problem with Godaddy

Post 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.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Problem with Godaddy

Post 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.
sanjeevk
Posts: 26
Joined: 2009-08-26T02:17:36-07:00
Authentication code: 8675309
Location: India
Contact:

Re: Problem with Godaddy

Post 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.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Problem with Godaddy

Post 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);
sanjeevk
Posts: 26
Joined: 2009-08-26T02:17:36-07:00
Authentication code: 8675309
Location: India
Contact:

Re: Problem with Godaddy

Post by sanjeevk »

No it's not working it still gives empty Array() .
sanjeevk
Posts: 26
Joined: 2009-08-26T02:17:36-07:00
Authentication code: 8675309
Location: India
Contact:

Re: Problem with Godaddy

Post 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.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Problem with Godaddy

Post by fmw42 »

perhaps because the - is sending to stdout and not to php
sanjeevk
Posts: 26
Joined: 2009-08-26T02:17:36-07:00
Authentication code: 8675309
Location: India
Contact:

Re: Problem with Godaddy

Post by sanjeevk »

Thanks Fmw42.
Post Reply