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.

Problem with Godaddy

Postby sanjeevk » 2009-11-06T01:31:18+00:00

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.
sanjeevk
 
Posts: 24
Joined: 2009-08-26T02:17:36+00:00
Location: India

Re: Problem with Godaddy

Postby fmw42 » 2009-11-06T10:32:04+00:00

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.
fmw42
 
Posts: 2746
Joined: 2007-07-02T17:14:51+00:00
Location: Sunnyvale, California, USA

Re: Problem with Godaddy

Postby sanjeevk » 2009-11-08T22:00:46+00:00

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.
sanjeevk
 
Posts: 24
Joined: 2009-08-26T02:17:36+00:00
Location: India

Re: Problem with Godaddy

Postby fmw42 » 2009-11-08T22:16:15+00:00

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);
fmw42
 
Posts: 2746
Joined: 2007-07-02T17:14:51+00:00
Location: Sunnyvale, California, USA

Re: Problem with Godaddy

Postby sanjeevk » 2009-11-08T22:46:15+00:00

No it's not working it still gives empty Array() .
sanjeevk
 
Posts: 24
Joined: 2009-08-26T02:17:36+00:00
Location: India

Re: Problem with Godaddy

Postby sanjeevk » 2009-11-08T23:43:53+00:00

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.
sanjeevk
 
Posts: 24
Joined: 2009-08-26T02:17:36+00:00
Location: India

Re: Problem with Godaddy

Postby fmw42 » 2009-11-09T10:57:45+00:00

perhaps because the - is sending to stdout and not to php
fmw42
 
Posts: 2746
Joined: 2007-07-02T17:14:51+00:00
Location: Sunnyvale, California, USA

Re: Problem with Godaddy

Postby sanjeevk » 2009-11-10T03:08:56+00:00

Thanks Fmw42.
sanjeevk
 
Posts: 24
Joined: 2009-08-26T02:17:36+00:00
Location: India


Return to Developers

Who is online

Users browsing this forum: Google [Bot] and 3 guests