Re: Still can't fix it.

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

 



ok,
it seems to be working, pretty easily for me; note, this code is a gross
oversimplification
of anything i would use in production; its just a little test script.

<?php
$sourceFile = $_GET['sourceFile'];
$destFile = $_GET['destFile'];

echo $sourceFile . ' ' . $destFile;

if(is_file("./$sourceFile")) {
echo 'source file is cool..';
        $result = system("mencoder $sourceFile -o ./$destFile -ovc lavc -oac
mp3lame");
        var_dump($result);
        if($result && is_file("./$destFile")) {
                die("$destFile created successfully!");
        }
}
die("$destFile could not be created!");
?>

here is the url i go to to trigger the script:
http://localhost/mEncode.php?sourceFile=WindowsMedia.wmv&destFile=WindowsMedia.avi

and heres the last bit of the output from the browser:
WindowsMedia.avi created successfully!

have you been trying to run the script from the cli, or from the browser?
i would first try to run your php script from the cli; eg.
php myMencoderScript.php <inputFile> <outputFile>

if it works there, and not from the browser, id imagine its a permissions
issue.  but i was able
to run my script from the browser, w/o altering the perms on the mencoder
binary, as the stock
perms on my box are:
nathan@trident ~/Desktop $ ls -l /usr/bin/mencoder
-rwxr-xr-x 1 root root 6637020 Jan 19 10:38 /usr/bin/mencoder

you can find out what they are on your system by issuing;
ls -l `which mencoder`

if other is, r-x, you should be good to go.  if your script isnt working
from the cli
then something probly needs to be cleaned up in there.  try to make it as
simple as
possible to start out.  once you get it working, you can add all the other
features you want.

-nathan

[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