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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I don't want to crowd the list up with dead ends, so I was trying to respond only to you. I'm not calling a php program from exec, I'm calling ecasound and convert. For example, in the php code:

exec("convert $internalpath/$filename -resize {$thumbWidth}x{$thumbHeight} $internalpath/$thumbname", $out, $err);

doesn't always work, but with variables substituted on the command line:

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.



On Wed, 21 Sep 2005, John Nichel wrote:

Please reply to the list.

ernst@xxxxxxxxxxxxxxx wrote:
No, all of these things your are bringing up would cause the programs to NEVER work, not work some of the time or when the data they are processing is small.

Depends on the install.  My cli uses a different php.ini than the web one.

Did you check permissions? Does the user which your web server is running as have execute permission on the app?

 On Wed, 21 Sep 2005, John Nichel wrote:

ernst@xxxxxxxxxxxxxxx wrote:

I have two programs on two servers, and they both have similar problems. In each one, I use 'exec' to call a helper program. In one case, it is ecasound, which I use to resample an mp3. In the other, it is convert, which creates a thumbnail of a very large image the user has uploaded. In both cases, the exec command fails. Not all the time, but some times. In both cases, the command that is being called by exec will work fine at the command line. I assume that there is some memory / resource limit that is being breached when this happens, but I don't know what it is, or how to tell php to allow my programs to run. Any ideas?


Or is save mode on?

--
John C. Nichel
ÜberGeek
KegWorks.com
716.856.9675
john@xxxxxxxxxxxx

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


New Disorder Records - ten years of something:
Coming soon, new Power Struggle CD.
* Free Email with 5 megs, no ads
* Internet Radio Station - upload your music, we'll put it in rotation
* 100's of CDs for sale
* videos, message board, byofl
http://www.newdisorder.com


--
John C. Nichel
ÜberGeek
KegWorks.com
716.856.9675
john@xxxxxxxxxxxx

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


New Disorder Records - ten years of something:
Coming soon, new Power Struggle CD.
* Free Email with 5 megs, no ads
* Internet Radio Station - upload your music, we'll put it in rotation
* 100's of CDs for sale
* videos, message board, byofl
http://www.newdisorder.com
-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux