| 
	
 | 
 Posted by Rory Browne on 07/30/05 22:07 
Does the command work when you try it from the command line? 
 
If so, then try shell_exec("env > some_filename") and show us the results. 
 
If not, then the problem is with your command. 
 
First thing I would check is the existance of /usr/local/bin/mogrify 
 
On 7/29/05, leonski <brotit@netscape.net> wrote: 
> Greetings. 
>  
> I've practically worn my eyeballs out trying to figure out a problem and 
> in desperation am posting here in the hope for familiar eyes to guide 
> me, so thanks in advance. 
>  
> check out this code section: 
>  
> if (file_exists($imagefile)) { 
>     $execstring = escapeshellarg("/usr/local/bin/mogrify ".$imagefile." 
> -resize 95x72! "); 
>     } 
>     else echo ("sorry there was a problem with that file"); 
> // then....2>&1 is assisting the debug 
> $op = shell_exec($execstring.' 2>&1'); 
>     echo $op; 
>  
> pretty simple - uses the ImageMagick: mogrify. Funny enough it doesn't 
> work. The output is: 
>  
>  sh: line 1: /usr/local/bin/mogrify /tmp/phpS1KCen -resize 320x240! : 
> No such file or directory sh: line 1: /usr/local/bin/mogrify 
> /tmp/phpS1KCen -resize 95x72! : No such file or directory 
>  
> beats me how it gets inside the if, if it doesn't exist! 
>  
> I have also tried ImageMagick:convert executable with a generated 
> tempfile using tempnam() and the file is created in /tmp as expected, 
> but is not filled by the convert - it stays empty, fails and doesn't get 
>  cleaned up. 
>  
> I cannot give a link to php.ini as its not on a public server. But Safe 
> mode is Off, file size limits are OK as $imagefile can be displayed to 
> the screen prior to the shell_exec call. 
>  
> I also tried using GD instead of ImageMagick and could not get 
> imagecreatetruecolor to work either. 
>  
> OS is OS X on my laptop, entropy build of PHP as "Apache/1.3.29 (Darwin) 
> PHP/5.0.4" 
>  
> I really do not know if this is a PHP, Apache or OS issue. Permissions 
> are not it, I'm sure, and the user is www quite capable of writing into 
> and reading from tmp, so there is no issue there. 
>  
> If anybody can tell me what *anything* about this problem, I'd be greatful. 
>  
> leonski. 
>  
> -- 
> PHP General Mailing List (http://www.php.net/) 
> To unsubscribe, visit: http://www.php.net/unsub.php 
>  
>
 
  
Navigation:
[Reply to this message] 
 |