I make a script with:
<?php

$cmd = "/usr/local/bin/mencoder /home/httpd/vhosts/videosmios.com/httpdocs/video/25.wmv -o /home/httpd/vhosts/videosmios.com/httpdocs/flvideo/25.flv -of lav$

$last_line = system($cmd, $retval);

echo '
</pre>
<hr />Last line of the output: ' . $last_line . '
<hr />Return value: ' . $retval;

?>
when i executed this script return value 127 but the video was not encoded, but by command line the comnand is ok.
I have all necesary packages installed.
If i executed into command line:
php convert.php all ok and return 0, after the video is ok.