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.
Problem with Godaddy
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Problem with Godaddy
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.
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.
-
- Posts: 26
- Joined: 2009-08-26T02:17:36-07:00
- Authentication code: 8675309
- Location: India
- Contact:
Re: Problem with Godaddy
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.
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.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Problem with Godaddy
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);
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);
-
- Posts: 26
- Joined: 2009-08-26T02:17:36-07:00
- Authentication code: 8675309
- Location: India
- Contact:
Re: Problem with Godaddy
No it's not working it still gives empty Array() .
-
- Posts: 26
- Joined: 2009-08-26T02:17:36-07:00
- Authentication code: 8675309
- Location: India
- Contact:
Re: Problem with Godaddy
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.
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.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Problem with Godaddy
perhaps because the - is sending to stdout and not to php
-
- Posts: 26
- Joined: 2009-08-26T02:17:36-07:00
- Authentication code: 8675309
- Location: India
- Contact:
Re: Problem with Godaddy
Thanks Fmw42.