Re: exec command fails in php, works in the command line

From: Date: Wed, 21 Sep 2005 15:43:31 +0000
Subject: Re: exec command fails in php, works in the command line
References: 1 2 3 4 5  Groups: php.general 
Request: Send a blank email to php-general+get-222872@lists.php.net to get a copy of this message
ernst@newdisorder.com wrote:
I don't want to crowd the list up with dead ends, so I was trying to respond only to you. <snip>
You'll get more chances at finding the solution to this with the list's eyes on it rather than just myself. Plus, it provides an archive of the problem and the (if we find it) solution to the next person who comes along. </snip>
I'm not calling a php program from exec, I'm calling ecasound and convert. For example, in the php code: <snip>
Understood, but if the web server doesn't have permission to execute the app, it won't. </snip>
exec("convert $internalpath/$filename -resize {$thumbWidth}x{$thumbHeight} $internalpath/$thumbname", $out, $err); doesn't always work, but with variables substituted on the command line: <snip>
Are you sure that the variables have value, and it is the value you want? What is stored in $err when you try to execute this? Echo that out, and it may tell you exactly what's going wrong. </snip>
bash:~> convert futon.jpg -resize 240x180 futon_thumb.jpg will always work. The same is true, on a different server, of my exec that calls ecasound, an mp3 processing utility. Both of these could conceivably use a lot of resources, which is why I think php is killing them off some of the time. <snip>
Try increasing the memory limit in your script with ini_set. -- John C. Nichel ÜberGeek KegWorks.com 716.856.9675 john@kegworks.com

« previous php.general (#222872) next »